tyler-johnson / stripe-meteor

A Meteor package containing Stripe.js, Node-Stripe, and Stripe Checkout.
https://atmospherejs.com/mrgalaxy/stripe
150 stars 44 forks source link

createRefund with meteor.wrapAsync issue? #39

Open pmwisdom opened 9 years ago

pmwisdom commented 9 years ago

I've tried to do the usual pattern for meteor.wrapAsync with charges.createRefund and its giving me issues.

var createRefund = Meteor.wrapAsync(StripeAPI.charges.createRefund.bind(StripeAPI.charges);

var result = createRefund(chargeId);

Spits out a very weird error message: "Cannot use 'in' operator to search for 'message' in illegal access" whenever I try to invoke createRefund.

When I do....

StripeAPI.charges.createRefund(chargeId, function(err, results) {
        if(err) {
            throw new Meteor.Error('stripe-error', err);
        } else {
            fut.return(results);
        }
    });

It works, but without the advantages of wrapAsync.

Any Ideas?