diff options
author | Alessandro Desantis <desa.alessandro@gmail.com> | 2020-10-09 14:05:43 +0200 |
---|---|---|
committer | Alessandro Desantis <desa.alessandro@gmail.com> | 2020-10-09 14:09:01 +0200 |
commit | 5a5b2a3201462532f4fa9d38e02867a243c68670 (patch) | |
tree | 004eedfd40d8405f1bd3390d3fa983e0cfe02830 /lib/solidus_subscriptions/churn_buster/order_serializer.rb | |
parent | d7369ba04b3657e47e21e6d24af516886ef0dbc4 (diff) |
Implement Churn Buster API client
Diffstat (limited to 'lib/solidus_subscriptions/churn_buster/order_serializer.rb')
-rw-r--r-- | lib/solidus_subscriptions/churn_buster/order_serializer.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/solidus_subscriptions/churn_buster/order_serializer.rb b/lib/solidus_subscriptions/churn_buster/order_serializer.rb new file mode 100644 index 0000000..5bc5dee --- /dev/null +++ b/lib/solidus_subscriptions/churn_buster/order_serializer.rb @@ -0,0 +1,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 |