PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am using a 3rd party to accept/approve credit card transactions on my Website.
There is an option to pass back Approval Post URL information, such as cutomer name, email etc which I would like to capture and store in a database.
In principle it all seems easier enough to implement but my question is how will the PHP code which receives the date be invoked as PHP is a client-side based language.
However it must be possible as the payment ompany says :
"The Approval Post URL or Denial Post URL should point to a script such as CGI, PHP, ASP, etc. "
robburne wrote:In principle it all seems easier enough to implement but my question is how will the PHP code which receives the date be invoked as PHP is a client-side based language.
However it must be possible as the payment ompany says :
"The Approval Post URL or Denial Post URL should point to a script such as CGI, PHP, ASP, etc. "
um, PHP is a server-side language.
Also, it looks like they're asking for a page (mypage.php), but without more information such as what exactly they ask for... it's hard to say.
Ok let my try and explain in a little more detail.
When user wants to pay they are taken to a payment stage.
Once payment has been approved variable are sent to URL which I choose.
However once approved the customer is taken to a different page to that which I have chosen to receive the variable data, so how is the PHP code that I have set up ever to receive the data?
When the transaction is complete, two things happen
1. Your client is redirected to another page by the third party
2. The third party server, at the same time as above or right before, sends a request to a URL of your choice with the data.
So the customer gets redirected to some other page, but at the same time your server is getting a request with some data on it. Your customer never gets to see the php page that gets loaded on your server, they have been redirected somewhere else. It is the 3rd party server which is loading the page and sending you data. So in reality the customer is not involved at this point. It is a conversation between you and the 3rd party server via HTTP.
No, it will be invoked. Just not by the customer. It will be invoked when the 3rd party server requests the page from you.
To run a PHP script you don't have to have someone physically viewing it with a web browser. Using a number of methods in PHP it is possible to request pages from other servers thereby executing the code in those scripts, without every redirecting the user. For instance I can write a page on my server that loads a page from CNN, pulls off the headlines, then shows them to the person viewing the page on my server without redirecting them. Yet my request from my server to CNN caused server side scripting to run on the CNN server.
This is what the 3rd party processing people are doing. The customer checks out, then gets redirected. At that time the 3rd party server sends a page request to your server with data in it, which causes your PHP script to load and run the code in it.
Your customer will never see your PHP page. However the code in it still gets invoked.
Last edited by Begby on Fri Jul 20, 2007 9:58 am, edited 1 time in total.