#johan

1 messages ยท Page 1 of 1 (latest)

misty meteorBOT
final hollow
#

๐Ÿ‘‹ happy to help

#

to purchase a one time product and a subscription
do you mean at the same time?

frigid tulip
#

no my bad I mean separate

#

we want to allow customers to purchase one time products and also subscriptions using apple pay if they have any payment methods stored there

final hollow
#

the only difference for subscriptions is that instead of creating a PaymentIntent you would use the subscription's latest_invoice.payment_intent's client_secret

#

if the subscription has a 100% coupon or a free trial (e.g. the first invoice is 0) instead you need to use the pending_setup_intent on the subscription

frigid tulip
#

not sure what you mean in the second step? do I need to create the subscription first before attempting to charge them?

final hollow
frigid tulip
#

and where do I get the client_secret? does it come from, latest_invoice.payment_intent.client_secret?

#

what if the payment doesn't go through? we need to cancel the membership I assume, is there any documentation on how to properly handle this?

final hollow
frigid tulip
#

we actually got it working with creating a setupIntent in the server and using the clientSecret from the response to confirmApplePayment(clientSecret) and it works fine as well

#

is this method fine too?

final hollow
#

the reason why we don't recommend this is because it's confusing for customers

#

when you use SetupIntents the PaymentSheet will display 0 instead of the subscription's price

frigid tulip
#

yes you are right, we get that it displays 0 I assume is to confirm the payment method storage for future usage

#

and when it requires customer authentication it re asks them again to confirm

final hollow
#

which is 2 steps instead of 1

#

directly with the right amount

frigid tulip
#

please do not close the thread im just double checking the above in case I have more questions

tidal isle
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needed to step away. Yes that is correct, unless you wanted to allow your customer to try again with a different Payment Method, then you could reuse the existing Subscription I believe.

frigid tulip
#

perfect I understand. thanks so much for the help

tidal isle
#

Any time!

frigid tulip
#

what happens if we set 'Recurring' in paymentType, inside cartItems when presentingApplePay, say if we create a subscription will it charge the customer twice?

frigid tulip
tidal isle
#

Let me see what I can find.

frigid tulip
#

perfect thanks a lot, I just wanted to make sure before setting it to "Recurring" in case side effects happen

#

otherwise I can just leave it as "Immediate" all the time even if it's for subscriptions

tidal isle
frigid tulip
#

perfect thank you I will set it to immediate just in case

tidal isle
#

I need to step away soon and am closing this thread. If there is anything else that my teammates can assist with, then please let them know in #dev-help. ๐Ÿ‘‹

prisma zephyr