#dmi_apple-pay-connect

1 messages ยท Page 1 of 1 (latest)

late treeBOT
#

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

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

frail lance
#

Hi ๐Ÿ‘‹

This Payment Intent was created on account acct_1PYlVyKs781xbNKt. But you attempted to cnfirm it on acct_16I1kqIcWSSPnlgr

#

You need to specify the Connected Account ID in your confirm request

quiet citrus
#

u mean to use the Connected AccountID on the confirm payment call?

#

when I tried this code. It is not showing the apple pay, instead its show create link code?
const stripe = Stripe('pk_test....', {
stripeAccount: 'acct_', // Connected account ID
});

frail lance
#

Is Apple Pay enabled for that account?

quiet citrus
#

Yes on the platform account yes.

frail lance
#

You need to properly configure Apple Pay on the Connected Account

#

If Apple Pay is not showing, then something is wrong with the account configuration

quiet citrus
#

I am checking one second please

#

May I know which option I should check on conencted account?

frail lance
#

Does it have an Apple Pay domain registered that corresponds to the domain where you are hosting the Express checkout element?

quiet citrus
#

Platform account I have the hosted domain created..

#

but not for connected account.

frail lance
#

Since you are using Direct Charges, the Connected Account must have a registered domain for Apple Pay

quiet citrus
frail lance
#

You can use the same domain, yes. As for enabling the domain, I'm not sure if you can do that via the Dashboard but you can use the API https://docs.stripe.com/api/payment_method_domains/create.

You would pass the Stripe Account ID to make sure this domain is created on the Connected Account

quiet citrus
#

Thank you for the info. I will use that.. Also, on the JS code..
Do I still need to configure the connectedAccount right like below?
const stripe = Stripe('pk_test_AQULtZwJAkYxpKhnW3udzFW9', {
stripeAccount: 'acct_16HxfvHozpwNUrbx', // Connected account ID
});

frail lance
#

You need to do it for each API request

quiet citrus
#

similar above or different way,, sorry!

#

Okay, I will follow the doc.. One more question.
Since I create a PaymentIntent on server side.. Do I need to use this JS code or I can pass the payment intent ID here?
const options = {
mode: 'payment',
amount: 100,
currency: 'usd',
};

const elements = stripe.elements(options);

#

or
const elements = stripe.elements({clientSecret: serverSide.ClientSecret})

frail lance
#

The Express Checkout Element is designed to be created first without the Payment Intent.

#

But if you already have the Payment Intent client secret you can juse use that

quiet citrus
#

can I have a sample code or documentation for this?

#

I tried using it but got some errors.

frail lance
#

What is the exact error you received?

quiet citrus
#

It does not load on mobile browser. unfortunately, I could not recall the error.. But Apple PayButton does not show up..

frail lance
#

Unfortunately without the exact error, I cannot provide further guidance

quiet citrus
#

so in iPhone testing this js code.. How do I capture any erros that might occured?

frail lance
#

I'm not sure. I recommend testing it with a desktop Safari browser and reviewing the console

quiet citrus
#

You mean using MAC with safari for Apple Pay testing.. Does mini-mac work too

frail lance
#

As long as you have a saved payment method for that safari browser

quiet citrus
#

Oh okay, got it.. If I have saved my cards with Safari.. then I can use it.. got it..

#

Is it okay to expose the connected account Id and Stripe key via JS file for security reason I am asking?

frail lance
#

The stripe key is the Publishable Key, right? pk_?

quiet citrus
#

yes

#

and the Connected Account Id

frail lance
#

Okay that's fine.

quiet citrus
#

okay, thank you! appreciated your help on this matter.

frail lance
#

Only accounts with the right permissions already enabled can use the Acount ID

quiet citrus
#

Got it.. Thank you @frail lance

frail lance
#

Happy to help ๐Ÿ™‚