0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

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 e830e334d2
commit cdc3971ed8
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
});
});
}