#lynx-io_unexpected
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/1477981825577128008
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you share some details about how you integrate today? Which APIs/UIs you're using to collect payments? Some code is helpful too!
Latest API and SDK
as for the code something like this
return this.stripe.paymentIntents.create(
{
customer: customerId,
payment_method: paymentMethodId,
amount,
currency: 'usd',
confirmation_method: confirmationMethod,
automatic_payment_methods: automaticPaymentMethods // this is true
Can you share a pi_xxx ID with me?
And to confirm, the issue is Klarna is showing when it shouldn't be?
Yes correct, it should only show to people in USA but it's showing to everyone
from a test env or prod?
Either, just a payment where the issue is evident
deleted it, let me know if you got it well
To clarify, you're using a rule to limit Klarna to a specific customer country right? https://docs.stripe.com/payments/payment-method-rules
Yeah that won't work here as they dont support recurring payments:
Payment method rules won’t apply when a Payment Element, Express Checkout Element, Checkout or Payment Links integration creates a subscription. For more information about subscriptions and invoices, see How subscriptions work.
What do you mean? I've seen purchases of recurring payment products already
The PI you shared is from a subscription/invoice. The rules don't work for those kind of payments, meaning if you've created a rule to restrict Klarna to USD and/or US-based customers it's ignored for this payment
I see. But the recurring payment still works fine right? I need to get his clear
Well the example you shared was canceled as the invoice was voided. Otherwise I don't understand the question
You mentioned that they do NOT support recurring payments. However, I've seen actual customers (the one I shared was from internal employee) purchasing via Klarna subscription/invoice.
This is now a different question
Will the renewal ocurr correctly?
You're conflating what I'm saying. Klarna does support recurring payments
I'm telling you that the rules you're using to limit Klarna payments to non-US customers do not work for recurring payments
Gotcha, now I understood
Thank your for clarifying that and your patience. Is there a way around this?
In any case, I'm surprised Klarna is rendering in the Payment Element unless you are deemed to be US based (via IP address)
It's not a cross-border payment method so it should be automatically filtered
That's my concern as well, hence reaching out here. I feel like there might be a bug somewhere
Checking something
👍
Also, the code you shared here doesn't map with the example PI you shared. This is non-recurring payment creation, the example was recurring (via POST /v1/subscriptions)
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Let me recheck that
Can you reproduce this exactly issue now and share an example? I can't find any logs for pi_3T4jwjB2MMvRpXYf1V44KaUP from 2/25
This is for the subscription one. We call this when calling /prepare to prepare the payment and get the paymentIntentSecret
return this.callStripe(
async () => {
const ret = await this.stripe.subscriptions.create(
{
customer: customerId,
default_payment_method: paymentMethodId,
items: priceIds.map((id) => {
return { price: id };
}),
collection_method: 'charge_automatically',
payment_settings: setPaymentMethodOnSubscribe
? { save_default_payment_method: 'on_subscription' }
: undefined,
payment_behavior: paymentBehavior || 'allow_incomplete',
discounts: coupon ? [{ coupon }] : undefined,
metadata,
expand: [
'latest_invoice.payments',
'latest_invoice.confirmation_secret',
],
},
{
idempotencyKey,
},
);
return ret as StripeSubscriptionWithLatestInvoice;
},
'creating subscription',
idempotencyKey,
);
I mean you're passing default_payment_method here so this all seems moot? Why would you render a UI to collect payment details if you already have some? In that example above we'd immediately attempt payment with the provided pm_xxx
I'd love to get an example pi_xxx from now where Klarna, in your opinion, renders unexpectedly. As I said that shouldn't happen unless we think you/the customers is located domestically (e.g. in the US)
It might be null that paymentMethodId
Sure
Seems like when in the code the default_payment_method is undefined or null, it creates a default address to US by Stripe, hence showing Klarna?
I am not in the USA btw, not even in America continent
Can you share a screenshot for the payment UI? Also all the code you use to init the Stripe.js/Payment Element
Ah, looks like your account is actually configured to support this (US -> EU customers with Klarna)
Yes, but still it's showing to people in KSA for example and Philippines
when it shouldn't
Probably need to see some examples of those, too. Right now it seems expected based on the example you've shared which is from a European based customer
Not sure how relevant? API version is not the cause
sorry I was using the italy vpn one second
I don't know, I was just sharing it
I also spotted this
function getPaymentElementOptions(
registrationState: RegistrationState
): ComponentProps<PaymentElement>["options"] {
return effectSafeParseSessionStorageIntentData(registrationState).pipe(
Option.flatMap((data) => {
const postalCode = data.isBillingAddressSame ? data.zip : data.billingZip;
return postalCode?.trim()
? Option.some({
// See https://docs.stripe.com/js/elements_object/create_payment_element
terms: {
card: "never",
},
defaultValues: {
billingDetails: {
address: { postal_code: postalCode },
},
},
} satisfies ComponentProps<PaymentElement>["options"])
: Option.none();
}),
Option.getOrNull
);
}```
Checking
I noticed that in the payment intent -> payment method, is empty before I proceed with clicking Klarna in the FE. And as soon as I click Klarna, it adds "US"
But even with empty address, below it says "allowed payment methods: klarna card"
Yeah the Payment Element will list all the supported billing countriues in the dropdown. What is surprising to me is that we don't apply IP based filtering to remove Klarna as an option given you're in KSA and it shouldn't be supported. It's unclear if this is expected, or a bug
I'd probably recommend you write in to my team directly and we can do a deeper investigation and work with Klarna team to understand the issue
Hello @rotund elk, we have sent you a direct message, please check it at https://discord.com/channels/@me/1477998906527846453
- 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
Alrighty, thank you!
@rotund elk please let us know when you do so that we close this thread
i went to the ai assistant and told it "yes', i think that was enough right?
Yep, we've got it. Will reply via email
i didn't add any extra details, i hope it got everything from discord