I am developing a plugin for courier management system
The plugin includes payment gateway (Instamojo) integration.
Successfully completed payment gateway integration by creating payment request.
In the payment process, This payment gateway will gives detailed data of transaction using webhooks. Im unable to get values from webhooks in wordpress
My try
The code for initiating payment is down below,
try {
$response = $api->paymentRequestCreate(array(
"buyer_name" => $_POST['name_f'],
"purpose" => "#order :".$info_f['serno'],
"amount" => $info_f['totalprice'],
"send_email" => true,
"email" => $info_f['emailid'],
"redirect_url" => "http://www.mywebsite.in/thank-you",
"webhook" => "http://www.mywebsite.in/thank-you"
));
print_r($response);
header('Location:'.$response['longurl']);
}
catch (Exception $e) {
print('Error: ' . $e->getMessage());
}
(Not sure about webhook url)
Now at the thank you page, i have added a shortcode [cm-thankyou], the function is in thankyou.php
function cm_redback(){
echo "THANK YOU<br>";
print_r($_POST);
}
add_shortcode( 'cm-thankyou', 'cm_redback' );
I tried printing the $_POST (i heard webhooks will be in $_POST) but unable to get the webhook working.
Please help me to get this working, I searched a lot in google and hit dead-end without getting any results.
These are instamojo integration guides, i referred.
https://docs.instamojo.com/docs/payments-api
https://github.com/Instamojo/instamojo-php.
Thanks in advance :)