#spharian_api

1 messages ยท Page 1 of 1 (latest)

rustic plankBOT
#

๐Ÿ‘‹ 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/1319768557638385675

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

polar pollen
#

Screen 1: what I have
Screen 2: what I want

steady hamlet
#

Hello, to make sure I am clear on your question: are you trying to save a user's apple pay card to Stripe? Or save a card to their Apple Pay wallet via Stripes APIs? Only the first one is possible at the moment, but I am happy to help you get through any steps that you are stuck on for that process

polar pollen
#

Hello, I'm trying to do like the second screenshot. On an app I use, they make a payment of 0.00โ‚ฌ with Apple Pay and save infos for later

steady hamlet
polar pollen
#

That's what I've done but the result is the first screenshot

#

Have to enter card infos manually

steady hamlet
#

Do you have apple pay cards saved on that device that you can use otherwise?

polar pollen
#

yes when I press pay here it's what i want on my app

#

I want this view + save payment method for later

#

when confirming a payment of 0.00โ‚ฌ

#

but for now I use this code and it only shows empty card sheet. I guess i have to change it to a 0โ‚ฌ payment but idk how to save the payment method for later if so

steady hamlet
#

If Apple Pay isn't showing up in the payment sheet, that may be why

polar pollen
polar pollen
#

$setupIntent = $user->stripe()->setupIntents->create([
'customer' => $user->stripe_id,
'payment_method_types' => ['card'],
'metadata' => [
'user_id' => auth()->user()->id,
'payment_method' => UserPaymentMethod::ApplePay->value,
],
]);

#

maybe something is wrong in my back end and I should set apple pay somewhere here : 'payment_method_types' => ['card'],

#

(for my payment intent)

steady hamlet
#

My apologies for dropping off of this thread. Checking in to why this may still not be showing up for you

#

I will ask my colleagues who know a bit more about our RN SDK

#

Can you send me the text of the code from that snippet? Makes it easier to share internally

#

Also, taking a step back if you are looking to have a button that just launces the apple pay sheet, you will want to use the platform pay button. The payment sheet that you are currently using is our product that is mean tot present multiple different payment methods in one place. So it will always at least show card and Apple Pay once you have Apple Pay properly set up here https://docs.stripe.com/apple-pay?platform=react-native#present-payment-sheet

polar pollen
steady hamlet
#

Thank you! And one last thing, can you send me the ID of a setup intent that you created for one of these tests? (seti_)

polar pollen
#

hmm yeah didn't upload it for my test account, but it says Apply pay is available when i check with the code

steady hamlet
#

Which line(s) of code is that?

#

I am pretty sure you need that full process to happen for apple pay to work with Stripe. Even if your app would be able to accept payments with the apple pay SDK directly otherwise

polar pollen
#

const [isApplePaySupported, setIsApplePaySupported] = useState(false);

useEffect(() => {
(async function () {
setIsApplePaySupported(await isPlatformPaySupported());
})();
}, [isPlatformPaySupported]);

#

it shows true. But i will upload the certificate in test mode as well

steady hamlet
polar pollen
#

I uploaded in test mode the same cert as prod, as I could create only 1 for the merchant id

#

hope it's ok

polar pollen
#

When I comment payment card "Card", it also shows PayPal but not Apple Pay

steady hamlet
#

Apple Pay should be under card. Also I just noticed the small section under the one that I linked.
https://docs.stripe.com/payments/accept-a-payment?platform=react-native#add-apple-pay
It mentions adding your merchant identifier to your StripeProvider if you have not already and adding apple pay settings to your paymentinitPaymentSheet which I do see is missing in the code sent above:

await initPaymentSheet({
  // ...
  applePay: {
    merchantCountryCode: 'US',
  },
});
polar pollen
#

oooh

#

It appeared with the merchantCountryCode

#

thanks a lot! How important is the country code? Our company is registered in Luxembourg, guess I should use LU?

steady hamlet
#

I am pretty sure you just need to set it to whatever your account's country is but let me double check

#

I can confirm it should be your country code, so LU makes sense here. Unfortunately I haven't found anything else on the "why" of this requirement

polar pollen
#

Ok thanks

#

Last question, I am almost done, do you know if I can just show Apple Pay here?

#

I think it's a configuration in SetupIntent

steady hamlet
polar pollen
#

Ok I see. Do you think I could just use the pay method, and use my own component button?

steady hamlet
#

Unfortunately no way to prevent that card input from showing up while using the stripe PaymentSheet. The platform pay button directly invoke's Apple's payment sheet

polar pollen
#

Ok thanks for your help ๐Ÿ™‚

steady hamlet
#

Of course! Glad we moved you forward a bit on this one

#

Have a good weekend/end of your year!