Search for Resources and Solutions

set_js_urls - add js links for payment gateways

To improve the user's experience while is making a payment through your system i recommend to use the ajax calls instead redirects to another website. To understand better what i'm meaning please look at the default Midrub Payments gateways.

With JS links you can use the ajax's calls to process the payments. By default, the Payments theme has jQuery and the Midrub's JS file which allows you to make Ajax calls more professionally. 

To add a JS's link in a Payments gateway, please use the code below in the method Payments gateway's class pay:

// For external url 
set_js_urls(array(your url'));  

// For internal url
set_js_urls(array(base_url('path with file')));   

Once done, JS's link will be displayed in the Payments gateway.

Was this article helpful?