#vartularena

1 messages ยท Page 1 of 1 (latest)

empty obsidianBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

left turret
#

can you share with me the CheckoutSession creation request and the PromoCode creation request?

#

@stiff bramble ^^

stiff bramble
left turret
#

can you share the creation request, looks like req_123

#

I can't open your Dashboard link

#

and also pls share creation request of CheckoutSession

stiff bramble
#

The checkout session request was this:
return await this._createSession(
data,
{
line_items: [
{
price: data.retrieveCardPriceId,
quantity: data.numCards
},
{
price_data: {
currency: 'usd',
product_data: {
name: 'Insurance fee'
},
unit_amount: data.insuranceFeeCents
},
quantity: 1
},
{
price_data: {
currency: 'usd',
product_data: {
name: 'Return shipping fee'
},
unit_amount: data.returnShippingFeeCents
},
quantity: 1
}
],
allow_promotion_codes: true
},
3 * 60 //3 minutes
)

#

I don't have the request body. This the code though, so these were the lineItems sent

left turret
#

sorry, the request ID, not the raw body of the request

stiff bramble
#

Got it. 2min I will create a new request and get that as there have been multiple requests since the original one

#

Here is the session reqid:
req_yFvBhD9j9cU695

#

These are all on dev, so look at the test logs

left turret
#

and the promo code / coupon creation??

stiff bramble
#

The promo code is not created using the api. Which request amongst these do you want the id for?

#

The promocode was created using the UI

left turret
#

the Dashboard created promo code will also have a request ID! it also makes an API request ๐Ÿ™‚

stiff bramble
#

Yeah I understand that. Got it you want me to look for the request when that promo code was created using the UI

#

Let me try to search for that

left turret
stiff bramble
#

No not that one

#

That's in prod, not dev

left turret
#

oh sorry, my bad

stiff bramble
#

This promocode was in dev.

left turret
#

forgot the filter I had was not for test mode

#

is yB1mHqAp right?

stiff bramble
#

Yes that's correct

#

Thanks again for checking

left turret
#

ok got it, my colleague helped me understand something

#

so the key part here is that you have the Coupon in https://dashboard.stripe.com/test/logs/req_lJavR4i1qpTedA only applying to Product prod_MHv7PDzt8BLVLZ

that's a problem because in your Checkout Session, you're creating one Price which is based on the Product above but for Insurance and Shipping , you're creating new Products inline using product_data so the Coupon / PromoCode will not apply to those.

#

the fix here is:

1/ Create your Insurance and Shipping Price off a fixed Product
2/ Pass those 2 product IDs also in the Coupon creation in the applies_to.product array

stiff bramble
#

Create your Insurance and Shipping Price off a fixed Product
The product will not have a fixed price though. Is that ok?

left turret
#

yes that is OK and test that out pls in test mode to validate

gloomy elbow
#

with stripe checkout you have to give a price id (for the product) - not the product id, right?

#

how can we set the price as a variable for a product, with stripe checkout? (the price of a product varies with each request)

stiff bramble
#

@left turret can you confirm about the above? Because the way we are creating the request right now for checkout we only pass a price id

left turret
stiff bramble
#

Perfect, thanks. We l try that now and let you know.

left turret
#

๐Ÿ‘