mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -05:00
Fixed Stripe Checkout for non-members
no-issue We needed to check for being
This commit is contained in:
parent
8d9340534d
commit
0c6b92be45
1 changed files with 2 additions and 1 deletions
|
@ -337,12 +337,13 @@ module.exports = class StripeAPIService {
|
||||||
*/
|
*/
|
||||||
async createCheckoutSession(plan, customer, options) {
|
async createCheckoutSession(plan, customer, options) {
|
||||||
const metadata = options.metadata || undefined;
|
const metadata = options.metadata || undefined;
|
||||||
|
const customerEmail = customer ? customer.email : options.customerEmail;
|
||||||
await this._rateLimitBucket.throttle();
|
await this._rateLimitBucket.throttle();
|
||||||
const session = await this._stripe.checkout.sessions.create({
|
const session = await this._stripe.checkout.sessions.create({
|
||||||
payment_method_types: ['card'],
|
payment_method_types: ['card'],
|
||||||
success_url: options.successUrl,
|
success_url: options.successUrl,
|
||||||
cancel_url: options.cancelUrl,
|
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
|
// @ts-ignore - we need to update to latest stripe library to correctly use newer features
|
||||||
allow_promotion_codes: this._config.enablePromoCodes,
|
allow_promotion_codes: this._config.enablePromoCodes,
|
||||||
metadata,
|
metadata,
|
||||||
|
|
Loading…
Add table
Reference in a new issue