Braintree + esrow funding

168 Views Asked by At

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.

On boarding Sub-merchants

1

There are 1 best solutions below

5
On

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

I was able to locate your Sandbox account, and it appears you signed up for a Sandbox account and indicated that India is the location of your business, which is why you are receiving these validation errors, as the Marketplace is not compatible with any country outside of the United States.

In order to test the Marketplace functionality, you'll need to sign up for a new Sandbox account, ensuring that you choose United States as your country value.