#daniyal_11692
1 messages · Page 1 of 1 (latest)
Hello daniyal_11692, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• daniyal_11692, 6 days ago, 36 messages
• daniyal_11692, 6 days ago, 27 messages
• daniyal_11692, 6 days ago, 20 messages
• daniyal_11692, 6 days ago, 41 messages
• daniyal_11692, 6 days ago, 3 messages
Hi 👋 typically we don't recommend using a Setup Intent if you know you're going to be processing a payment shortly after, in that case you can use a Payment Intent with setup_future_usage instead.
For those payment method types though, with your current approach, you would want to use a Payment Intent to process the payment, and would skip the Setup Intent portion of the flow.
would i totally skip the part where i'm currently crearing the setup intent: $intent = \Stripe\SetupIntent::create([
'customer' => $customer->id,
'on_behalf_of' => $integration->stripe_user_id,
'automatic_payment_methods' => [
'enabled' => true,
],
]);
Yup. Those payment methods can't be set up for future payments, so they don't support the use of Setup Intents and you won't be able to use them together.
what would i pass in the client secret then: $data['client_secret'] = $intent->client_secret;
?
When? When processing the payment client side? If so, you'd pass the client_secret of the Payment Intent:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@thin steeple reopenned here
thanks
can you suggest what can i do here^
$intent = \Stripe\SetupIntent::create([
'customer' => $customer->id,
'on_behalf_of' => $integration->stripe_user_id,
'automatic_payment_methods' => [
'enabled' => true,
],
]); this is my setupintent creation code.
So you switched from SetupIntent to PaymentIntent, it's generally the same integration, just that you create a PaymentIntent instead
no, i'm in the process of shifting from setupintent to paymentintent
Yes
So instead of creating SetupIntent above, you would want to create a PaymentIntent
i've shared the code in which ^ in which i'm creating setupintent. want to ask how can i do update this to create paymentintent instead?
yes exactly bcz i need to support BNPL methods like affirm and klarna and they are not supported in setupintent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Here is the API Reference
looking
does this look ok $intent = \Stripe\PaymentIntent::create([
'customer' => $customer->id,
'amount' => 2000,
'currency' => 'usd',
'automatic_payment_methods' => [
'enabled' => true,
],
]);
ok so i've upated the code to create payment intent instead but still only card method is showinng
Code looks correct but which other PaymentMethod you are expecting?
affirm and klarna
Ah I see. Sorry Affirm and Klarna is not supported in PaymentElement yet. We only support in Checkout or Direct API. ie see: https://stripe.com/docs/payments/klarna/accept-a-payment
i can see bith affirm and klarna here: https://stripe.com/docs/payments/payment-element
Hmm right... Sorry do you have a public accessible URL to your PaymentElement?
not a pulblic url. can i sahre pi id?
Yes but we can't really help without the URL, as we can't debug further on it
pi_3O50wNAAKdQR3wIt0EjOVDz3_secret_cMgvdYCRCvA86XtJBL8Wtl9Tl
I can see you enabled Automatic Payment Method
You are using a pretty old API version of 2015-10-16 Can you try with latest API version?
Yes Automatic Payment Method is already enabled
how can i update the api version ?
Please take a look here https://stripe.com/docs/upgrades
can you check now i've updated the version: pi_3O523fAAKdQR3wIt0kVG5RG3_secret_iZImLpkITs1jMjlR3AcAc6Wsb
https://dashboard.stripe.com/test/logs/req_C3OEJNACnu7CXP still on 2015 API version
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
$intent = \Stripe\PaymentIntent::create([
'customer' => $customer->id,
'amount' => 2000,
'currency' => 'usd',
'automatic_payment_methods' => [
'enabled' => true,
]
],[],['stripe_version' => '2023-10-16']); is this correct?
👋 taking over for my colleague. Let me catch up.
ok thanks!
?
I'm terribly sorry I missed responding, I already found the issue for Affirm
so basically for Affirm the minimum amount is 50$
the PI you created is for 20$
that's why it doesn't show up
as for Klarna it's not available in Pakistan https://stripe.com/docs/payments/klarna#:~:text=Supported customer countries
no issue.
$intent = \Stripe\PaymentIntent::create([
'customer' => $customer->id,
'amount' => 2000,
'currency' => 'usd',
'automatic_payment_methods' => [
'enabled' => true,
],
],[],['stripe_version' => '2023-10-16']); i specify the amount as 2000
what do you mean no issue?
i was responding to your msg about missed responding
i've specfied the amount as 2000 ^
2000 is 20$
oops thanks let me recreate
pi_3O52noAAKdQR3wIt0BSHoVIC_secret_Ptp2d9Bfl6dcfJqaOIiPN9frg can you check with this
affirm is also not available in pakistan
should i set my location to us through vpn?
yes that might be helpful
unfortunately I don't think so
these Payment Methods are bound to customer locations
can you share the link in which there is requirement of location?
I already shared above
trying the vpn thing
i've changed my location to US pi_3O53AGAAKdQR3wIt1k2ZQJou_secret_ZOzIfnj6grnILjCTQ5tlGkXhc
and that is the PI id^
still affirm and klarna are not showing up
Hi! I'm taking over this thread. Give me a few minutes to catchup.
ok
If you check the PaymentIntent object, you can see:
payment_method_types: [
"card",
"klarna",
"affirm"
],
So it means that this PaymentIntent can accept Klarna and Affirm. So everything seems to be set correctly.
Are you using the Payment Element on the front end to collect payments?
yes payment elemnt
Then the issue, as mentioned before, is most likely that you are trying this from a country that doesn't support klarna/affirm.
Are you actually in the US, or are you trying this with a VPN?
with a VPN
Then that's most likely the issue.
they are showing up now
i had to do changes in the html file
const stripeElementOptions = {
mode: 'payment',
currency: 'usd',
amount: 6000,
}
oreviously mode was setup
oh! great catch. and sorry for missing this.