2014-03-05 54 views
0

我目前使用PayPal付款自適應API的工作,使用Angel Eyes LibraryPHP - 貝寶自適應支付 - InstitutionCustomer

我使用PayWithOptions.php(也被稱爲剛:收費)

它所做的是,它通過點擊一個按鈕,從我的PayPal賬戶向客戶PayPal賬戶發送付款。

我遇到了一個問題:

Invalid request parameter: institutionId with value 5 

完整的錯誤:

[Ack] => Failure 
    [Build] => 9898581 
    [CorrelationID] => 2aa511de53ce9 
    [Timestamp] => 2014-03-05T02:59:16.748-08:00 
    [PayKey] => AP-63569347PY5071349 
    [PaymentExecStatus] => CREATED 
    [RedirectURL] => https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=AP-63569347PY5071349 
    [PayXMLRequest] => ReturnAllen_USCREATEhttp://wattbux.com/a/APP-80W284485P5[email protected]test.comSERVICEhttp://wattbux.com/a/ 
    [PayXMLResponse] => 2014-03-05T02:59:16.748-08:00Success2aa511de53ce99898581AP-63569347PY5071349CREATED 
    [SetPaymentOptionsXMLRequest] => ReturnAllen_USAP-63569347PY507134951122USERNAME1DKAngellEYE_PHPClass 
    [SetPaymentOptionsXMLResponse] => 2014-03-05T02:59:17.054-08:00Failure2bc204d053e2f9898581580022PLATFORMApplicationErrorApplicationInvalid request parameter: institutionId with value 5institutionId5 

這是PHP代碼:

$InstitutionCustomer = array(
     'CountryCode' => 'DK',    // Required. 2 char code of the home country of the end user. 
     'DisplayName' => 'USERNAME',    // Required. The full name of the consumer as known by the institution. 200 char max. 
    'InstitutionCustomerEmail' => '[email protected]', // The email address of the consumer. 127 char max. 
     'FirstName' => '11',     // Required. The first name of the consumer. 64 char max. 
     'LastName' => '22',      // Required. The last name of the consumer. 64 char max. 
     'InstitutionCustomerID' => '1',   // Required. The unique ID assigned to the consumer by the institution. 64 char max. 
     'InstitutionID' => '5'    // Required. The unique ID assiend to the institution. 64 char max. 
); 

我不知道什麼是 「IstitutionXXX」 是 - 有人可以對此有所瞭解嗎?

+0

這裏要注意的是,您提到的PayWithOptions.php實際上是Pay和SetPaymentOptions的組合。 SetPaymentOptions需要包含大多數人想要包含的交易的額外細節,所以我添加了該模板以使其更容易。 –

回答

0

我知道,這在我的班上有點誤導。那些被標記爲必需的,但只有在您實際包含開始的機構信息時才需要。如果你完全拋棄所有這些領域,那麼這些領域都不是必需的。

我從來沒有需要使用這些參數,所以我不能100%確切地告訴你它們用於哪一種,但是,我可以告訴你只是讓它們離開請求(並從$ PayPalRequestData中移除它們),那個問題就會消失。

對於其他一些參數也是如此。我通常喜歡以最少的參數開始,以便讓事情順利進行,然後根據需要添加內容。

同樣,我知道那些所需的標籤是令人困惑的,但試着按照每個數組的要求來考慮這些標籤。

+0

非常感謝!我從PayRequest中刪除它,它工作。雖然,我只想每次支付PayOptions.php一個用戶,但我不斷收到這個錯誤:「當您移除其他接收者時,您必須指定一個主接收者和至少一個次接收者」。我應該使用其他模板嗎? – oliverbj

+0

如果你只是付錢,不要把它作爲主要的。請留下空白。如果您確實擁有主用戶,則需要輔助用戶。只有一個,不要讓它成爲主要的。 –