So I've got my rails app selling subscriptions to access content. I'm temporarily inserting a hidden field in the check-out form to pass tax_percent to Stripe's API, but it keeps showing up in the Stripe dashboard as null. The tax is only for NJ and is a straight 7% if the buyer is also in NJ. I'm calculating the sales tax via a javascript call (Calculating Sales Tax for a US State in Javascript), which then pushes the value to the subscription#create action. Except it ain't working.
Here's what the line looks like in the form:
<input type="hidden" id="tax_percent" name="tax_percent">
<%= f.hidden_field :plan_id %>
Yes, I need to build a Ruby method to calculate this on the server side, but for now, this is fine.
Here's what shows up in the logs:
Processing by Koudoku::SubscriptionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"TokenValueHere", "tax_percent"=>"7", "subscription"=>{"plan_id"=>"5", "credit_card_token"=>"OtherTokenValue", "last_four"=>"undefined", "card_type"=>"undefined"}, "owner_id"=>"72"}
So you see that tax_percent appears to be outside the subscription object, yet plan_id is not, but they're right next to each other in the checkout form.
How do I get this tax_percent to hit the Stripe API properly??