【发布时间】:2014-10-26 18:10:40
【问题描述】:
我遇到了一个错误,我不确定如何使用 BrainTree 解决。所有数据都已更改,这只是示例随机数是从 javascript 生成的,我的过程如下所示:
//Set the Configuration
Braintree_Configuration::environment($config['mode']);
Braintree_Configuration::merchantId($config['merchant_id']);
Braintree_Configuration::publicKey($config['public_key']);
Braintree_Configuration::privateKey($config['private_key']);
$result = Braintree_Transaction::sale(array(
'amount' => '3.00',
'merchantAccountId' => 'jane_doe_instance_3232',
'paymentMethodNonce' => '7w0dw',
'options' => array(
'submitForSettlement' => true,
'holdInEscrow' => true,
),
'serviceFeeAmount' => "1.00"
)
);
if($result -> success) {
print_r($result->transaction->escrowStatus);
print_r($result->transaction->serviceFeeAmount);
$transaction = Braintree_Transaction::holdInEscrow($result -> transaction -> id);
}
现在这就是正在发生的事情。付款过程和状态是“submitted_for_settlement”,这与文档所说的不同。现在这就是奇怪的地方。
$result->transaction->escrowStatus
escrowStatus 始终为空,不起作用
$result->transaction->serviceFeeAmount
服务费金额打印出来,这样就可以了。
然后当我尝试在托管中持有交易时
$transaction = Braintree_Transaction::holdInEscrow($result -> transaction -> id);
它会抛出错误 91560 Transaction could not be hold in escrow。知道为什么要平移吗?
【问题讨论】:
-
@agf,您对此有何见解?
-
这看起来是正确的,只要
jane_doe_instance_3232是子商户帐户。如果您仍有问题,建议您向我们的支持团队发送电子邮件 - support@braintreepayments.com。 -
@agf,我现在正在和他们交谈,但文档中的内容并不是它的运作方式。其他人也有完全相同的问题:stackoverflow.com/questions/25643520/…
-
那个人没有包含商家帐户 ID,因此他们没有使用子商家帐户,这就是他们收到该错误的原因。
-
@DevinDixon 我有同样的错误。你有什么解决办法吗?
标签: javascript php braintree