Class: ForestLiana::StripePaymentRefunder
- Inherits:
-
Object
- Object
- ForestLiana::StripePaymentRefunder
- Defined in:
- app/services/forest_liana/stripe_payment_refunder.rb
Instance Method Summary collapse
-
#initialize(params) ⇒ StripePaymentRefunder
constructor
A new instance of StripePaymentRefunder.
- #perform ⇒ Object
Constructor Details
#initialize(params) ⇒ StripePaymentRefunder
Returns a new instance of StripePaymentRefunder.
3 4 5 6 |
# File 'app/services/forest_liana/stripe_payment_refunder.rb', line 3 def initialize(params) @params = params Stripe.api_key = ForestLiana.integrations[:stripe][:api_key] end |
Instance Method Details
#perform ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'app/services/forest_liana/stripe_payment_refunder.rb', line 8 def perform return unless @params[:data][:attributes][:ids] @params[:data][:attributes][:ids].each do |id| ch = ::Stripe::Charge.retrieve(id) ch.refunds.create end end |