#jm-apple-pay-setup

1 messages · Page 1 of 1 (latest)

ancient epoch
#

Hi there 👋 just to clarify, you want Apple Pay to be only payment method accepted for a setup intent?

round ermine
#

Card, Google Pay or Apple Pay
I got it working with card, and now I am setting up the request payment button, but I wasn't sure if it will behave the same for wallets

#

This is for a subscription, and I want to let the customer update their payment method in between billing cycle, that's why I suppose I need to use the setup intent instead of the payment intent

ancient epoch
#

Gotcha, it'll work the same for wallets. Wallet payment methods are essentially card payment methods.

round ermine
#

Great

north jasper
#

You can use Apple Pay tokens to create one-off payments or subscriptions
This means that you can either use Apple Pay for on session payments (when the user is actually at their computer) or can charge them off session with our subscriptions

#

I am not immediately sure on the token aspect, can look in to that.

#

Are you clear on how to save an Apple Pay card via a SetupIntent?

round ermine
#

Yeah, as long as it is the same as with cards, but it won't hurt some guidance, this is what I am doing

  • Create setup intent and send it to the frontend
  • Create card element in frontend
  • use confirmCardSetup from Elements with the client secret from the setup intent
  • Send the confirmed payment method id and customer id to the backend, so it can attach the payment method to the customer and save that method as their default for invoices
north jasper
#

So you would follow the flow from that doc but with a setupintent

#

And also when you create the payment request on the client side, you pass an amount of 0

  country: 'US',
  currency: 'usd',
  total: {
    label: 'Demo total',
    amount: 0,
  },
  requestPayerName: true,
  requestPayerEmail: true,
});```