Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Braintree\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\Gateway)

Now I got Error

Uncaught exception 'Braintree\Exception\Configuration' with message 'Braintree\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\Gateway).

Question is that if my merchant ID is not how its creating sub merchant because i able to see sub merchant account in my dashboard but i am going to call this method:

$webhookNotification = Braintree\WebhookNotification::parse($sampleNotification['bt_signature'], $sampleNotification['bt_payload']);

it says

Uncaught exception 'Braintree\Exception\Configuration' with message 'Braintree\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\Gateway).
like image 784
Vicky Gill Avatar asked Nov 04 '25 05:11

Vicky Gill


1 Answers

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

The merchant ID is a required API credential for all Braintree API Calls, along with with the public and private key. You are able to see submerchants in your dashboard without the merchant ID because our system recognizes your login to the Dashboard as valid authentication instead of relying on the API Credentials.

When using our SDKs, you will need to set up your API Credentials appropriately. You can find the API Credentials for your account by following the instructions in our documentation. We now support both class level and instance methods.

Class Level Example

Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('use_your_merchant_id');
Braintree_Configuration::publicKey('use_your_public_key');
Braintree_Configuration::privateKey('use_your_private_key');

Instance Method Example

$gateway = new Braintree_Gateway([
    'environment' => 'sandbox',
    'merchantId' => 'use_your_merchant_id',
    'publicKey' => 'use_your_public_key',
    'privateKey' => 'use_your_private_key'
]);
like image 64
Lairen Avatar answered Nov 06 '25 21:11

Lairen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!