1

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

Ashish Patel
  • 3,551
  • 1
  • 15
  • 31

1 Answers1

0

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.

drs6222
  • 606
  • 3
  • 10
  • Thank you for response... i have follow your instruction and created another account and at that time i have selected country as USA (where is your business located?) from that account i am facing same problem. FYI, i can created sub merchant from USA sand box account as well..please guide me what am i doing wrong? thank you in advance :) – Ashish Patel Oct 10 '17 at 09:50
  • Also please let me know if you more details about it. – Ashish Patel Oct 10 '17 at 09:52
  • Thanks @AshPatel. Would you mind emailing into support@braintreepayments.com so that we can gain some more details from you? Much appreciated. – drs6222 Oct 10 '17 at 12:30
  • ThinkAboutIt : I have send mail to support..please help through sandbox if u can..:) thanxx in advance. – Ashish Patel Oct 10 '17 at 17:29
  • 1
    ThinkAboutIt : i have spoke to support and they said marketplace is not available in braintree now, so that means i can not use escrow in my braintree payment gateway? – Ashish Patel Oct 13 '17 at 06:06