Page 1 of 1

Payment Processor URL

Posted: Fri May 07, 2021 11:45 pm
by Aftab2021
I have OC 3020. My payment processor is an unknown local company and they have given me following script for payment integration.

<script async="async" src="https://test.com/payment.js?seller=true" selleraccountcode="Your code" saleamount="amount" callback="callbackurl">
</script>

I cannot understand how to submit data to this script. I have called them and sent emails but they are always sending same script to use. It just shows a button when I use it. My understanding is that it is JS code which runs on client side only whereas PHP runs on server side. How they both can work?

Normally I should be able to post a form to any given URL but I am not sure how can I post form data to this script.

Re: Payment Processor URL

Posted: Sat May 08, 2021 12:57 am
by Cue4cheap
This should be a question to them first. i.e. What do I do with that link? What are the fields? etc. Then you might need to hire a developer to build and integration to make it work with opencart.
Mike

Re: Payment Processor URL

Posted: Sat May 08, 2021 4:37 pm
by Aftab2021
Hi,

I have already developed a form by copying existing payment extensions. And it is passing correct values.

My question is that is it possible to submit form data to this URL that has been provided by payment processor? What I see, it just creates a button on my page.

Re: Payment Processor URL

Posted: Sat May 08, 2021 6:40 pm
by ADD Creative
Without any documentation on your payment processor it hard to say. However, usually when you use a payment script the script will create an form for the payments details or take the customer to their site to enter the payment details there. This is usually to keep the PCI compliance requirement to a minimum.

Re: Payment Processor URL

Posted: Sat May 08, 2021 7:08 pm
by Aftab2021
Hi AddCreative

Is it possible to edit this script in OpenCart at run time and put sellerkey and other parameters in it so that once it is rendered, the button has all the required parameters with it? Sorry for noob questions but I am beginner in web development.

Re: Payment Processor URL

Posted: Sun May 09, 2021 3:44 am
by ADD Creative
Yes, you can either build the script tag in the controller and set the whole tag to be used in the template. Or set the different variables and use in script tag in the template. Look at some other payment modules to see how it's done.

Re: Payment Processor URL

Posted: Mon May 10, 2021 7:02 pm
by paulfeakins
Aftab2021 wrote:
Fri May 07, 2021 11:45 pm
Normally I should be able to post a form to any given URL but I am not sure how can I post form data to this script.
Why?