mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Added support for promo codes in Stripe Checkout (#194)
no-issue This commit adds support for Stripe's newly-added promotional code parameter when creating a new Stripe Checkout session. ref: https://stripe.com/docs/payments/checkout/set-up-a-subscription#coupons
This commit is contained in:
parent
016e05b234
commit
6ec7eeae33
@ -34,6 +34,7 @@ module.exports = class StripePaymentProcessor {
|
||||
this._checkoutCancelUrl = config.checkoutCancelUrl;
|
||||
this._billingSuccessUrl = config.billingSuccessUrl;
|
||||
this._billingCancelUrl = config.billingCancelUrl;
|
||||
this._enablePromoCodes = config.enablePromoCodes;
|
||||
|
||||
try {
|
||||
this._product = await api.products.ensure(this._stripe, config.product);
|
||||
@ -192,6 +193,7 @@ module.exports = class StripePaymentProcessor {
|
||||
cancel_url: options.cancelUrl || this._checkoutCancelUrl,
|
||||
customer: customer ? customer.id : undefined,
|
||||
customer_email: customerEmail,
|
||||
allow_promotion_codes: this._enablePromoCodes,
|
||||
metadata,
|
||||
subscription_data: {
|
||||
trial_from_plan: true,
|
||||
|
Loading…
Reference in New Issue
Block a user