#PERF-klarna-react-native

1 messages · Page 1 of 1 (latest)

glad lily
#

👋 Happy to help

#

Can you share the issue that you're facing in Android?

winged ledge
#

I have klarna setup and working within iOS, however when doing a similar flow in android. No Klarna button is rendered

glad lily
#

Can you share the payment intent ID (pi_xxx) that doesn't render Klarna on your Android?

winged ledge
#

pi_3LDH9kFdV4bT3T5F0vaSlEiM

glad lily
#

PERF-klarna-react-native

#

which version of React Native library are you using?

winged ledge
#
"react-native": "^0.67.3",
glad lily
#

Sorry, I mean Stripe react native library

winged ledge
#
"@stripe/stripe-react-native": "^0.13.1",
#

@worldly girder do you still need that information ?

worldly girder
#

It's fine, I can check it via the react native SDK version;

#

Can you show me the params that you passed to initPaymentsheet() ?

winged ledge
#
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',
})
worldly girder
#

Got it, give me a sec, let me see if I can repro the issue

worldly girder
winged ledge
#

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

worldly girder
#

Can you send me the paymentIntent that was succeeded in iOS?

winged ledge
#

pi_3LDE8sFdV4bT3T5F1QbyhGAm

worldly girder
#

Thanks, can you remove the PaymentMethodOptions in your GO code and try again in Android?

winged ledge
#

ok give me a moment

#

still doesn't appear. This was the new Payment Intent created pi_3LDJ2XFdV4bT3T5F1bA5ZJFt

worldly girder
#

Ah, there's still a SetupFutureUsage param in the PI creation request, can you remove that also?

winged ledge
#

Works for android now! However aren't some of this fields needed? Doesn't the SetupFutureUsage allow the payment method to be saved?

worldly girder
winged ledge
#

will the normal credit card flow save the cards still?

worldly girder
#

Yes, so I'll suggest you to remove root SetupFutureUsage and specify card setupfutureUsage in the PaymentMethodOptions

winged ledge
#

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)),
worldly girder
#
        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.

winged ledge
#

Yes, can we continue this conversation tomorrow though? Getting late in my local time.

#

I will try in the morning

worldly girder
#

No problem!

winged ledge
#

Thanks so far @worldly girder and @glad lily