I have been implementing braintree + escrow funding in PHP.
I have been using Braintree PHP code.
code is perfectly working and i can see transaction in my braintree sandbox dashboard.
But one step ahead i want to integrate escrow funding which is not working. below is example of code.
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());
}
which gives me below error.
1) Service fee not supported on master merchant account.
2) Transaction could not be held in escrow.
I have created sandbox account by select USA as country. can any one help me how to achive escrow funding during braintree payment and what am i doing wrong in my code.
I have successfully created sub-merchant from code of below link.