#daniyal_11692

1 messages · Page 1 of 1 (latest)

cyan quartzBOT
#

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

low kayak
#

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.

thin steeple
#

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,
],
]);

low kayak
#

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.

thin steeple
#

what would i pass in the client secret then: $data['client_secret'] = $intent->client_secret;
?

low kayak
karmic vault
#

@thin steeple reopenned here

thin steeple
#

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.

karmic vault
#

So you switched from SetupIntent to PaymentIntent, it's generally the same integration, just that you create a PaymentIntent instead

thin steeple
#

no, i'm in the process of shifting from setupintent to paymentintent

karmic vault
#

Yes

#

So instead of creating SetupIntent above, you would want to create a PaymentIntent

thin steeple
#

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

karmic vault
#

Here is the API Reference

thin steeple
#

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

karmic vault
#

Code looks correct but which other PaymentMethod you are expecting?

thin steeple
#

affirm and klarna

karmic vault
thin steeple
karmic vault
#

Hmm right... Sorry do you have a public accessible URL to your PaymentElement?

thin steeple
#

not a pulblic url. can i sahre pi id?

karmic vault
#

Yes but we can't really help without the URL, as we can't debug further on it

thin steeple
#

pi_3O50wNAAKdQR3wIt0EjOVDz3_secret_cMgvdYCRCvA86XtJBL8Wtl9Tl

karmic vault
#

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?

thin steeple
#

how can i do that?

#

automatic payment method should be enabled right?

karmic vault
#

Yes Automatic Payment Method is already enabled

thin steeple
#

how can i update the api version ?

karmic vault
cyan quartzBOT
thin steeple
#

can you check now i've updated the version: pi_3O523fAAKdQR3wIt0kVG5RG3_secret_iZImLpkITs1jMjlR3AcAc6Wsb

karmic vault
thin steeple
#

$intent = \Stripe\PaymentIntent::create([
'customer' => $customer->id,
'amount' => 2000,
'currency' => 'usd',
'automatic_payment_methods' => [
'enabled' => true,
]
],[],['stripe_version' => '2023-10-16']); is this correct?

native crown
#

👋 taking over for my colleague. Let me catch up.

thin steeple
#

ok thanks!

thin steeple
#

?

native crown
#

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

thin steeple
#

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

native crown
#

what do you mean no issue?

thin steeple
#

i was responding to your msg about missed responding

#

i've specfied the amount as 2000 ^

native crown
#

2000 is 20$

thin steeple
#

oops thanks let me recreate

#

pi_3O52noAAKdQR3wIt0BSHoVIC_secret_Ptp2d9Bfl6dcfJqaOIiPN9frg can you check with this

native crown
#

affirm is also not available in pakistan

thin steeple
#

should i set my location to us through vpn?

native crown
#

yes that might be helpful

thin steeple
#

is there ANY OTHER workaround for this?

#

actually my LDE stops when i use VPN?

native crown
#

unfortunately I don't think so

#

these Payment Methods are bound to customer locations

thin steeple
#

can you share the link in which there is requirement of location?

native crown
#

I already shared above

thin steeple
#

trying the vpn thing

cyan quartzBOT
thin steeple
#

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

simple ermine
#

Hi! I'm taking over this thread. Give me a few minutes to catchup.

thin steeple
#

ok

simple ermine
#

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?

thin steeple
#

yes payment elemnt

simple ermine
#

Then the issue, as mentioned before, is most likely that you are trying this from a country that doesn't support klarna/affirm.

thin steeple
#

i've set my location to US now

#

the PI id i sharedis from the locations set to US

simple ermine
#

Are you actually in the US, or are you trying this with a VPN?

thin steeple
#

with a VPN

simple ermine
#

Then that's most likely the issue.

thin steeple
#

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

simple ermine
#

oh! great catch. and sorry for missing this.

thin steeple
#

what would i pass in the amount on the front end?

#

currently i've just hardcoded this