Send data using POST method
Posted: Mon Nov 28, 2011 3:33 am
Hi. I'm trying to write a wordpress plugin to contacting with a payment gateway. The gateway is an Iranian bank named Mellat.
First of all I have to send a request to their web-service and they respond me. There are 2 things in response, a string named $RefId and a status. If status be 0 it means every thing is ok and now I redirect customer and send $RefId to bank's gateway using POST method. And then they respond me if payment is ok or not.
I cant send $RefId with POST. How can I do this?
Point: I wrote another payment plugin for another bank named Parsian. The procedure is same but in that case I had to send data using GET method that was so easy. I used this piece of code to redirect using GET method:
First of all I have to send a request to their web-service and they respond me. There are 2 things in response, a string named $RefId and a status. If status be 0 it means every thing is ok and now I redirect customer and send $RefId to bank's gateway using POST method. And then they respond me if payment is ok or not.
I cant send $RefId with POST. How can I do this?
Point: I wrote another payment plugin for another bank named Parsian. The procedure is same but in that case I had to send data using GET method that was so easy. I used this piece of code to redirect using GET method:
Code: Select all
$parsURL = "https://www.pec24.com/pecpaymentgateway/?au=" . $authority ;
header("Location: $parsURL");
exit();