How to get Payeezy API response from Javascript to PHP file?
Payeezy works for First Data is a payment gateway like PayPal . And now I want to integrate on my website.
And I completely made it through
https://developer.payeezy.com/integration and
https://developer.payeezy.com/payeezy-api-reference/apis .
And so I decided to go with payeezy.js and not PHP API (I'm a PHP guy) and started reading the docs on here and here
For example, consider a scenario (by installing Xampp on Windows)
I saved the files as sample.html C:\Xampp\htdocs\sample.html
and action.phpC:\Xampp\htdocs\action.php
In sample.html I put (another important payeezy.js file )
<html>
...
<!--<form action="{call to merchant server}" method="post" id="payment-info-form" >-->
<form action="action.php" method="post" id="payment-info-form" onsubmit="return validateFormOnSubmit(this);" >
...
</form>
...
<html>
Now in the same file there is an anonymous function in Javascript
...
var responseHandler = function(status, response)
{
...
I am getting status and response from API.
It says that part of the data goes to a file on the seller's server, i.e. action.php, and some not because they don't have 'name' tag in tags <input>
(see sample.html file)
So when I click submit, I am redirected to action.php which is on my (trade) server, so the question is how can I get or print or process the API response in action. php generated with sample.html
source to share
Thank you for using our solution and thank you for your question and interest in our services.
If I understood correctly, your page is getting a response just fine from an API call and you want to send that response to a PHP page on a third party server (your merchant).
If the above statement is correct, you will need to write JavaScript code to get the values ββthe response gives you and send them to a PHP page on another server. Alternatively, you can write PHP in your local script to do the same, but as long as you get the response you provide, you will have to write your logic to send the response to the external server script.
source to share