#arrayappy
1 messages ยท Page 1 of 1 (latest)
You can't pass both those parameters together. Only subscription_data works in mode: 'subscription' sessions.
Where can I see checkout session metadata in UI
Where can I see chekcout sessions in UI, I'm getting their data on checkout.session.completed
But I want to see in dashboard
On the Dashboard page for the related Subscription
I'm attaching some info to create checkout
And I want to see that checkout session in dashboard
We don't currently surface Checkout Sessions in the Dashboard
Then how do I attach some metadata to payment intents while doing create checkout
You'd use payment_intent_data, but that only works in mode: 'payment' sessions
Didn't get you
Then, is there any way I can add data to payment intents, because I'm able to track failure payments over there
You're creating Checkout Sessions with mode: 'subscription', yes?
yes
Then you can't use payment_intent_data to automatically apply metadata to a Payment Intent. You'll need to do that manually, in a webhook
What is it you're trying to do?
Even though we are using mode as subscription
Payment intents are getting created for failed payments
So to track failure payments, instead of email
I want add more info
Yup, that's how it works. They're objects that track the state of an intent to pay - not necessarily a reflection of a successful payment
Subscriptions only created in some cases
But payment intents created upon all cases
So here I'm not able to track some
Can you share an ID from a Checkout Session you're creating? cs_xxx?
cs_test_a1Z6FL9flP8uGJlCLEFCwFcjfG0eNvDeZ0Q3SM43iuESpVh2K1rsLRxcZa
Check this pi_1Maz8BLJgwSSNK7BjHBkRBBc
It doesnt have subscription id
Ok, so yes. In the API version you're using a Payment Intent is created immediately on mode: 'payment' session creation. That's no longer the case in newer API versions: https://stripe.com/docs/upgrades#:~:text=A PaymentIntent is no longer created during Checkout Session creation in payment mode. Instead%2C a PaymentIntent will be created hen the Session is confirmed.
In mode: 'subscription' sessions, we only create the Subscription when the customer attempts to pay, but not on session creation.
got it
What's the best way to add metadata to payment intents?
Currently we are creating checkout.session.create with mode: subscription
You can't, not directly via the Checkout API. You'll need to do it in a webhook handler. Maybe set metadata on the Checkout Session and in your checkout.session.completed webhook handler your you make an API call to update using the metadata fields
But checkout.session.completed doesn't get called in all failed conditions right ??
Check this pi_1Maz8BLJgwSSNK7BjHBkRBBc
It doesnt have subscription id
There's no subscription field on a Payment Intent
You'd trace it back to the related Subscription via invoice: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Where do I change default cancel settings
Currently it is showing
Your plan will be canceled, but is still available until the end of your billing period on 13 March 2023.
But I want to cancel immediately and refund prorated amount
where exactly do you see that?
ok so now you're asking about the CustomerPortal
there are settings for this on https://dashboard.stripe.com/settings/billing/portal.
๐
Which card should I use to make failed payments, which should throw checkout.session.created webhook
I don't understand the question, sorry.
In testing
I want to make normal failed payment, where I want checkout.session.created
should trigger
I still don't know what that means, I'm sorry, you just used the same words
there is no event called checkout.session.created. Did you mean checkout.session.completed ?
checkout.session.completed only
Here I want to make failed test payment
That should trigger that checkout.session.completed webhook
how could it?
Where it helps us to handle grace period and give 1 day of free premium for my customers
if the payment declines then the CheckoutSession will not complete, that just seems impossible.
that's just not how Stripe Checkout works. If the customer enters a card and the attempt on that card declines, they just have to keep trying it and different cards until the payment goes through
Okk, I can replicate what I'm talking in live mode
By using some working card and entering incorrect otp
But in test mode I don't go to a place where I can enter OTP
that would still just fail, you would not get a checkout.session.completed event if the 3D Secure attempt failed(due to the customer entering the wrong password from their bank for example). So I don't think you understand exactly how this works.
you can use test cards from https://stripe.com/docs/testing#regulatory-cards and they will pop up an dialog where you can click "fail authentication", to simulate a case like entering an incorrect OTP