我想从PAY_KEY执行付款到Paypal ID。以下是我的示例代码:
$PayRequestFields = array(
'ActionType' => 'PAY',
'CancelURL' => $dataArray['cancel_url'],
'CurrencyCode' => $dataArray['currency'],
'FeesPayer' => 'SENDER',
'IPNNotificationURL' => '',
'Memo' => '',
'Pin' => $dataArray['pin'],
'PreapprovalKey' => $dataArray['sender_pre_approval_key'],
'ReturnURL' => $dataArray['return_url'],
'ReverseAllParallelPaymentsOnError' => '',
'SenderEmail' => '',
'TrackingID' => ''
);
$ClientDetailsFields = array(
'CustomerID' => '',
'CustomerType' => '',
'GeoLocation' => '',
'Model' => '',
'PartnerName' => ''
);
$FundingTypes = array('ECHECK', 'BALANCE', 'CREDITCARD');
$Receivers = array();
$Receiver = array(
'Amount' => $dataArray['primary_reciever_amount'],
'Email' => $dataArray['primary_reciever'],
'InvoiceID' => '',
'PaymentType' => 'SERVICE',
'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);
执行此代码时,收到"580023"
的错误"The fee payer SENDER cannot be used with this preapproval"
。
请指导我。
答案 0 :(得分:0)
如果您使用的是Chain Payments,则不允许FeePayer为“SENDER”。您可以查看文档以获取更多信息here:
**feesPayer xs:string (Optional) The payer of PayPal fees.
允许值为:
SENDER – Sender pays all fees (for personal, implicit simple/parallel payments; do not use for chained or unilateral payments)
PRIMARYRECEIVER – Primary receiver pays all fees (chained payments only)
EACHRECEIVER – Each receiver pays their own fee (default, personal and unilateral payments)
SECONDARYONLY – Secondary receivers pay all fees (use only for chained payments with one secondary receiver)**