From f2b5c9f54d2d981cf8df23872e919ded03ed26ca Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 28 Dec 2021 16:05:45 -0600 Subject: [PATCH] winter sale: fix error with promotion codes. Fix an exception when checking out on Stripe caused by using the `allow_promotion_codes` and `discounts` parameters at the same time. Stripe::InvalidRequestError - You may only specify one of these parameters: allow_promotion_codes, discounts --- app/models/user_upgrade.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user_upgrade.rb b/app/models/user_upgrade.rb index 8551c7951..6ec4f2488 100644 --- a/app/models/user_upgrade.rb +++ b/app/models/user_upgrade.rb @@ -160,7 +160,7 @@ class UserUpgrade < ApplicationRecord client_reference_id: "user_upgrade_#{id}", customer_email: purchaser.email_address&.address, payment_method_types: methods, - allow_promotion_codes: allow_promotion_codes, + allow_promotion_codes: allow_promotion_codes.presence, line_items: [{ price: price_id, quantity: 1,