Rails Stripe Subscription tax_percent Injection | Fixed issues |
- Rails Stripe Subscription tax_percent Injection
- Select equality expressions in Rails
- Upgrading Dynamoid from 0.7 to 1.0
- Rails Stripe Gem - page needs to be refreshed before payment will process
- Configuring The Validations Of An Association
- LoadError enc/trans/single_byte.so
- Rspec: Testing registarion routing in rails with devise
- Ruby on Rails:Remove some elements in Strong parameters
- Rails routing sometimes confuses method for object ID
- Capistrano deploy failing on git:check
- How to show flash message of before_action filter authenticate_user! on a action which is called through ajax
- ActiveRecord::RecordNotDestroyed: Failed to destroy the record
- why do I need to re-initialize dropdown every time I render a partial having dropdown button for some options
- Empty Rails application - Memory not decreasing
- How to add/remove params to link with jquery
- Eager loaing with LEFT OUTER JOIN and multiple conditions in the ON clause
- Deploying rails app to heroku: Environment data not found in the schema
- Shrine gem - how to delete uploaded images from s3
- How to add a disabled submit button in rails
- Replication(master/slave) in Rails5
- Rails: Can't get mailer to work when I set credentials as environment variables
- rails has_one with multiple conditions
- foreign key rails, how to add?
- Installing Rails, failed to build native gem extensions (linked dll data/bss pass 0 failed)
- Request spec order dependent failure (wrong SQL created for devise user update on login)
- How to comment Multiple lines in rails 5 controller?
- Rails 4 form for multiple models
- Nested forms not storing data into database in rails 4
- how to enable cookies and js with typhoeus on heroku?
- Twilio Error : The From phone number +1******** is not a valid, SMS-capable inbound phone number or short code for your account
Rails Stripe Subscription tax_percent Injection Posted: 28 Jul 2016 07:59 AM PDT I'm looking for feedback on the best way to inject "tax_percent" into my app's Stripe subscription at checkout. Since I live in NJ, I need to determine if the subscription purchaser (current_user) also lives in NJ. Right now, I'm asking the user at checkout what state they live in and if they select NJ, I add in 7% sales tax through javascript call to update the displayed tax and order total. When the form is submitted and the subscription created, it's not passing in the tax_percent value as a subscription object since it's only a client-side function. So my challenge is getting that tax_percent injected into the subscription form so it gets submitted to Stripe's API and recorded with Stripe. I think I have a couple options and I was wondering what the best approach to this issue is.
At checkout I can essentially ask: But since this value can be changed by a savvy user, this might not be the best approach. How else can I set the :tax_percent more securely? Again, it only applies to NJ residents. If you don't live in NJ, tax_percent can be null. For some background, I was initially trying to figure out how to pass it in from the javascript math (Stripe and tax_percent in my Rails app) Thanks! |
Select equality expressions in Rails Posted: 28 Jul 2016 07:58 AM PDT I'm looking to select equality expressions in Rails, for simple possible-duplicate candidate detection. Given the fields I've tried to do this using ActiveRecord as well as Arel but it appears you can't alias equality expressions in Arel. I know this isn't the best performance method although I'm not expecting there to be enough records for the performance of this query to be an issue. Is there a way I can build this query using ActiveRecord or Arel without using raw SQL? |
Upgrading Dynamoid from 0.7 to 1.0 Posted: 28 Jul 2016 07:58 AM PDT I am getting the following error on migrating from Dynamoid 0.7 to 1.0. Error:
The error arises at the line : Can any one help me figure out the issue. |
Rails Stripe Gem - page needs to be refreshed before payment will process Posted: 28 Jul 2016 07:49 AM PDT I'm currently building an Events site using rails. I'm using the Stripe gem to process payments. Everything seems to be working fine other than whenever I want to make a payment (in test/development mode at present) I have to refresh the page and re-enter payment details before the payment will process. There's no error code coming up but it happens every time. What could be causing this? Here's the relevant code - bookings_controller.rb
Subscribe to:
Post Comments (Atom)
|
No comments:
Post a Comment