Meteor/Reaction Package for Paypal integration, installed by default with core packages.
mrt add reaction-
paypal
In settings/settings.json file, or via dashboard configuration:
"paypal": {
"mode:" false, //true is live
"client_id": "<your paypal client id>",
"client_secret": "<your paypal client secret>"
}
This overrides the dummy fixture data in common/collections.coffee
Meteor.settings.paypal =
mode: false
client_id: ""
client_secret: ""
Format is Meteor.Paypal.*transaction_type*({ {/*card data*/}, {/*transaction data*/}, function(err, res){...})
Meteor.Paypal.authorize({
name: 'Buster Bluth',
number: '4111111111111111',
cvv2: '123',
expire_year: '2015',
expire_month: '01'
},
{
total: '100.10',
currency: 'USD'
},
function(error, results){
if(error)
//Deal with Error
else
//results contains boolean for saved
// and a payment object with information about the transaction
});
For information on the payment object returned see Paypal's Payment Option Documentation
Thanks to, and much borrowed from David Brear's meteor-paypal