简体   繁体   中英

Payment Transfer in Delayed Chained Payment in Paypal

I want to set Delayed Chain Payment of PayPal. I have few questions regarding that:

  1. How can i set expiration date for transfer amount to the Secondary Receiver?

  2. How can i transfer amount from Primary Receiver to Secondary Receiver through php?

All the things i have to set in input parameters. So please help me in terms of Parameter.

My Input Parameters:

  $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';

I have tried putting start date and End date by putting:

$var['startingDate']=date("Y-m-d H:i:s");
 $var['endDate']= date('Y-m-d H:i:s', strtotime('+5 minutes', strtotime($var["startingDate"])));

// The total duration is 5min for transfer the Amount to the secondary User. But it doesn't work.

First you need to generate preapproval, when you are going to generate pre-approval key, you can set time frame of that key:

<?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');

You are using correct format, for more you can download from github: https://github.com/paypal/adaptivepayments-sdk-php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM