#mhdev

1 messages · Page 1 of 1 (latest)

tidal doveBOT
worldly forge
#

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

dense estuary
worldly forge
#

Ah okay so you are using Payment Element

#

You just need to verify your domain here for Apple Pay to show up

dense estuary
#

we are using this: <PaymentElement id="payment-element" />
can you confirm this is payment element?

worldly forge
#

Yep that is Payment Element

dense estuary
#

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?

worldly forge
#

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

dense estuary
#

and if this is for connect customers within our platform?

worldly forge
#

Are you creating Direct charges?

#

Or using Destination Charges?

dense estuary
#

direct charges

#

we are using an iframe

#

and we have added the route domain using the api

worldly forge
#

Okay so with Direct Charges this means that you do have to register the domain on each Connected Account.

dense estuary
#

we have done that

dense estuary
#

using the api

worldly forge
#

Okay then yes it should just work

dense estuary
#

so we do need the payment request button?

worldly forge
#

No you do not if you are using Payment Element

dense estuary
#

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}}',
});

worldly forge
#

Yep

dense estuary
#

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?

worldly forge
#

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

dense estuary
#

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

worldly forge
#

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

dense estuary
#

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?

worldly forge
#

And are you testing over HTTPS?

dense estuary
worldly forge
#

Can you provide a PaymentIntent ID that you are testing with as well?

dense estuary
#

pi_3LtxwgJQIXbrDAWa0qWr1hBE

worldly forge
#

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