Module: RubyNative::IAP::Normalizable

Included in:
AppleWebhookProcessor
Defined in:
lib/ruby_native/iap/normalizable.rb

Constant Summary collapse

TYPE_MAPPING =
{
  "SUBSCRIBED" => "subscription.created",
  "DID_RENEW" => "subscription.updated",
  "DID_CHANGE_RENEWAL_STATUS" => {
    "AUTO_RENEW_DISABLED" => "subscription.canceled",
    "AUTO_RENEW_ENABLED" => "subscription.updated"
  },
  "DID_CHANGE_RENEWAL_INFO" => {
    "UPGRADE" => "subscription.updated",
    "DOWNGRADE" => "subscription.updated"
  },
  "EXPIRED" => "subscription.expired",
  "DID_FAIL_TO_RENEW" => "subscription.updated",
  "GRACE_PERIOD_EXPIRED" => "subscription.expired",
  "REFUND" => "subscription.expired"
}.freeze
STATUS_MAPPING =
{
  "subscription.created" => "active",
  "subscription.updated" => "active",
  "subscription.canceled" => "active",
  "subscription.expired" => "expired"
}.freeze