Class: PaymentCalculator::Stripe
- Inherits:
-
Object
- Object
- PaymentCalculator::Stripe
- Defined in:
- app/models/piggybak_stripe/payment_calculator/stripe.rb
Constant Summary collapse
- KEYS =
['test_secret_key', 'test_publishable_key', 'live_secret_key', 'live_publishable_key']
- KLASS =
::Stripe
Instance Method Summary collapse
- #gateway_mode ⇒ Object
-
#initialize(payment_method) ⇒ Stripe
constructor
A new instance of Stripe.
- #publishable_key ⇒ Object
- #secret_key ⇒ Object
Constructor Details
#initialize(payment_method) ⇒ Stripe
Returns a new instance of Stripe.
10 11 12 |
# File 'app/models/piggybak_stripe/payment_calculator/stripe.rb', line 10 def initialize(payment_method) @payment_method = payment_method end |
Instance Method Details
#gateway_mode ⇒ Object
14 15 16 |
# File 'app/models/piggybak_stripe/payment_calculator/stripe.rb', line 14 def gateway_mode Piggybak.config.activemerchant_mode == :test ? "test" : "live" end |
#publishable_key ⇒ Object
22 23 24 |
# File 'app/models/piggybak_stripe/payment_calculator/stripe.rb', line 22 def publishable_key @payment_method.key_values["#{self.gateway_mode}_publishable_key".to_sym] end |
#secret_key ⇒ Object
18 19 20 |
# File 'app/models/piggybak_stripe/payment_calculator/stripe.rb', line 18 def secret_key @payment_method.key_values["#{self.gateway_mode}_secret_key".to_sym] end |