0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00

Fixed Stripe Checkout for non-members

no-issue

We needed to check for  being
This commit is contained in:
Fabien O'Carroll 2021-01-26 12:14:56 +00:00
parent 8d9340534d
commit 0c6b92be45

View file

@ -337,12 +337,13 @@ module.exports = class StripeAPIService {
*/
async createCheckoutSession(plan, customer, options) {
const metadata = options.metadata || undefined;
const customerEmail = customer ? customer.email : options.customerEmail;
await this._rateLimitBucket.throttle();
const session = await this._stripe.checkout.sessions.create({
payment_method_types: ['card'],
success_url: options.successUrl,
cancel_url: options.cancelUrl,
customer_email: customer.email || options.customerEmail,
customer_email: customerEmail,
// @ts-ignore - we need to update to latest stripe library to correctly use newer features
allow_promotion_codes: this._config.enablePromoCodes,
metadata,