I am trying to integrate checkout payment gateway with angularJS. Code is working perfectly on index.html but not on inner ui-routing pages.
Documentation of payment checkout is given here: https://docs.checkout.com/getting-started/checkout-js-v2/display-options
<form class="payment-form" method="POST" action="https://merchant.com/successUrl">
<script >
window.CKOConfig = {
publicKey: 'pk_test_6ff46046-30af-41d9-bf58-929022d2cd14',
customerEmail: '[email protected]',
appMode: 'lightbox',
value: 100,
currency: 'EUR',
renderMode: 0
};
</script>
<script type="application/javascript" ng-src="https://cdn.checkout.com/v2/sandbox/js/checkout.js"></script>
</form>
Please help.
console errorson the involved pagesbut not on inner ui-routing pages.It's hard to guess what's going on.<script>tag usage is disallowed onng templatesso you need to improvise. When initializing the directive create the<script>tag using Javascript then append it from there. More info loading-external-scripts-within-angular-html-viewsthe checkoutprohibits such action. To improvise though it's untested and fresh from my mind, you can just actually put the checkout script inindex.htmlthen dynamically moving the checkout template using $.appendTo everytime you needed it.