私はブレインツリー + エスクロー ファンディングを PHP で実装してきました。
Braintree PHP コードを使用しています。
コードは完全に機能しており、braintree サンドボックス ダッシュボードでトランザクションを確認できます。
しかし、一歩先を行って、機能していないエスクロー資金を統合したいと考えています。以下はコードの例です。
require_once "braintree-php/lib/Braintree.php";
Braintree_Configuration::environment("sandbox");
Braintree_Configuration::merchantId("merchantID");
Braintree_Configuration::publicKey("public-key");
Braintree_Configuration::privateKey("private-key");
$result = Braintree_Transaction::sale(
[
'amount' => '100.00',
'merchantAccountId' => 'abc',
'creditCard' => [
'number' => '378282246310005',
'expirationDate' => '12/18'
],
'options' => [
'submitForSettlement' => true,
'holdInEscrow' => true,
],
'serviceFeeAmount' => "10.00"
]
);
if ($result->success) {
echo '<pre>';
print_r("success!: " . $result->transaction->id);
print_r("success!: " . $result->transaction->escrowStatus);
print_r($result->transaction->serviceFeeAmount);
$escow = Braintree_Transaction::holdInEscrow($result->transaction->id);
} else if ($result->transaction) {
print_r("Error processing transaction:");
print_r("\n code: " . $result->transaction->processorResponseCode);
print_r("\n text: " . $result->transaction->processorResponseText);
} else {
echo '<pre>';
print_r("Validation errors: \n");
print_r($result->errors->deepAll());
}
以下のエラーが表示されます。
1) Service fee not supported on master merchant account.
2) Transaction could not be held in escrow.
国として米国を選択して、サンドボックス アカウントを作成しました。ブレインツリーの支払い中にエスクロー資金を獲得する方法と、コードで何が間違っているのか、誰でも助けてくれますか?
以下のリンクのコードからサブマーチャントを正常に作成しました。