Page 1 of 1

auto returning a post value

Posted: Sat Sep 29, 2007 12:16 am
by stagehand
I am working on a payment processing application. My app will send the information to the payment server and in return I will get an approved or declined response. Since I am fairly early in the development process I would like to be able to test my code without actually sending a post to a real payment processor.

What I have be trying to figure out is, can I post my form to another php file and have that file automatically post back either a good or bad status code in the form of a post? Could I use the header function to accomplish this goal? The response I receive back needs to be in the form of a post variable.

Thanks

Posted: Sat Sep 29, 2007 1:23 am
by s.dot
Man, I know there is a good way of doing this. I'm just drawing a blank.

My hack of a solution would be to put it in a form, and have javascript submit the form on page load. =/

Re: auto returning a post value

Posted: Sat Sep 29, 2007 1:29 am
by jeffery
stagehand wrote:I am working on a payment processing application. My app will send the information to the payment server and in return I will get an approved or declined response. Since I am fairly early in the development process I would like to be able to test my code without actually sending a post to a real payment processor.

What I have be trying to figure out is, can I post my form to another php file and have that file automatically post back either a good or bad status code in the form of a post? Could I use the header function to accomplish this goal? The response I receive back needs to be in the form of a post variable.

Thanks
Most Payment Gateways provide a test account or test numbers for development purposes. Ask you payment gateway provider for the information.

use curl

Posted: Sat Sep 29, 2007 8:47 am
by yacahuma
depending on how the gateway works you will use a normal post or curl.

Posted: Sat Sep 29, 2007 12:56 pm
by John Cartwright
Indeed, cURL is what you are after.