#wedfoo_code

1 messages · Page 1 of 1 (latest)

mint meteorBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1296481915813105715

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

pallid marsh
cursive vine
#

Can you share a payment intent id where it didn't show?

pallid marsh
#

{clientSecret: 'pi_3QAujMAp5kugdp2K0EmTOnMA_secret_sW4aBpRV6j7F1XWcvU6FTyRhR'}

#

I'm working in the staging/test environment

cursive vine
#

amazon pay only supports usd

pallid marsh
#

mmh, amazon and stripe enabled it together on my account in europe

cursive vine
#

Ah ok

pallid marsh
#

is there maybe something they have to do to allow me to accept eur?

cursive vine
#

Let me see then

pallid marsh
#

Téhina LAVIGNE | Program Manager EU

cursive vine
#

Ah you're on api version
2020-08-27

#

That means you need to explicitly turn on automatic payment method types when creating the payment intent

#

Otherwise only card will be the default

pallid marsh
#

var stripe = Stripe('{param_stripe_pk}', {
apiVersion: '2024-09-30.acacia' // Usa la versione più recente dell'API
});

#

I'm doing this on top of the code

cursive vine
#

It uses 2020-08-27

#

Above is the client side code

#

I'm not talking about that

#

Your server side code that creates the payment intent uses an older version

#

So you need to explicitly enable automatic payment methods using the param I linked above

pallid marsh
#

Ok, let me try quickly to force the new version

#

yes, it works! thank you!

cursive vine
#

Cool happy to help

#

Be careful with forcing the new version on other existing code though

pallid marsh
#

have a nice day!

cursive vine
#

There will be breaking changes

pallid marsh
#

is there any way to upgrade only the test environment with the new api version?

#

because I see it's possible only to do it in the production env

cursive vine
#

You don't need to use a different api version

#

I don't recommend doing that actually

#

To enable automatic payment methods

#

Then you can use the older version still

pallid marsh
#

I see, you are right it works

#

last question please

#

normally we block the payment and we deduct it only when we created the order (we are a food delivery platform)

#

now it seems no more possible to do it, right?

cursive vine
#

What do you mean? Why wouldn't it be possible

pallid marsh
#

'confirmation_method' => 'manual',
'confirm' => true,
'capture_method' => 'manual',

are not working now when I try to create an intent

cursive vine
#

Can you share the request id

pallid marsh
#

OLD VERSION

        $method = $result[0]['diff_hour'] < -5*24 ? 'automatic' : 'manual';
        
        $payment_options = array(
            'payment_method'      => $payment_method_id,
            'amount'              => $result[0]['payment_amount'] * 100, 
            'currency'            => strtolower($result[0]['payment_currency']),
            'confirmation_method' => $method,
            'confirm'             => true,
            'capture_method'      => $method,
            'description'         => $result[0]['payment_description'],
            // 'payment_method_types' => ['card', 'google_pay', 'apple_pay']
        );

        $stripe_intent = \Stripe\PaymentIntent::create(
            $payment_options
        );

NEW VERSION

        $payment_options = array(
            'amount'              => $result[0]['payment_amount'] * 100, 
            'currency'            => strtolower($result[0]['payment_currency']),
            'description'         => $result[0]['payment_description'],
            'automatic_payment_methods' => ['enabled' => true],
            'metadata' => [
                'custom' => $post_data['custom'],
            ]
        );

        $paymentIntent = \Stripe\PaymentIntent::create([
            $payment_options
        ]);
cursive vine
#

No no the request id

#

Manual capture is supported

#

Idk what flow you were doing before where you had payment method id before creating the payment intent

#

Yes```
pallid marsh
#

Sorry I don't understand what you need

cursive vine
#

You're saying a request is failing

pallid marsh
#

this is the error I see now
"You may only specify one of these parameters: automatic_payment_methods, confirmation_method."

cursive vine
#

Can you share its id so I can see what you're doing

#

Yeah it doesn't make sense to set confirmation method

#

You confirm client side in the browser

#

It makes sense to set capture_method

#

But confirmation_method doesn't make sense

pallid marsh
#

humans are still better than AI 😉

#

'capture_method' =>'manual',
'automatic_payment_methods' => ['enabled' => true],

#

this setting is working now

cursive vine
#

Yeah that's what you'd do if you need manual capture

pallid marsh
#

does this configuration work with google pay and apple pay?

cursive vine
#

yes

pallid marsh
#

OK, then you have solved all my major problems! The only thing I don't see is the automatic entry of the card owner in the fill-in fields, do I have to add it separately, am I doing something wrong?

cursive vine
#

Can you share a screenshot so I can see what you're referring to?

pallid marsh
#

I would like to ask the card holder name here

cursive vine
#

Yeah we hide/show that automatically based on an internal optimization

#

There's no way to force it

#

You'd need to collect it yourself if you want to force it

#

And always collect it in your own field

pallid marsh
#

can I consider this safe accepting payment without it? Normally we collect this to understand if someone is doing fake payments

cursive vine
#

Yeah we optimize when to collect it

#

But up to you on whether or not you want to force it

pallid marsh
#

ok, you solved all my problems in a few minutes..... thank you very very much! excellent work

cursive vine
#

No problem. Happy to help!

pallid marsh
#

have a nice day!