Class: SolidusBolt::Handlers::CreditHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- SolidusBolt::Handlers::CreditHandler
- Defined in:
- app/webhooks/solidus_bolt/handlers/credit_handler.rb
Instance Attribute Summary
Attributes inherited from BaseHandler
Instance Method Summary collapse
Methods inherited from BaseHandler
Constructor Details
This class inherits a constructor from SolidusBolt::Handlers::BaseHandler
Instance Method Details
#call ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'app/webhooks/solidus_bolt/handlers/credit_handler.rb', line 6 def call payment_response_code = params[:data][:source_transaction][:reference] source_payment = Spree::Payment.find_by(response_code: payment_response_code) amount = params[:data][:requested_refund_amount][:amount].to_i refund_transaction_id = params[:data][:reference] SolidusBolt::Payments::CreditSyncService.call( payment: source_payment, amount: amount, transaction_id: refund_transaction_id ) end |