Module: Peddler::Notifications::TransactionUpdate

Defined in:
lib/peddler/notifications/transaction_update.rb,
lib/peddler/notifications/transaction_update/payload.rb,
lib/peddler/notifications/transaction_update/notification.rb,
lib/peddler/notifications/transaction_update/total_amount.rb,
lib/peddler/notifications/transaction_update/related_identifier.rb,
lib/peddler/notifications/transaction_update/selling_partner_metadata.rb,
lib/peddler/notifications/transaction_update/transaction_update_notification.rb

Overview

The root schema

The notification response schema that comprises the entire JSON document for the notification.

Constant Summary collapse

Payload =

Notification payload that wraps nested notification data

Structure.new do
  # @return [TransactionUpdateNotification]
  attribute(:transaction_update_notification, TransactionUpdateNotification, from: "TransactionUpdateNotification")
end
Notification =

The notification response schema that comprises the entire JSON document for the notification.

Structure.new do
  # @return [String] The time when this notification was published, presented in ISO-8601 date/time format.
  attribute(:event_time, String, from: "EventTime")

  # @return [Hash] The notification metadata.
  attribute(:notification_metadata, Hash, from: "NotificationMetadata")

  # @return [String] The type of this notification, used to differentiate different notifications. Combined with
  # payload version controls the structure of payload object.
  attribute(:notification_type, String, from: "NotificationType")

  # @return [String] The notification version.
  attribute(:notification_version, String, from: "NotificationVersion")

  # @return [Payload] The payload for this TRANSACTION_UPDATE notification. It's unique for different event type
  # and will provide more in-depth information about this notification.
  attribute(:payload, Payload, from: "Payload")

  # @return [String] The payload version of the notification.
  attribute(:payload_version, String, from: "PayloadVersion")
end
TotalAmount =

Total amount of transaction.

Structure.new do
  # @return [Float] Amount value of transaction.
  attribute(:currency_amount, Float, from: "CurrencyAmount")

  # @return [String] Currency code of transaction.
  attribute(:currency_code, String, from: "CurrencyCode")
end
RelatedIdentifier =

Related business identifier of the transaction.

Structure.new do
  # @return [String] Enumerated set of related business identifier names.
  attribute(:related_identifier_name, String, from: "RelatedIdentifierName")

  # @return [String] Corresponding value of RelatedIdentifierName
  attribute(:related_identifier_value, String, from: "RelatedIdentifierValue")
end
SellingPartnerMetadata =

Metadata describing the seller.

Structure.new do
  # @return [String] Account type of transaction.
  attribute(:account_type, String, from: "AccountType")

  # @return [String] Marketplace identifier of transaction.
  attribute(:marketplace_id, String, from: "MarketplaceId")

  # @return [String] Unique seller identifier.
  attribute(:selling_partner_id, String, from: "SellingPartnerId")
end
TransactionUpdateNotification =

Nested notification data

Structure.new do
  # @return [String] The date and time when the transaction was posted.
  attribute(:posted_date, String, from: "PostedDate")

  # @return [SellingPartnerMetadata]
  attribute(:selling_partner_metadata, SellingPartnerMetadata, from: "SellingPartnerMetadata")

  # @return [TotalAmount]
  attribute(:total_amount, TotalAmount, from: "TotalAmount")

  # @return [String] Type of transaction.
  attribute(:transaction_type, String, from: "TransactionType")

  # @return [Array<RelatedIdentifier>] Related business identifiers of the transaction.
  attribute?(:related_identifiers, [RelatedIdentifier], from: "RelatedIdentifiers")
end

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



12
13
14
# File 'lib/peddler/notifications/transaction_update.rb', line 12

def parse(hash)
  Notification.parse(hash)
end