#aruljothi-apply-pay-sub

1 messages · Page 1 of 1 (latest)

hazy ivy
#

hello @torpid wraith, could you share what do you need help with?

torpid wraith
#

i need to create subscription for apple pay

#

i already spoke with support team 2 days before

#

they asked to attach payment method to the customer and create subscription

#

paymentRequest.on('paymentmethod', function(event) {
// event.paymentmethod is available
});

ev.paymentMethod.id

attach it to the customer: https://stripe.com/docs/api/payment_methods/attach

After that, i create a subscription for that customer: https://stripe.com/docs/api/subscriptions/create, and to used that payment method i just attached and passed default_payment_method parameter https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method

hazy ivy
#

alright, are you facing an issue?

torpid wraith
#

yes

#

one moment i will give issue

#

invalid_request_error
This PaymentMethod was previously used without being attached to a Customer or was detached from a Customer, and may not be used again.

#

this error fro subscrption creation

hazy ivy
#

if you don't attach the payment method to a customer, or if the payment method was detached, the payment method cannot be used again (i.e. it is single use only)

#

looks like what happened is that you created a PaymentIntent, collected the card details and confirmed the payment via stripe.js (Elements)

torpid wraith
#

we used the stripe.confirmCardPayment

#

we will check on this sir