braintree-payments

Typescript Braintree Payments

Usage no npm install needed!

<script type="module">
  import braintreePayments from 'https://cdn.skypack.dev/braintree-payments';
</script>

README

Braintree Payments Module

Braintree deployment and build status

pipeline status coverage report

Getting started

Read the documentation under docs

To get that on the master server just type:

npm install braintree-payments

To check current status take a look on the tests:

npm test

Working with the bridge

First of all we have to specify the braintree module instance and paste the configuration inside Payments constructor.

const Payments = Braintree.Payments(configuration, currencies, defaultCurrency = 'EUR');

Inside configuration we will have to specify some params

const configuration = {
  environment: 'Sandbox | Qa | Development | Production',
  merchantId: 'MerchantID',
  publicKey: 'PublicKey',
  privateKey: 'PrivateKey'
};

Inside currencies we will have to specify multiple merchant accounts for multiple currencies

const currencies = [
  { currency: 'EUR', account: 'braintreeAccountIdForEur' },
  { currency: 'USD', account: 'braintreeAccountIdForUsd' },
  { currency: 'PLN', account: 'braintreeAccountIdForPln' }
];