Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Jonathon

Updating Credit Card Through Stripe

Recommended Posts

Hi Larry,

 

Just wondered if I could get your thoughts on the best way to offer a user to update a credit card with Stripe. I plan to let Stripe handle everything really. So I never touch or handle any credit card information. I'm going to be using subscriptions. Which is great using checkout, I let Checkout take the information, Stripe creates the customer and assigns them to my plan and bills them each interval.

 

But how then would you suggest is the most user friendly way to allow someone to edit card details?

 

Also, out of interest, what web hooks do you look for with your site or do you just send the whole webhook regardless what it is to yourself?

 

Jonathon

Share this post


Link to post
Share on other sites

Hey Jonathon, glad you're enjoying Stripe! This is a common enough issue. What you'd do is take the new CC info using Stripe.js or Checkout. Then you'd retrieve the customer from Stripe:

 

https://stripe.com/docs/api/php#retrieve_customer

 

Then you'd do an update, providing the new token as the card value:

 

https://stripe.com/docs/api/php#update_customer

 

This replaces the existing card on file with the new card. 

 

As for the web hooks, if you create a web hook script, Stripe sends every event notification there. It's then up to you to decide which ones matter and which ones don't. For subscriptions, the invoice.payment_succeeded event is most meaningful. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...