简体   繁体   English

如何在沙箱中检查 squareup 支付网关的 webhook

[英]How to check webhook in sandbox for squareup payment gateway

I am trying to implement webhook listener when a user make a payment using PHP CURL.当用户使用 PHP CURL 付款时,我正在尝试实现 webhook 侦听器。 Here is my code这是我的代码

$ch = curl_init();
$data = array(
"[\"PAYMENT_UPDATED\"]",
);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer sandbox-12346789899", "Content-type: application/json\r\n"));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_URL, "https://connect.squareup.com/v1/my_sandbox-location_id/webhooks");
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);

But i am getting Sandbox is not supported for Connect V1 API endpoints error.但是我收到Connect V1 API 端点错误不支持 Sandbox Please help how i can test payment notification webhook using my sandbox account.请帮助我如何使用我的沙箱帐户测试付款通知 webhook。

Webhooks are under the domain of the V1 endpoints, so you will not be able to test them in sandbox at this time. Webhooks 位于 V1 端点的域下,因此您此时无法在沙箱中测试它们。 You can test them with fake cash payments with your production credentials however.但是,您可以使用您的生产凭据使用假现金付款来测试它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM