【问题标题】:PHP - PayPal Adaptive Payment - InstitutionCustomerPHP - PayPal 自适应支付 - 机构客户
【发布时间】:2014-04-07 09:32:21
【问题描述】:

我目前正在使用 PayPal Adaptive Payments API,使用 Angel Eyes Library

我正在使用 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-80W284485P519543T173.245.53.242USDEACHRECEIVERECHECKBALANCECREDITCARD9test@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' => 'PAYPAL@TEST.COM',    // 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”是什么——有人能解释一下吗?

【问题讨论】:

  • 这里的旁注,你提到的PayWithOptions.php实际上是Pay和SetPaymentOptions的组合。 SetPaymentOptions 需要包含大多数人想要包含的有关交易的额外详细信息,因此我添加了该模板以使其更容易。

标签: php paypal paypal-adaptive-payments


【解决方案1】:

这在我的课堂上有点误导,我知道。这些标记为必需,但仅当您实际上包含机构信息时才需要它们。如果您完全忽略所有这些,则不需要这些字段。

我从来没有需要使用这些参数,所以我不能 100% 确定它们的用途,但是,我可以告诉你不要将它们排除在请求之外(并将它们从 $PayPalRequestData 中删除),这个问题就会消失。

其他一些参数也是如此。我通常喜欢从使工作正常所需的最少参数开始,然后根据需要/需要从那里添加东西。

再次,我知道那些必需的标签令人困惑,但请尝试将它们视为每个数组的必需标签。

【讨论】:

  • 非常感谢!我从 PayRequest 中删除了它并且它起作用了。虽然,我只想使用 PayOptions.php 一次向一个用户付款,但是当我删除另一个接收者时,我不断收到此错误:“您必须仅指定一个主要接收者和至少一个辅助接收者”。我应该使用其他模板吗?
  • 如果你只是付钱,不要让它成为主要的。也把那个留空。如果您确实有一个主要用户,则它需要一个次要用户。只有一个,不要让它成为主要的。
猜你喜欢
  • 2013-11-07
  • 2014-01-23
  • 2013-03-20
  • 2012-10-23
  • 2015-07-19
  • 2021-08-04
  • 2018-03-04
  • 2015-12-12
  • 2014-10-13
相关资源
最近更新 更多