#linups_api
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/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.
- linups_api, 21 hours ago, 18 messages
hi! hmm well if you're using Checkout this is pretty hard to do. It's probably better to use PaymentElement since then 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.
should i use it on upsell, when trying to add user to subscription or on first checkout where user enter his credit card details?
I mean for doing the initial payment, instead of using Checkout, use https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements and then you can pass that parameter, and you can do your thing with creating a Subscription after if that's the goal
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?
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
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.
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
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)
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.
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
hmm.. but in stripe admin panel, i can charge that user.
that user == cus_Qxf090Uxinr9Oj ? Yes, you can, what's unusual about that?
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.
sure, like they can have a saved card, but when using the API you have to tell us to charge it(you need to pass either https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method or set https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method)
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
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?
yes(my understanding from the video is that is what you're currently building)
and in such flow, we should avoid "This customer has no attached payment source or default payment method" error message.
Hey! Taking over for my colleague.
Yes
thanks, give me few minutes to test it.