#_har.ie
1 messages · Page 1 of 1 (latest)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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.
You should use a setupintent instead: https://stripe.com/docs/payments/save-and-reuse
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.
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?
👋 stepping in here
You can't use a PaymentIntent for a $0 authorization
Only a SetupIntent
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?
Are you then calling confirmPlatformPayPayment()?
no, the payment is resolved automatically in the same request, we use the confirm param to do this
Hmm createPlatformPayPaymentMethod() doesn't have a confirm param?
Can you show me your code here?
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.
Ah okay yeah
Then instead if you are just saving the PaymentMethod you confirm a SetupIntent instead of a PaymentIntent in your backend
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$?
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
Great, thank you so much you have been immensely helpful.