Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
237 views
in Technique[技术] by (71.8m points)

Braintree escrow payment not working?

I am testing braintree ecrow payment in sandbox account . Below is the code I have written.

//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(
      [
    'amount' => '100.00',
     'merchantAccountId' => 'test',
     'creditCard' => [
      'number' => '5105105105105100',
          'expirationDate' => '05/16'
    ],
    'options' => [
          'submitForSettlement' => true,
          'holdInEscrow' => true,
        ],
        'serviceFeeAmount' => "10.00"
    ]

);
if ($result->success) {
    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("
  code: " . $result->transaction->processorResponseCode);
    print_r("
  text: " . $result->transaction->processorResponseText);
} else {
    print_r("Validation errors: 
");

    print_r($result->errors->deepAll());
}

The following code throws validation errors as below.

Validation errors: Array ( [0] => Braintree_Error_Validation Object ( [_attribute:Braintree_Error_Validation:private] => serviceFeeAmount [_code:Braintree_Error_Validation:private] => 91557 [_message:Braintree_Error_Validation:private] => Service fee not supported on master merchant account. ) [1] => Braintree_Error_Validation Object ( [_attribute:Braintree_Error_Validation:private] => base [_code:Braintree_Error_Validation:private] => 91560 [_message:Braintree_Error_Validation:private] => Transaction could not be held in escrow. ) )

But the merchantAccountId I have used is sub merchant id which I have created manually. Anyone with any help much appreciated. Thanks in advance .

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Solved!!

Because Marketplace is only supported in the US, and you signed up for your sandbox outside of the US, your sandbox isn't a Marketplace account. If you are a developer working for a US based merchant on an integration, you will need to signup for a US sandbox account. You can do this on our website by selecting United States as your country using the drop down menu on the bottom left of the page. You should then be able to click the Try the Sandbox button and sign up for a new sandbox account with Marketplace features enabled. This should allow you to create sub-merchant accounts using a master merchant account, which will exist if a new sandbox is created following the directions I've supplied. Once you have a Marketplace sandbox, your default merchant account will also be your Master Merchant account.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...