Ask A Question


You’re not receiving notifications from this thread.

Passing name objects to Stripe

Charles Smith asked in Rails

Hi Chris

A few months ago I purchased the Stripe master class - awsome - learned a lot!! I could ask this question on Stack Overflow, but since the methods are specific to the course, I thought it be best asked here.

In the user.rb file, there is the method listed below that creates a Stripe customer is one doesn't exist.

def stripe_customer
    if stripe_id?
      stripe_customer = Stripe::Customer.create(email: email)

Stripe has a customer name field, how can I pass the user_first and user_last along with the email when creating a new customer? I looked on the Stripe api and it doesn't make reference at all to a name object.

Thank you.


Hey Charles,

I'm pretty sure you want the description attribute and you can pass the user's name in there.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,453+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.