#wedfoo_code
1 messages · Page 1 of 1 (latest)
👋 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.
Can you share a payment intent id where it didn't show?
{clientSecret: 'pi_3QAujMAp5kugdp2K0EmTOnMA_secret_sW4aBpRV6j7F1XWcvU6FTyRhR'}
I'm working in the staging/test environment
mmh, amazon and stripe enabled it together on my account in europe
Ah ok
is there maybe something they have to do to allow me to accept eur?
Let me see then
Téhina LAVIGNE | Program Manager EU
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
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
You can look at your payment intent creation request: https://dashboard.stripe.com/test/logs/req_XYCoLRXeEa6jY9
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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
Cool happy to help
Be careful with forcing the new version on other existing code though
have a nice day!
There will be breaking changes
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
You don't need to use a different api version
I don't recommend doing that actually
All I recommend doing is adding this param to the payment intent creation request: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-automatic_payment_methods-enabled
To enable automatic payment methods
Then you can use the older version still
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?
What do you mean? Why wouldn't it be possible
'confirmation_method' => 'manual',
'confirm' => true,
'capture_method' => 'manual',
are not working now when I try to create an intent
Can you share the request id
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
]);
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```
Sorry I don't understand what you need
You're saying a request is failing
this is the error I see now
"You may only specify one of these parameters: automatic_payment_methods, confirmation_method."
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
humans are still better than AI 😉
'capture_method' =>'manual',
'automatic_payment_methods' => ['enabled' => true],
this setting is working now
Yeah that's what you'd do if you need manual capture
does this configuration work with google pay and apple pay?
yes
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?
Can you share a screenshot so I can see what you're referring to?
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
You can set name to 'never' when creating the payment element here: https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-name
And always collect it in your own field
Or use the address element: https://docs.stripe.com/elements/address-element
can I consider this safe accepting payment without it? Normally we collect this to understand if someone is doing fake payments
Yeah we optimize when to collect it
But up to you on whether or not you want to force it
ok, you solved all my problems in a few minutes..... thank you very very much! excellent work
No problem. Happy to help!
have a nice day!