PayPal Webhook通知计费订阅PHP

PayPal Webhook通知计费订阅PHP,php,paypal,paypal-ipn,paypal-subscriptions,Php,Paypal,Paypal Ipn,Paypal Subscriptions,我已经使用PayPal PHP SDK实现了PayPal计费订阅,一切正常,用户可以使用此代码从应用程序中取消订阅 $agreementStateDescriptor = new AgreementStateDescriptor(); $agreementStateDescriptor->setNote("Suspending the Agreement."); $agreement->suspend($agreementStateDescriptor, $apiContext);

我已经使用PayPal PHP SDK实现了PayPal计费订阅,一切正常,用户可以使用此代码从应用程序中取消订阅

$agreementStateDescriptor = new AgreementStateDescriptor();
$agreementStateDescriptor->setNote("Suspending the Agreement.");

$agreement->suspend($agreementStateDescriptor, $apiContext);
但是如果用户从他的PayPal帐户取消订阅,我的应用程序将不会收到通知,如何处理?有没有像条纹之类的网钩


谢谢

您需要为您的应用程序创建一个Paypal webhook

设置一个URL(可访问的URL),即
yourdomain/paypal/resolver

然后注册事件
计费。订阅。取消

一旦用户从Paypal取消协议,将激活“BILLING.SUBSCRIPTION.CANCELLED”事件的webhook,并向您的站点发送请求


仅供参考,此链接提供的示例非常有用

现在已被弃用,其他官方PayPal api似乎不支持Webhook。