Passed coupon from metadata through to stripe

no-issue

This will allow us to send through coupons from the api layer and have
stripe handle the rest :)
This commit is contained in:
Fabien O'Carroll 2019-04-16 17:38:29 +02:00
parent b00c82d3a6
commit f99d66d8b9
2 changed files with 4 additions and 2 deletions

View File

@ -77,7 +77,8 @@ function createSubscription(stripe, member, metadata) {
}).then(() => {
return stripe.subscriptions.create({
customer: customer.id,
items: [{plan: metadata.plan.id}]
items: [{plan: metadata.plan.id}],
coupon: metadata.coupon
});
});
});

View File

@ -77,7 +77,8 @@ module.exports = class StripePaymentProcessor {
return api.subscriptions.create(this._stripe, member, {
plan,
stripeToken: metadata.stripeToken
stripeToken: metadata.stripeToken,
coupon: metadata.coupon
});
});
}