SHARE
TWEET

Untitled

a guest Jun 15th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. config/initializers/stripe.rb :
  2.  
  3.  
  4. Stripe.api_key = Rails.application.secrets.stripe_private_key
  5. StripeEvent.signing_secret = Rails.application.secrets.stripe_webhook_secret
  6.  
  7. StripeEvent.configure do |config|
  8.   config.subscribe "charge." do |event|
  9.     Webhooks::Charge.new(event).call
  10.   end
  11. end
  12.  
  13. secrets.yml:
  14.  
  15. development:
  16. stripe_private_key: 'sk_test_*********'
  17. stripe_public_key: 'pk_test_**********'
  18. stripe_webhook_secret: 'whsec_**********'
  19.      
  20. production:
  21. stripe_private_key: 'sk_test_********'
  22. stripe_public_key: 'pk_test_*********'
  23. stripe_webhook_secret: 'whsec_*********'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top