Module: Pay::Stripe::Charge
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/pay/stripe/charge.rb
Instance Method Summary collapse
Instance Method Details
#stripe? ⇒ Boolean
6 7 8 |
# File 'lib/pay/stripe/charge.rb', line 6 def stripe? processor == "stripe" end |
#stripe_charge ⇒ Object
10 11 12 13 14 |
# File 'lib/pay/stripe/charge.rb', line 10 def stripe_charge ::Stripe::Charge.retrieve(processor_id) rescue ::Stripe::StripeError => e raise Error, e. end |
#stripe_refund!(amount_to_refund) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pay/stripe/charge.rb', line 16 def stripe_refund!(amount_to_refund) ::Stripe::Refund.create( charge: processor_id, amount: amount_to_refund ) update(amount_refunded: amount_to_refund) rescue ::Stripe::StripeError => e raise Error, e. end |