【问题标题】:Braintree payments Escrow FundingBraintree 支付 托管资金
【发布时间】:2014-09-03 11:48:11
【问题描述】:

我正在尝试在 php 中使用 Braintree 实现托管资金。我已经从here 下载了库。我的代码如下:-

require_once "../braintree/lib/Braintree.php";

Braintree_Configuration::environment("sandbox");
Braintree_Configuration::merchantId("was4zgn5x6vt99h");
Braintree_Configuration::publicKey("ydjrasdwyw9npkvnw4");
Braintree_Configuration::privateKey("f197ac5a66a1fsad37d3950890b2cbda9");

$result = Braintree_Transaction::sale(
  array(
'amount' => "100.00",

'creditCard' => array(
  'number' => "4111111111111111",
  'expirationDate' => "12/2014",
),
'options' => array(
  'submitForSettlement' => true,
  'holdInEscrow' => true,
)

  )
    );
echo "<pre>";
 print_r("\n  message: " . $result->message);

它适用于直接付款。但它不适用于托管。请检查我的代码。

错误是:-

"message: Transaction could not be held in escrow."

我从here得到了代码

【问题讨论】:

  • 看来,这不是你的代码错误。他们不能将此交易作为托管处理。
  • 我不清楚你在说什么。请给我一些可以帮助我的链接..
  • 如果这些是你真正的钥匙,你可能会想要改变它们......
  • 谢谢@BradWerth,不,这些不是我真正的钥匙。请你给我一些关于braintree escrow的建议......
  • @Bik 你有想过吗?我也有同样的问题

标签: php braintree


【解决方案1】:

我终于从 Braintree 那里得到了真正的答案。我不得不再添加两个参数。一个是merchantAccountId,另一个是serviceFeeAmount。这里merchantAccountId的id其实是子商家merchantAccountId。您将从 Braintree 收到 merchantAccountId。登录后,转到设置->处理。在页面底部,您将获得查看所有商家帐户。在这里你会得到merchantAccountId。不要使用默认的merchantAccountId 它将不起作用。

require_once "../braintree/lib/Braintree.php";
Braintree_Configuration::environment("sandbox");
Braintree_Configuration::merchantId("was4zgn5x6vt99h");
Braintree_Configuration::publicKey("ydjrasdwyw9npkvnw4");
Braintree_Configuration::privateKey("f197ac5a66a1fsad37d3950890b2cbda9");

$result = Braintree_Transaction::sale(
  array(
'amount' => "100.00",
'merchantAccountId' => 'test_user_instant_5vcgn574',
'creditCard' => array(
  'number' => "4111111111111111",
  'expirationDate' => "12/2014",
),
'options' => array(
  'submitForSettlement' => true,
  'holdInEscrow' => true,
),
'serviceFeeAmount' =>'1'

  )
);
echo "<pre>";
print_r("\n  message: " . $result->message);

【讨论】:

    【解决方案2】:

    我认为你需要两件事:

    1. 传递一个merchant_account_id - 请参阅https://www.braintreepayments.com/docs/php/transactions/escrow上的示例

    2. 只有在您的商家帐户使用 Marketplace 时,您才能进行托管。 https://www.braintreepayments.com/docs/php/guide/marketplace

    【讨论】:

      【解决方案3】:

      我认为你的代码有误:

      'options' => array(
        'submitForSettlement' => true,
        'holdInEscrow' => true,
      )
      

      应该是:

      'holdInEscrow' => true
      

      'holdInEscrow' =&gt; true后面不能有逗号

      【讨论】:

      • 这无关紧要,数组中的尾随逗号不会影响结果
      猜你喜欢
      • 2016-08-30
      • 2018-03-20
      • 1970-01-01
      • 2018-10-26
      • 2017-02-21
      • 1970-01-01
      • 2017-04-15
      • 2017-09-25
      • 1970-01-01
      相关资源
      最近更新 更多