#linups_api

1 messages ¡ Page 1 of 1 (latest)

slim basaltBOT
#

👋 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/1291314809215651893

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

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.

sleek hemlock
little elm
#

should i use it on upsell, when trying to add user to subscription or on first checkout where user enter his credit card details?

sleek hemlock
little elm
#

If i implement this will it work with klarna?

#

'automatic_payment_methods' => ['enabled' => true], if i enable, klarna wont be displayed in checkout, i guess?

sleek hemlock
#

well you can accept the first payment with Klarna yes. The upsell/creating a subscription only works with cards since Klarna can't be used for off-session recurring payments

sleek hemlock
# little elm 'automatic_payment_methods' => ['enabled' => true], if i enable, klarna wont be ...

it won't be displayed if you pass setup_future_usage, as you note in the comment in the code in the video.
But when integrating more directly with PaymentElement/PaymentIntent, you can use the payment-method-specific option https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_options-card-setup_future_usage so that you can offer all methods, but only save the method if a card is used. Checkout doesn't support that payment-method-specific option approach today.

little elm
#

so, there is way to achieve this with checkout? All our projects and carts are using stripe checkout session. And that test user has saved card in stripe. Why it is not possible to use that card for future payments?

#

sorry, i mean Stripe checkout sessions

sleek hemlock
#

sorry that's multiple questions at once.
let's reset, since I just skimmed your video and had it muted.
Your ask is you want to process a one-time payment, and then optionally create a Subscription for the payment method used in that payment? (an upsell)

little elm
#

yes, but we also want to have klarna as payemnt option. If userp ays with klarna - we caanot show upsell, thats ok. but if user pays with credit card ,we want to show him upsell (our upsell is subscription plan).

#

if there is any chance to achieve with stripe checkout sessions, i would go that way. we have many projects under that.

sleek hemlock
#

then no, because in order to create the Subscription, you need to have saved the payment method. To save the payment method, you need to pass setup_future_usage. If you pass that, then Klarna won't be available on the first payment since it's not compatible.
The solution is to pass a parameter that says "accept all possible payment methods, but only save it if it's a card". That is what the payment-method-specific option https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_options-card-setup_future_usage can do. But we don't support that in Checkout today unfortunately, so you can only use it in a more custom integration using PaymentIntents/PaymentElement directly, I'm afraid.

So the options are

  • use PaymentIntents/PaymentElement instead and be able to implement this specific ask
  • continue to use Checkout and accept that this ask is just not possible today unfortuantely
little elm
#

hmm.. but in stripe admin panel, i can charge that user.

sleek hemlock
#

that user == cus_Qxf090Uxinr9Oj ? Yes, you can, what's unusual about that?

little elm
#

this is a test user, i used it to pay for initial product, but later payment failed on the upsell wit an error "This customer has no attached payment source or default payment method". But when i login to stripe admin panel, this user has payment method, that saved card.

#

and from stripe admin panel i can charge him again.

sleek hemlock
#

that's kind of a separte issue from the Klarna stuff. Saving the card and charging it will work, but you have to make the API calls correctly

slim basaltBOT
little elm
#

so, in my case if i understand correctly, such flow could work: Via stripe checkout sessions we charge customer for initial product. then before the upsell, we pull custoemr details from stripe (getting his default payemnt method) and then via API we subscribe him using that default payment method? that could work?

sleek hemlock
#

yes(my understanding from the video is that is what you're currently building)

little elm
#

and in such flow, we should avoid "This customer has no attached payment source or default payment method" error message.

carmine sand
#

Hey! Taking over for my colleague.

little elm
#

thanks, give me few minutes to test it.