Paypal中延迟链式付款的付款转帐

时间:2013-10-08 09:12:57

标签: php paypal payment-gateway paypal-sandbox paypal-adaptive-payments

我想设置PayPal的延迟链式支​​付。我对此几乎没有问题:

  1. 如何设置转入金额的到期日期 接收器

  2. 如何将金额从主接收器转移到辅助接收器 接收者通过php?

  3. 我必须在输入参数中设置的所有内容。所以请在参数方面帮助我。

    我的输入参数:

      $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分钟。但它不起作用。

1 个答案:

答案 0 :(得分:0)

首先,您需要生成预批准,当您要生成预批准密钥时,您可以设置该密钥的时间范围:

<?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