我想设置PayPal的延迟链支付。我对此有几个问题:
-
如何设置转账金额的到期日期接收器?
-
如何将金额从主接收者转移到辅助接收者通过 php 接收?
我必须在输入参数中设置的所有内容。所以请在参数方面帮助我。
我的输入参数:
$actionType= "PAY_PRIMARY";
$receiver = array();
$receiver[0]['receiverEmail'] = 'admin@gmail.com';
$receiver[0]['receiverAmount'] =50;
$receiver[0]['receiverPrimary'] = true;
$receiver[1]['receiverEmail'] = 'abc007@gmail.com';
$receiver[1]['receiverAmount'] =30;
$receiver[1]['receiverPrimary'] = false;
$optional = array();
$optional['memo'] = 'memo here';
$optional['feesPayer'] = 'EACHRECEIVER';
$cancel_url='http://www.mywebsite.com/cancel.php';
$return_url='http://www.mywebsite.com/return.php';
我尝试通过输入以下内容来输入开始日期和结束日期:
$var['startingDate']=date("Y-m-d H:i:s");
$var['endDate']= date('Y-m-d H:i:s', strtotime('+5 minutes', strtotime($var["startingDate"])));
将金额转移给次级用户的总持续时间为 5 分钟。但它不起作用。
首先,您需要生成预批准,当您要生成预批准密钥时,您可以设置该密钥的时间范围:
<?php
$startDate = date('Y-m-d', time());
$endDate = date('Y-m-d',strtotime('+364 days'));
define('PREAPPROVAL_STARTDATE',$startDate);
define('PREAPPROVAL_ENDDATE',$endDate);
define('PREAPPROVAL_MAXNUMBEROFPAYMENTS','10000');
define('PREAPPROVAL_MAXAMOUNT','2000');
您使用的是正确的格式,有关更多信息,您可以从 github: https://github.com/paypal/adaptivepayments-sdk-php