我雇了一个人给我编写了一些代码来取消 Paypal 的 API 中的定期付款,如下所示:
function change_subscription_status( $profile_id, $action ) {
$api_request = 'USER=' . urlencode( 'xxxxxxxxxxxxxxx' )
. '&PWD=' . urlencode( 'xxxxxxxxxxxxxxx' )
. '&SIGNATURE=' . urlencode( 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' )
. '&VERSION=76.0'
. '&METHOD=ManageRecurringPaymentsProfileStatus'
. '&PROFILEID=' . urlencode( $profile_id )
. '&ACTION=' . urlencode( $action )
. '&NOTE=' . urlencode( 'Plan cancelled in application' );
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, 'https://api-3t.paypal.com/nvp' );
[...]
有没有办法使用 Paypal API 同时退款 X.XX 金额?
基本上,我想取消经常性交易,比如每月 10 美元,如果客户使用该软件 15 天,则退款 5 美元。
最佳答案
是的,您只需构建一个 RefundTransaction以与构建 ManageRecurringPaymentsProfileStatus 请求相同的方式请求并在脚本中背靠背运行它们。
关于php - 退款+取消订阅 Paypal API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27210400/