#_har.ie

1 messages · Page 1 of 1 (latest)

brave cedarBOT
late helm
shrewd ingot
#

Thank you, given this scenario, how would you approach my issue:

  • A user creates a reservation with credit, meaning the amount is = $0
  • The apple pay payment sheet is presented and reservation is made
  • After the reservation is made, they wish to have it renew automatically - using the same card stored in the apple wallet.

Expected:

  • User creates a reservation with apple pay for $0 and enables 'auto-renew' on the reservation, when the reservation renews, it should use the same card from apple wallet

Actual:

  • As the amount is $0, the payment intent is not getting created and therefore the card is not being set up for future use with the 'off_session' param. When attempting renewal for reservation, there is no payment method attached to the customer and renewal will fail.
late helm
brave cedarBOT
late helm
#

After the reservation is made, they wish to have it renew automatically - using the same card stored in the apple wallet.
Are you currently using your own subscription logic to create payment intents to achieve this? Curious why you mentioned creating payment intents earlier. It sounds like our Subscriptions might actually be the best path forward for you.

shrewd ingot
#

Correct we are using our own logic, when a user wants to auto-renew, a separate payment intent is created which confirms itself at a specific date-time

#

Renewals work when using a card but fail when trying to use apple pay, so not sure if implementing subscriptions are needed. I just need to make sure the card is always attached to a customer when a reservation is made - even if the amount is $0.

#

I am looking into SetupIntent now, would it be possible to do this within the same request that handles the payment intent?

tough kestrel
#

👋 stepping in here

#

You can't use a PaymentIntent for a $0 authorization

#

Only a SetupIntent

shrewd ingot
#

So SetupIntent returns a client secret - but I am using 'createPlatformPayPaymentMethod' which does not take a client secret. Do I need to make use of the client secret in order to attach a card to a customer?

tough kestrel
#

Are you then calling confirmPlatformPayPayment()?

shrewd ingot
#

no, the payment is resolved automatically in the same request, we use the confirm param to do this

tough kestrel
#

Hmm createPlatformPayPaymentMethod() doesn't have a confirm param?

#

Can you show me your code here?

shrewd ingot
#

sorry I misunderstood, here is createPlatformPayPaymentMethod:

const res = await createPlatformPayPaymentMethod({
  applePay: {
    cartItems: [
      {
        label: 'Zark Parking',
        amount: reservationTotal,
  paymentType:PlatformPay.PaymentType.Immediate,
       },
     ],
     merchantCountryCode: 'US',
     currencyCode: 'USD',
    },
  });

We then collect the payment method ID from the response and use it to confirm the payment intent on our backend.

tough kestrel
#

Ah okay yeah

#

Then instead if you are just saving the PaymentMethod you confirm a SetupIntent instead of a PaymentIntent in your backend

shrewd ingot
#

Okay so I if I migrate off PaymentIntent and use SetupIntent, I shouldn't need to use the client secret and I can create the intent for 0$?

tough kestrel
#

You don't pass an amount at all with a SetupIntent

#

They are always $0 really

shrewd ingot
#

Okay got you, so I only really want to use setup intent in the event the amount is $0, otherwise use PaymentIntent

#

Apologies for so much back and forth

tough kestrel
#

No worries at all

#

And yep, you got it

shrewd ingot
#

Great, thank you so much you have been immensely helpful.