Getting a HTML response via api

Setting up a payment gateway and after a successful POST api call to their server, I am receiving HTML as a response. How would we go about redirecting a the User to that page, its not a URL or LINK so am assuming we would have to create a new document and do a document.write()?

Does bubble even support HTML responses via Bubble api connector?

Use TEXT and display it in HTML element

yup got that part, any built in method to render the HTML or should I use custom JS?

HTML element will do the job

The HTML element isnt rendering it correctly.


I assume bubble saved the html response as a giant string. I would need to parse it to get rid. of the starting and ending quotes on the string?

Try display as iframe

My entire approach was wrong. The payment gateway expects a form submission not a api call. Ended up creating a plugin to submit a form using JavaScript. Thanks for the help!

Form submission is a POST call with parameter. You don’t need to create a plugin for that. You can also use api connector.

But how do you deal with a redirection once submitted? the api connector doesnt support redirections as a response.

Ha this is more complex with redirection. You cna consider Integromat that will manage this if you want to avoid creating a plugin.

Do you have a link to API doc?

Plugin wasnt that hard, built it in vscode and copied and pasted it into Bubble.
Here is the doc - https://developers.payfast.co.za/documentation/

checking out integromat now…

1 Like

@shawnmi6 did you manage to create the security signature using JS in bubble? I’m getting errors when trying to use the JS code snippets from PayFast’s developer docs for custom integrations. Same issue on setting up the authentication steps on the webhook for the confirmation notification.