#WEIRDLEMON - Afterpay payment sheet

1 messages ยท Page 1 of 1 (latest)

sturdy mirage
thick plaza
#

O just have to add afterpay in the payment methods?

sturdy mirage
#

Exactly what I was about to say

#

Or you can exclude the payment_method_types if you have activated Afterpay on your account and want to use automatic payment method selection.

thick plaza
#

what is the key for after pay

#
const paymentIntent = await stripe.paymentIntents.create({
          description,
          shipping: {
            name: userName,
            address: userAddress,
          },
          customer: customerId,
          amount: parseInt(totalAmt * 100),
          currency: "usd",
          payment_method_types: ["card"],
          // setup_future_usage: true,
        });
#

this is my payment intent object currently

#

I couldn't find the key

sturdy mirage
#

afterpay_clearpay

thick plaza
#

is it visible in simulator ios?

sturdy mirage
#

It should be. Are you using the simulator and it is not showing up?

thick plaza
#

yeah

#

it's not showing up

#

for some reason

#

@sturdy mirage

hushed wagon
#

Can you give an exact Session id that we can look at?

thick plaza
#

how do I get that?

hushed wagon
#

You create the Checkout Session with your code so usually you would already be debugging and having the id

#

it's also in the URL

thick plaza
#

let me get back to you

hushed wagon
#

sure!

thick plaza
#

Is it because I'm using expo?

#

sdk 44

#

"@stripe/stripe-react-native": "0.2.3",

hushed wagon
#

not really no

#

I really just need an example Session id

thick plaza
#

okay

hushed wagon
#

I'm quite confused, your code is creating a PaymentIntent

#

I think maybe I misunderstood the ask entirely my bad. You're not using Checkout right? You're purely using PaymentIntent and the react-native SDK?

#

Can you share the code you use client-side to show the UI in your screenshot? And can you share a PaymentIntent id pi_1234567?

thick plaza
#

I guess I figured it out

#

Just changing a few things

#

I did something fundamentally wrong

hushed wagon
#

ah nice

thick plaza
#

Ah It still doesn't work

#

I thought I resolved it

#

client side code===>

#
const { error } = await stripe.initPaymentSheet({
          paymentIntentClientSecret: paymentIntent,
          merchantDisplayName: "Spotlight Shops Inc.",
          merchantIdentifier: "merchant.spotlightshops.app",
          applePay: true,
          googlePay: true,
          merchantCountryCode: "US",
          allowsDelayedPaymentMethods: true,
          customerEphemeralKeySecret: ephemeralKey,
          customerId: customer,
          publishableKey: publishableKey,
          defaultBillingDetails: billingDetails,
        });
#

pi_3KmPYFIroE9a6cxW2C5i1jcE

hushed wagon
#

looking

thick plaza
#

server side code:

const paymentIntent = await stripe.paymentIntents.create({
          description,
          shipping: {
            name: userName,
            address: userAddress,
          },
          customer: customerId,
          amount: parseInt(totalAmt * 100),
          currency: "usd",
          payment_method_types: ["card", "afterpay_clearpay", "klarna"],
          // setup_future_usage: true,
        });
hushed wagon
#

Okay, so the Payment Sheet implementation does not handle Afterpay

thick plaza
#

What about klarna and paypal?

hushed wagon
thick plaza
#

Klarna?

hushed wagon
#

Klarna is in the doc I mentioned above

hushed wagon
#

so yeah the payment sheet supports Klarna. For Afterpay you have to write your own code/UI presentation layer

#

also you're on 0.2.3 which is quite old

thick plaza
#

But klarna is on 0.2.3?

#

I saw it here

hushed wagon
#

I'm not saying it's not there, I'm just explaining you're on a really old version

#

sorry looks like you already had found most of that information

thick plaza
#

I just still can't get klarna on the payment sheet UI

#

๐Ÿ˜…

#

If it should show up, then why isn't is showing up?

#

๐Ÿ™

hushed wagon
#

I don't know for your version no

thick plaza
hushed wagon
#

you found that comment, I believe it shipped in 0.6.0 personally

thick plaza
#

what version can I upgrade to for expo sdk 44?

hushed wagon
#

Expo is on an older version unfortunately

thick plaza
#

Is there going to be an update with expo anytime soon?

hushed wagon
#

Not soon no

thick plaza
#

That's really sad

#

lol

#

okay so basically, I need to implement both Klarna and Afterpay on my own

#

?

hushed wagon
#

That would be my recommendation for now yes

thick plaza
#

Alright @hushed wagon!
you were of a great help man! thanks a lot!!
have a great day!

hushed wagon
#

sure sorry that you didnt get the answers you were hoping for. We're flagging internally