#Ayberk - checkout PI

1 messages ยท Page 1 of 1 (latest)

quick mossBOT
humble birch
#

hi let me 2min for explain please

dapper lion
#

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

humble birch
#

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

#

idk how can i create session on front-end do you have and docs or help about that?

dapper lion
#
    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?

humble birch
#

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

dapper lion
#

Where are you seeing that, exactly?

humble birch
dapper lion
#

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

dapper lion
#

an instance of this where you don't expect it

humble birch
humble birch
#

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

dapper lion
#

Is that from a payment intent?

#

Which one? eg pi_123

dapper lion
humble birch
humble birch
humble birch
#

And i need to take a control about the purchase successfully and its only way as i can see status parameter (succeded or declined).

dapper lion
#

OK, so you can use payment intents and track this. Some failures will be synchronous, but some may be async depending on payment method.

#

And handle accordingly

humble birch
#

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

dapper lion
#

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:

humble birch
#

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.

humble birch
#

im using 10.16.0 version of node stripe

dapper lion
dapper lion
# humble birch

Where do you see this? What request/url? Individual request can override the API version to something different than your default.

humble birch
#

its from stripe dashboard

#

on my account

dapper lion
#

Sure, which request?

#

req_123

#

It should be visible right near that API version you showed

humble birch
#

req_HEolS4MSGQ4fDj

dapper lion
#

Can you copy paste that id please?

#

thanks

#

The client made this request using an explicit API version header

humble birch
#

so what u mean what should i do

dapper lion
#

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?

humble birch
#

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'

dapper lion
#

There might be authentication required, etc.

humble birch
dapper lion
#

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

humble birch
#

he okey i got it "id": "pi_3M7hdPBh1ukxHEOj1PmDsTMD",

#

this one u mean?

dapper lion
#

Yes, thank you

dapper lion
#

This all seems normal and expected

humble birch
#

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

dapper lion
#

Why doesn't it see succeeded? I'd expect this if it eg listened to payment_intent.succeeded webhook events. Are you using those?

humble birch
#

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.

dapper lion
#

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

humble birch
#

hmm so i need to use webhooks i got it

#

do you have any example about webhooks

dapper lion
humble birch
#

okey thank you i'll try