#mhdev
1 messages · Page 1 of 1 (latest)
Hi there
Are you using Payment Element?
Or what integration are you using currently to accept Cards?
If you are just using Card Element, then yes you would need Payment Request Button
we are using this - https://stripe.com/docs/payments/quickstart
Ah okay so you are using Payment Element
You just need to verify your domain here for Apple Pay to show up
https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#verifying-your-domain-with-apple-pay is the info on verifying your domain
we are using this: <PaymentElement id="payment-element" />
can you confirm this is payment element?
Yep that is Payment Element
so if we do those two things, there is nothing else we need to do?
just the code from the tutorial plus those two steps?
Yep. Then as long as you have Apple Pay turned on (if you are using Auto Payment Methods), it will show up if the customer is using Safari and has a supported Card in their Apple Pay Wallet
and if this is for connect customers within our platform?
direct charges
we are using an iframe
and we have added the route domain using the api
Okay so with Direct Charges this means that you do have to register the domain on each Connected Account.
we have done that
using the api
Okay then yes it should just work
so we do need the payment request button?
No you do not if you are using Payment Element
so we just have to follow these steps?
Use the Payment Request Button with Stripe Connect
Connect platforms that either create direct charges or add the token to a Customer on the connected account must take some additional steps when using the Payment Request Button.
On your frontend, before creating the PaymentRequest instance, set the stripeAccount option on the Stripe instance:
JavaScript
JavaScript (ESNext)
var stripe = Stripe('pk_test_51Ji1IKBLuRYaed2CS5E3lPuCOhOHUcAFVdipGRpf60w2vtciTZn2DVZhW6O9kMO0JsCBVFrok59uAvO33XP7m2PR00PNpPUVOk', {
apiVersion: "2020-08-27",
stripeAccount: 'CONNECTED_STRIPE_ACCOUNT_ID',
});
Register all domains on which the Payment Request Button will be shown with Apple Pay. You can use the Stripe API for this, using your platform’s secret key to authenticate the request, and setting the Stripe-Account header to your connected account’s Stripe ID, as described in Making API calls for connected accounts.
You must use your platform’s live secret key to register the domains; don’t add domains in test mode.
curl
Ruby
Python
PHP
Node
Java
Go
.NET
var stripe = require("stripe")("sk_live_••••••••••••••••••••••••");
const domain = await stripe.applePayDomains.create({
domain_name: 'example.com',
},{
stripe_account: '{{CONNECTED_ACCOUNT_ID}}',
});
Yep
but this is talking about the payment request button?
"On your frontend, before creating the PaymentRequest instance, set the stripeAccount option on the Stripe instance:" - is this referring to the create paymentintent function?
That doc is about Payment Request Button, yes. But Payment Element basically has Payment Request Button built-in, and you just need to follow the domain verification steps that are mentioned in the Payment Request Button doc
do we need this piece of code for the frontend?
var stripe = Stripe('pk_test_51Ji1IKBLuRYaed2CS5E3lPuCOhOHUcAFVdipGRpf60w2vtciTZn2DVZhW6O9kMO0JsCBVFrok59uAvO33XP7m2PR00PNpPUVOk', {
apiVersion: "2020-08-27",
stripeAccount: 'CONNECTED_STRIPE_ACCOUNT_ID',
});
we have completed step 2 already for the connect accounts
Yes you should be using that code on frontend if you are doing Direct Charges, regardless of whether you are using Apple Pay
If you are using React it will look slightly different
As it will involve loadStripe
we have this code:
const stripePromise = loadStripe('{{PLATFORM_PUBLISHABLE_KEY}}', {
stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
});
apple pay is still not showing. im thinking it may be something to do with the iframe
do you have any suggestions to debug this?
Ah I forgot that you mentioned iframe. Do you have the allow attribute set to "payment*"? We discuss this here: https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-testing
And are you testing over HTTPS?
this is the link we are testing - https://960b-80-103-73-233.eu.ngrok.io
Can you provide a PaymentIntent ID that you are testing with as well?
pi_3LtxwgJQIXbrDAWa0qWr1hBE
Okay so Apple Pay can only be tested when the domain is registered in livemode.
Looks like that Connected Account is connected only in testmode and the domain is registered in testmode
So you'll need to create or connect an account in livemode and then register the domain in live mode. Then you can use your test keys to test Apple Pay on that account
But the domain verification has to be done in livemode for this to work in test mode