#Ayberk - checkout PI
1 messages ยท Page 1 of 1 (latest)
hi let me 2min for explain please
The payment intent related to Checkout is managed for you, and its not expected that you interact with it directly, for the most part.
Ayberk - checkout PI
Now i was create a paymentIntent yesterday and it gives to me status = 'requires_source' then im trying convert to session method. Now its giving error like that.
This is my old code
then i created this one. (new code)
and also this is my front-end (flutter)
idk how can i create session on front-end do you have and docs or help about that?
const paymentIntent = await stripe.paymentIntents.retrieve(session.payment_intent);
If you're using this to complete a payment in your own app, you cannot do that
Checkout sessions are for use with Stripe Checkout, redirecting your customer to complete payment there
If you're taking payment directly in your own app, you should not be using checkout sessions
ANd should use the payment intent API directly as you were before
Why did you change to use Checkout sessions if not intending to use Checkout?
somebody told me 'you should checkout session' from this discord cuz of when i using paymentIntent method the status parameter give to me 'require_source' when purchase succeed or canceled doesn't matter. Thast why im trying this method(session)
So basicly requestion to you, why this status parameter 'requires_source' even im using more than 2019 api version
and im giving payment_method too
Where are you seeing that, exactly?
with this code from firebase function log site.
I'm not sure why that was suggested, if you're taking payments directly in your own custom app payment flow, Checkout is not relevant for you
I mean on a specific payment intent, for example
an instance of this where you don't expect it
yea literally like that im doing
I mean if purchase succeded it should be succeded you know if not it should be canceled basicly
cuz im using query with status parameter
for do something after succeded purchases
Not sure what you mean by this, can you explain more?
yes its from paymentintent
with using this code
When purchase is succeded i'll do someting with this purchase item. if its not succeded i'll do another something with this purchase item.
And i need to take a control about the purchase successfully and its only way as i can see status parameter (succeded or declined).
OK, so you can use payment intents and track this. Some failures will be synchronous, but some may be async depending on payment method.
So you might need to listen to payment failure webhooks:
https://stripe.com/docs/api/events/types?lang=curl#event_types-payment_intent.payment_failed
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And handle accordingly
As you can see i use 2020 api but it returns me a 2017 api error. Do you have anything about that how can i upgrade api
I don't see anything about 2017 API. Where should I see that in what you shared? Do you have an example request?
Yes, we have docs covering API upgrades here:
its stripe log
and second question
my payment_method looking null how can fill that
how can i create payment method
cuz the 'requires_source' problem belongs to 2017 api and peoples when add to fill to payment_method parameter it works.
to where?
im using 10.16.0 version of node stripe
Sorry, my message didnt send. Docs are: https://stripe.com/docs/upgrades#how-can-i-upgrade-my-api
Where do you see this? What request/url? Individual request can override the API version to something different than your default.
Sure, which request?
req_123
It should be visible right near that API version you showed
req_HEolS4MSGQ4fDj
Can you copy paste that id please?
thanks
The client made this request using an explicit API version header
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so what u mean what should i do
You'd need to review your server code to see where/why that API version is being set, and change that if needed
But really I would like to know why this is causing you issues.
If you go back to using the payment intent integration, why is this a problem for you?
its problem because for example i already back to use paymentIntent integration and its still 'requires_source' it should be succeed for my code works
req_TmfS8lHrWLZmYj for this request is looking succeded but its from stripe dashboard
i can get the purchase get the money i got it but the program is getting the information from firebase function's url and its looking not succeeded there, looking 'requires_source'
What payment intent are you seeing this on?
There might be authentication required, etc.
what you mean?
That must be a specific payment intent with that status
I want to know which one to understand why it happens to explain to you and recommend what you can do
which payment intent is that from? pi_1234
Yes, thank you
So, yes, when you initially created this PI it has requires_source , which is normal and maps to requires_payment_method with newer API versions
https://dashboard.stripe.com/test/logs/req_zKDjfXGikH8jXL
Then you confirmed this with Stripe.js in the client side as expected and the payment succeeded:
https://dashboard.stripe.com/test/logs/req_TmfS8lHrWLZmYj
This all seems normal and expected
sir i already know my question is not this one. I already know i get succeed and i get money from stripe events as you look. But my firebase stripe function can't see the succeded why whats my fault
Why doesn't it see succeeded? I'd expect this if it eg listened to payment_intent.succeeded webhook events. Are you using those?
i didn't use webhook do you have example about that but its probably not for me cuz i read something about webhook; webhook will working after 5-10min from purchase i guess so i hear like this.
The webhook would be much faster than that, typically a few seconds after payment succeeds
Since the payment is completed client side, your server won't see that unless you use webhooks, this is expected
Sure, you can see an example of monitoring for payment success here:
https://stripe.com/docs/payments/payment-intents/verifying-status#webhooks
General webhook endpoint info here:
https://stripe.com/docs/webhooks/stripe-events
okey thank you i'll try