[英]Cancel Paypal Recurring payments
I'm currently integrating the paypal recurring payment process in my website.in my website users have the option to cancel his paypal recurring payment.i have the payer_id and payer_email of each users. 我目前正在我的网站中集成paypal定期付款流程。在我的网站上,用户可以选择取消他的paypal经常性付款。我有每个用户的payer_id和payer_email。 is it possible to cancel the recurring payment with these details.
是否可以使用这些详细信息取消定期付款。 if no ,how can i cancel the recurring option if a perticular user click cancel recurring payment from my site.
如果不是,如果特定用户点击取消从我的网站重复付款,我如何取消定期选项。
thank you. 谢谢。
You can cancels all your paypal recurring profile with PROFILE_ID. 您可以使用PROFILE_ID取消所有paypal重复发布的配置文件。 and execute this code with your Recurring Payment Profile ID.
并使用您的定期付款资料ID执行此代码。 Hope This Will help you.
希望这会帮助你。
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp');
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
'USER' => 'XXXXXXXXXXX', //Your API User
'PWD' => 'XXXXXXXXXXXXX', //Your API Password
'SIGNATURE' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXX', //Your API Signature
'VERSION' => '108',
'METHOD' => 'ManageRecurringPaymentsProfileStatus',
'PROFILEID' => 'I-315LHdijsju', //here add your profile id
'ACTION' => 'Cancel' //this can be selected in these default paypal variables (Suspend, Cancel, Reactivate)
)));
$response = curl_exec($curl);
curl_close($curl);
$nvp = array();
if (preg_match_all('/(?<name>[^\=]+)\=(?<value>[^&]+)&?/', $response, $matches)) {
foreach ($matches['name'] as $offset => $name) {
$nvp[$name] = urldecode($matches['value'][$offset]);
}
}
printf("<pre>%s</pre>",print_r($nvp, true));
You can suspend or cancel a profile by using the ManageRecurringPaymentsProfileStatus API. 您可以使用ManageRecurringPaymentsProfileStatus API暂停或取消配置文件。
Note this reference . 请注意此参考 。 This is specifically for express checkout but it will work for other paypal integrations.
这是专门用于快速结账,但它适用于其他paypal集成。
This has also been answered here, for future reference: Can you cancel a PayPal automatic payment via API? 此处也已回答此问题,以备将来参考: 您可以通过API取消PayPal自动付款吗? (Subscription created via Hosted button)
(通过托管按钮创建订阅)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.