stripe-meteor icon indicating copy to clipboard operation
stripe-meteor copied to clipboard

createRefund with meteor.wrapAsync issue?

Open pmwisdom opened this issue 9 years ago • 0 comments

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?

pmwisdom avatar Jul 15 '15 20:07 pmwisdom