Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  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_*********'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement