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条回答

    报告相同问题?

    悬赏问题

    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!