mozfet:materialize-payments

v0.0.8Published 6 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

MaterializeCSS Payments for Braintree

Thank you

This package was created and is maintained by The Expert Box as a thank you to the open source community.

Installation - server side

Create settings-developement.json with your Braintree sandbox credentials and settings-production.json with your production credentials. Remember that these credentials should be protected, and thus not uploaded to your repo.

1{
2  "braintree": {
3    "environment": "Braintree.Environment.Sandbox",
4    "merchantId": "your merchant id",
5    "publicKey": "your public key",
6    "privateKey": "your private key"
7  }
8}

Usage - client side

Click and buy button template js:

1import Payment from 'meteor/mozfet:materialize-payments'
2
3Template.myPaymentButton.events({
4  'click .btn'(event, instance) {
5    Payment.create({
6      type: 'BRAINTREE',
7      amount: 5,
8      currency: 'EUR',
9      meta: {
10        productId: '1234'
11      }
12    })
13  }
14})

Click and buy button template html:

1<template name="myPaymentButton" >
2  <button class="btn">Pay $5</button>
3</template>

Show the payment button in any client template html

1{{> myPaymentButton}}