2 人の受取人に支払いをしたいです。つまり、買い手は商品を 100 で購入し、受取人 1 は 90 を受け取り、受取人 2 は 10 を受け取ります。チェーン支払い方法を使用しています。受信者 1 のアカウントで 100 を受け取りましたが、これは問題ありませんが、受信者 2 の支払いを受け取ることができません。受信者のアカウント ID は設定されていますが、ここでは指定されていません。私が間違っていることは何ですか?ありがとう
<?php
require_once('../includes/config.php');
require_once('../includes/paypal.class.php');
$PayPalConfig = array(
'Sandbox' => $sandbox,
'DeveloperAccountEmail' => $developer_account_email,
'ApplicationID' => $application_id,
'DeviceID' => $device_id,
'IPAddress' => $_SERVER['REMOTE_ADDR'],
'APIUsername' => $api_username,
'APIPassword' => $api_password,
'APISignature' => $api_signature,
'APISubject' => $api_subject
);
$PayPal = new PayPal_Adaptive($PayPalConfig);
$PayRequestFields = array(
'ActionType' => 'PAY_PRIMARY',
'CancelURL' => $domain.'cancel.php',
'CurrencyCode' => 'USD',
'FeesPayer' => 'EACHRECEIVER',
'IPNNotificationURL' => '',
'Memo' => '',
'Pin' => '',
'PreapprovalKey' => '',
'ReturnURL' => $domain.'return.php',
'ReverseAllParallelPaymentsOnError' => '',
'SenderEmail' => '',
'TrackingID' => ''
);
$ClientDetailsFields = array(
'CustomerID' => '',
'CustomerType' => '',
'GeoLocation' => '',
'Model' => '',
'PartnerName' => ''
);
$FundingTypes = array('ECHECK', 'BALANCE', 'CREDITCARD');
$Receivers = array();
$Receiver = array(
'Amount' => '100.00',
'Email' => 'receiver1accountid',
'InvoiceID' => '',
'PaymentType' => 'GOODS',
'PaymentSubType' => '',
'Phone' => array('CountryCode' => '', 'PhoneNumber' => '', 'Extension' => ''),
'Primary' => 'true'
);
array_push($Receivers,$Receiver);
$Receiver = array(
'Amount' => '10.00',
'Email' => 'receiver2accountid',
'InvoiceID' => '',
'PaymentType' => 'GOODS',
'PaymentSubType' => '',
'Phone' => array('CountryCode' => '', 'PhoneNumber' => '', 'Extension' => ''),
'Primary' => 'false'
);
array_push($Receivers,$Receiver);
$SenderIdentifierFields = array(
'UseCredentials' => ''
);
$AccountIdentifierFields = array(
'Email' => '',
'Phone' => array('CountryCode' => '', 'PhoneNumber' => '', 'Extension' => '')
);
$PayPalRequestData = array(
'PayRequestFields' => $PayRequestFields,
'ClientDetailsFields' => $ClientDetailsFields,
'FundingTypes' => $FundingTypes,
'Receivers' => $Receivers,
'SenderIdentifierFields' => $SenderIdentifierFields,
'AccountIdentifierFields' => $AccountIdentifierFields
);
$PayPalResult = $PayPal->Pay($PayPalRequestData);
if(!$PayPalResult)
{
$errors = array('Errors'=>$PayPalResult['Errors']);
echo '<pre />';
print_r($errors);
exit();
}
else
{
header('Location: '.$PayPalResult['RedirectURL']);
$ExecutePaymentFields = array(
'PayKey' => $PayPalResult['PayKey'],
'FundingPlanID' => ''
);
$PayPalRequestData = array('ExecutePaymentFields' => $ExecutePaymentFields);
$PayPalResult = $PayPal->ExecutePayment($PayPalRequestData);
if(!$PayPalResult)
{
$errors = array('Errors'=>$PayPalResult['Errors']);
echo '<pre />';
print_r($errors);
exit();
}
else
{
echo '<pre />';
print_r($PayPalResult);
}
}
?>