Class: SolidusStripe::Webhook::ChargeSubscriber

Inherits:
Object
  • Object
show all
Includes:
Omnes::Subscriber, MoneyToStripeAmountConverter
Defined in:
app/subscribers/solidus_stripe/webhook/charge_subscriber.rb

Overview

Handlers for Stripe charge events.

Constant Summary

Constants included from MoneyToStripeAmountConverter

MoneyToStripeAmountConverter::DIVISIBLE_BY_100, MoneyToStripeAmountConverter::THREE_DECIMAL_CURRENCIES, MoneyToStripeAmountConverter::ZERO_DECIMAL_CURRENCIES

Instance Method Summary collapse

Methods included from MoneyToStripeAmountConverter

#solidus_decimal_to_subunit, #solidus_subunit_to_decimal, #to_solidus_amount, #to_stripe_amount

Instance Method Details

#sync_refunds(event) ⇒ Object

Syncs Stripe refunds with Solidus refunds.

Parameters:

See Also:



18
19
20
21
22
23
24
25
# File 'app/subscribers/solidus_stripe/webhook/charge_subscriber.rb', line 18

def sync_refunds(event)
  payment_method = event.payment_method
  stripe_payment_intent_id = event.data.object.payment_intent

  RefundsSynchronizer
    .new(payment_method)
    .call(stripe_payment_intent_id)
end