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
This commit is contained in:
evazion
2021-12-28 16:05:45 -06:00
parent b8356c97c1
commit f2b5c9f54d

View File

@@ -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,