#WEIRDLEMON - Afterpay payment sheet
1 messages ยท Page 1 of 1 (latest)
Have you already been following this guide or a guide like it? https://stripe.com/docs/payments/accept-a-payment
O just have to add afterpay in the payment methods?
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.
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
afterpay_clearpay
is it visible in simulator ios?
It should be. Are you using the simulator and it is not showing up?
how do I get that?
You create the Checkout Session with your code so usually you would already be debugging and having the id
otherwise you can find it in the Dashboard or in your logs https://dashboard.stripe.com/test/logs
it's also in the URL
let me get back to you
sure!
okay
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?
I guess I figured it out
Just changing a few things
I did something fundamentally wrong
ah nice
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
looking
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,
});
Okay, so the Payment Sheet implementation does not handle Afterpay
So you need to follow the public docs instead, we cover this in details: https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment?platform=react-native#collect-payment-method-details
What about klarna and paypal?
https://stripe.com/docs/payments/accept-a-payment#react-native-add-server-endpoint we cover what is supported here
The mobile Payment Element supports Bancontact, credit cards, iDEAL, Klarna, SEPA Direct Debit, and Sofort.
We don't support Paypal so that one is not relevant
Klarna?
I've added it here
Klarna is in the doc I mentioned above
this one?
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
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
I just still can't get klarna on the payment sheet UI
๐
If it should show up, then why isn't is showing up?
๐
this is my server side code
are you sure?
I don't know for your version no
https://stripe.com/docs/payments/klarna/accept-a-payment
this has no mention of payment sheet
you found that comment, I believe it shipped in 0.6.0 personally
what version can I upgrade to for expo sdk 44?
Expo is on an older version unfortunately
Is there going to be an update with expo anytime soon?
Not soon no
That's really sad
lol
okay so basically, I need to implement both Klarna and Afterpay on my own
?
That would be my recommendation for now yes
Alright @hushed wagon!
you were of a great help man! thanks a lot!!
have a great day!
sure sorry that you didnt get the answers you were hoping for. We're flagging internally