Credit card payment form does not show while called through ajax call javascript and php

Hi,
We have single page app. where page is loaded through ajax call using javascript and php.
when running the php page directly as https://abc.com/squareTest.php, then credit card form generated.
image

But when called through ajax, the credit card form does not shows up.

Help is really appreciated

Hi :wave: Are there any errors being thrown in your browser’s developer console when the form is not loading?

No , please. It loads the php file and then square.js file but does not show anything after that.

Can you set some breakpoints in your code to verify if the card.attach method is being called successfully?

Thanks for reaching. There was issue in loading of square file. Though it was showing already loaded. So the source code modified to ensure that external https://sandbox.web.squarecdn.com/v1/square.js is loaded in the dom. Now, card is attached with specified div.
Thanks

1 Like