#PERF-klarna-react-native
1 messages · Page 1 of 1 (latest)
I have klarna setup and working within iOS, however when doing a similar flow in android. No Klarna button is rendered
Can you share the payment intent ID (pi_xxx) that doesn't render Klarna on your Android?
pi_3LDH9kFdV4bT3T5F0vaSlEiM
"react-native": "^0.67.3",
Sorry, I mean Stripe react native library
"@stripe/stripe-react-native": "^0.13.1",
@worldly girder do you still need that information ?
It's fine, I can check it via the react native SDK version;
Can you show me the params that you passed to initPaymentsheet() ?
const applePay = await isApplePaySupported();
const googlePay = await isGooglePaySupported();
const res = await initPaymentSheet({
testEnv: true,
style: 'alwaysLight',
merchantDisplayName: 'Some Name',
merchantCountryCode: 'US',
customFlow: true,
applePay,
googlePay,
returnURL: 'nameofApp://deep/noop',
customerId: 'cus_LqXRgzPup3ffhO',
paymentIntentClientSecret: 'pi_3LDH9kFdV4bT3T5F0vaSlEiM_secret_yWXZDMojcmdxIsI8zzm2dmIKF',
customerEphemeralKeySecret: 'ek_test_YWNjdF8xQ3pxTjRGZFY0YlQzVDVGLFk1SnRWZGU5OVhVTlJEa2FHbnMyYmtVdlI4VjQ1ak4_00CixcKN0s',
})
Got it, give me a sec, let me see if I can repro the issue
Hi @winged ledge I noticed that you are passing setup_future_usage, which Klarna doesn't support https://stripe.com/docs/payments/payment-methods/integration-options
yea the original script to create the payment intent i did the following. Which appear to work properly on iOS
re, err := paymentintent.New(&stripe.PaymentIntentParams{
Customer: stripe.String(cust.ID),
CaptureMethod: stripe.String("manual"),
Confirm: stripe.Bool(false),
AutomaticPaymentMethods: &stripe.PaymentIntentAutomaticPaymentMethodsParams{
Enabled: stripe.Bool(true),
},
PaymentMethodOptions: &stripe.PaymentIntentPaymentMethodOptionsParams{
Klarna: &stripe.PaymentIntentPaymentMethodOptionsKlarnaParams{
SetupFutureUsage: stripe.String("none"),
},
},
SetupFutureUsage: stripe.String(string(stripe.PaymentIntentSetupFutureUsageOffSession)),
Currency: stripe.String(string(stripe.CurrencyUSD)),
Amount: stripe.Int64(32423),
StatementDescriptor: stripe.String("Custom descriptor"),
})
this was done within Golang
Can you send me the paymentIntent that was succeeded in iOS?
pi_3LDE8sFdV4bT3T5F1QbyhGAm
Thanks, can you remove the PaymentMethodOptions in your GO code and try again in Android?
ok give me a moment
still doesn't appear. This was the new Payment Intent created pi_3LDJ2XFdV4bT3T5F1bA5ZJFt
Ah, there's still a SetupFutureUsage param in the PI creation request, can you remove that also?
Works for android now! However aren't some of this fields needed? Doesn't the SetupFutureUsage allow the payment method to be saved?
I'm afraid SetupFutureUsage doesn't work for Klarna, see more details here https://stripe.com/docs/payments/payment-methods/integration-options
will the normal credit card flow save the cards still?
Yes, so I'll suggest you to remove root SetupFutureUsage and specify card setupfutureUsage in the PaymentMethodOptions
Also why did work with iOS with these fields included originally?
PaymentMethodOptions: &stripe.PaymentIntentPaymentMethodOptionsParams{
Klarna: &stripe.PaymentIntentPaymentMethodOptionsKlarnaParams{
SetupFutureUsage: stripe.String("none"),
},
},
SetupFutureUsage: stripe.String(string(stripe.PaymentIntentSetupFutureUsageOffSession)),
Customer: stripe.String(cust.ID),
CaptureMethod: stripe.String("manual"),
Confirm: stripe.Bool(false),
AutomaticPaymentMethods: &stripe.PaymentIntentAutomaticPaymentMethodsParams{
Enabled: stripe.Bool(true),
},
PaymentMethodOptions: &stripe.PaymentIntentPaymentMethodOptionsParams{
Card: &stripe.PaymentIntentPaymentMethodOptionsCardParams{
SetupFutureUsage: stripe.String("off_session"),
},
},
Currency: stripe.String(string(stripe.CurrencyUSD)),
Amount: stripe.Int64(32423),
StatementDescriptor: stripe.String("Custom descriptor"),
})```
Can you try something like this? so this will only setup future usage for card.
Yes, can we continue this conversation tomorrow though? Getting late in my local time.
I will try in the morning
No problem!
Thanks so far @worldly girder and @glad lily