Javascript Questions (Stripe Integration)

I am working on integrating Stripe into my web module. Stripe recommends that all payment processing happen on the client side (for compliance reasons). They provide some JS libraries to handle capturing the card info, sending it to Stripe, and then returning an ID for the card that was just entered. I’ve seen that I can run javascript functions from the server but I need the reverse, pushing that returned value to the server. What I am trying to figure out is how to implement the JavaScript (a BrowserFrame, maybe?) so that I can read that returned ID to continue processing the payment. Is this possible?

Hi,

I would recommend taking a look at Using a JavaScript library section in our documentation. Here you can find a sample project.

Alternatively, you can use Generic JavaScriptComponent as described in the documentation. Live demo can be found here.

Regards,
Gleb

Hello,
I have to manage the same task and used the jsComponent. The JavaScript of the payment provider is loaded and the init-javascript function is called. But the script tries to redirect the browser to an external located checkout page. This is prevented by the browser. I get an error message in the javascript console of the browser, that means “Content Securit Policy. Settings within the Web-Page prevented to load a inline resurce “script-src” (free translation)”. So the effect is, that the checkout-page from stripe is not displayed. I tried the browser-component and got the same effect.
Do you have an idea how to workaround?

Regards
Michael

Hello,

I found the problem. The Kaspersky Browser Plugin implemented the security policy. After deactivation of the plugin the loading of external located javascript and redirection of the page worked as expected.

Regards
Michael