#bhanu365 - store card details

1 messages · Page 1 of 1 (latest)

hot widget
#

Hello, are you asking how to collect the card details and save them as a PaymentMethod? Or are you saving them already but not sure how to set it as the default for renewal payments?

keen sleet
#

@hot widget I just saved customer ID only, When I use a different card detail from testing cards like 4000000000000069 (Expired) then I am getting an error, Like "You haven't attached customer ID with source" or something like this.

#

I just want any customer can buy a plan and we can save card details and we will not show card form anymore if we have their card details and when their subscription plan ends so it can easily auto-renewal.

hot widget
#

Apologies for the delay. What call are you making when you get that error?

#

Is it on the subscription creation call?

#

Also can I ask why you are using tokens here to collect card data? That is workable but is considered a legacy integration path so we typically recommend against using it if you are starting to build you app now

keen sleet
#

Thanks for the recommendation. I'm not familier with the stripe. I have implimented the code in the chunks because I don't understand How can I build this functionality Can you please suggest me what can I do for this?

#

I have already wasted too much time of this

hot widget
#

Can you take a quick look over that and let me know if that looks like about what you are looking for?

keen sleet
#

Thanks, let me check

keen sleet
#

Is it "PaymentMethods" will use for the buy the subscription?

rotund vessel
#

👋 catching up on this as my teammate had to step away

keen sleet
#

These are our subscription. 1st one is not a plan.

rotund vessel
#

a PaymentMethod object will be created after a customer fills in their payment details in the Payment Element, and you call stripe.confirmPayment

#

that PaymentMethod will be attached to the customer you created in an earlier step. If you used payment_settings: {save_default_payment_method: 'on_subscription'} when creating the subscription, the PaymentMethod will be saved as the customer's default PaymentMethod and used for all future invoices tied to that subscription

keen sleet
#

clientSecret: '{{CLIENT_SECRET}}',

#

CLIENT_SECRET is client secret ID?

#

i have passed client secret ID but getting error

rotund vessel
keen sleet
#

"$stripe->subscriptions->create()"
I need to call this method when a user select any plan and after that we perform this API method ($stripe->subscriptions->create()) and then we call card element to show the form to the users and then we will get client secret ID from the "$stripe->subscriptions->create()" right?

rotund vessel