andrewculver / koudoku

Robust subscription support for Rails with Stripe.
MIT License
1.16k stars 187 forks source link

How do I send tax_percent to Stripe's API in Koudoku #167

Closed JohnOHFS closed 8 years ago

JohnOHFS commented 8 years ago

Looking for help on how to hit Stripe's API with tax_percent using Koudoku. I've got my app running successfully selling subscriptions and I need to know where/how to send tax_percent through.

Thanks.

JohnOHFS commented 8 years ago

Figured it out with help from @pcboy. I added this method to my users.rb file:

def tax_percent(customer) home_state == 'NJ' ? 7 : 0 end

When users sign up for my site with devise, I record their home state in a home_state column in the users table. When they purchase a subscription, I check to see if they live in NJ and if they do, I charge them 7% sales tax.