dongqian1028 2016-07-29 23:03
浏览 128

从wordpress中的其他站点接收webhook


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 :)

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 matlab有关常微分方程的问题求解决
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?
    • ¥100 求三轴之间相互配合画圆以及直线的算法