summaryrefslogtreecommitdiff
path: root/lib/solidus_subscriptions/churn_buster/order_serializer.rb
blob: 5bc5dee7ea29f88a34512eb7cbae738eeabc24af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module SolidusSubscriptions
  module ChurnBuster
    class OrderSerializer < Serializer
      def to_h
        {
          payment: {
            source: 'in_house',
            source_id: object.number,
            amount_in_cents: object.display_total.cents,
            currency: object.currency,
          },
          customer: SubscriptionCustomerSerializer.serialize(object.subscription),
        }
      end
    end
  end
end