mongoose-subscriptions-braintree

1.8.3 • Public • Published

Mongoose Subscriptions Braintree

Build Status Code Climate Test Coverage styled with prettier

Braintree processor for https://github.com/enhancv/mongoose-subscriptions

Useage

yarn add mongoose-subscription-braintree
const braintree = require("braintree");
const Customer = require("mongoose-subscriptions").Customer;
const BraintreeProcessor = require("mongoose-subscriptions-braintree");
 
const gateway = braintree.connect({ ... });
const plan = {
    processorId: 'id-plan',
    price: 4,
    billingFrequency: 3,
    level: 2,
};
 
// Define a processor using braintree gateway and some existing plans
// Currently the plans need to be input as plain objects to the processor
// and kept in sync with braintree plans
const processor = new BraintreeProcessor(gateway, [plan]);
 
const customer = new Customer({ ... });
customer.save().then(customer => customer.saveProcessor(processor));

Readme

Keywords

none

Package Sidebar

Install

npm i mongoose-subscriptions-braintree

Weekly Downloads

1

Version

1.8.3

License

MIT

Unpacked Size

49.7 kB

Total Files

11

Last publish

Collaborators

  • deepsyx
  • ginovski
  • ikerin