2014-12-22 138 views
0

我想執行付款從PAY_KEY到貝寶ID。下面是我的示例代碼:貝寶自適應付款 - 錯誤580023

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

當我執行這個代碼,獲得該說"The fee payer SENDER cannot be used with this preapproval"錯誤"580023"

請指導我。

+0

我從來沒有使用這個特定的接口或得到這個特別的消息,但它聽起來很清晰。聽起來好像有一些政策,對於這種預先批准,發件人不會被要求支付費用。更改該請求的參數並查看它是否有效。如果是這樣,你就沒有編程問題。如果你想知道爲什麼原始請求被認爲是無效的,那麼你應該問PayPal,而不是StackOverflow。 – geewiz

回答

0

如果您使用的是連鎖支付,那麼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)** 
+0

感謝您的回答。 – Hardik