Reputation: 595
I am integrating squareup api in my wordpress woocommerce site I set SqPaymentForm in my plugin But it only shows form labels not input fields. something like this:
I set it in my custom template it works fine but not in my plugin.
Upvotes: 0
Views: 613
Reputation: 4271
The issue is that your javascript is being fired before your plugin has rendered on the page. You can try loading your script in the footer with wp_enqueue_script('squareup-paymentform', 'https://js.squareup.com/v2/paymentform', array(), false, true)
or call paymentform.build()
after your page has loaded. Take a look here for more information: https://docs.connect.squareup.com/articles/adding-payment-form/#generatingpaymentform
Upvotes: 1