🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

braintree-isomorphic-functions

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

braintree-isomorphic-functions

Library of helpful braintree functions that can be run in a browser or server

1.0.27
latest
npm
Version published
Weekly downloads
14
100%
Maintainers
1
Weekly downloads
 
Created
Source

braintree-isomorphic-functions

Library of useful Braintree functions that can be run in browser or server built on the GraphQL Apis.

Browser Configuration

<script src="https://unpkg.com/braintree-isomorphic-functions@1.0.0/lib/braintree-isomorphic-functions.js"></script>
localStorage.setItem('BRAINTREE_PUBLIC_KEY', '');
localStorage.setItem('BRAINTREE_PRIVATE_KEY', '');
localStorage.setItem('BRAINTREE_ENVIRONMENT', 'sandbox');
localStorage.setItem('BRAINTREE_TOKENIZATION_KEY', '');

Server Configuration

Create a root .env file BRAINTREE_GATEWAY_ID= BRAINTREE_PUBLIC_KEY= BRAINTREE_PRIVATE_KEY= BRAINTREE_ENVIRONMENT=sandbox



## Examples

### Create Customer, Vault Payment Method to Customer, Charge Method.

braintreeFunctions.Customers.create({ firstName: 'Fred', lastName: 'Flintstone' }) .then(res => res.json()) .then(data => braintreeFunctions.Payments.vaultPaymentMethod('fake-valid-nonce', data.data.createCustomer.customer.id)) .then(res => res.json()) .then(data => braintreeFunctions.Payments.chargePaymentMethod(data.data.vaultPaymentMethod.paymentMethod.id, { amount: '15.60' })) .then(res => res.json()) .then(data => document.getElementById('result').innerHTML = JSON.stringify(data)) .catch(err => console.log(err));

FAQs

Package last updated on 29 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts