1

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

  1. 我如何设置向次要收款人转账金额的截止日期?

  2. 如何通过 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 分钟。但它不起作用。

4

1 回答 1

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

于 2013-10-09T08:55:19.763 回答