I am creating a website in php. I need simple integration with Intsamojo payment gateway. The php library i am using is https://github.com/Instamojo/instamojo-php/ I can generate a payment request like this example.
try {
$response = $api->paymentRequestCreate(array(
"purpose" => "FIFA 16",
"amount" => "3499",
"send_email" => true,
"email" => "foo@example.com",
"redirect_url" => "http://www.example.com/handle_redirect.php"
));
print_r($response);
}
catch (Exception $e) {
print('Error: ' . $e->getMessage());
}
The $response
variable have a unique payment response for the requested payment.
Array
(
[id] => a78ab73df2bb4e78bc06a32a264ae59a
[phone] => +919898989898
[email] => ba@gmail.com
[buyer_name] => mool
[amount] => 105.75
[purpose] => Jeans Mens #100
[status] => Pending
[send_sms] =>
[send_email] => 1
[sms_status] =>
[email_status] => Pending
[shorturl] =>
[longurl] => https://test.instamojo.com/@instamojousername/a78ab73df2bb4e78bc06a32a264ae59a
[redirect_url] => http://demo.test.com/instamojo/thankyou.php
[webhook] => http://demo.test.com/instamojo/webhook.php
[created_at] => 2016-08-19T14:44:10.679557Z
[modified_at] => 2016-08-19T14:44:10.679582Z
[allow_repeated_payments] =>
)
Now after this step i want redirect user to this link generated for payment.
https://test.instamojo.com/@instamojousername/a78ab73df2bb4e78bc06a32a264ae59a
How its possible after the first paymentRequestCreate
call.
A simple header redirect is ok? Which is secure method?