Class: Smartpay::Requests::Order
- Inherits:
-
Object
- Object
- Smartpay::Requests::Order
- Includes:
- Normalizer, Validator
- Defined in:
- lib/smartpay/requests/order.rb
Overview
Request Object to create a CheckoutSession for order
Constant Summary collapse
- REQUIREMENT_KEY_NAME =
%i[token customerInfo shippingInfo currency items].freeze
Constants included from Normalizer
Instance Attribute Summary collapse
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
- #as_hash ⇒ Object
-
#initialize(raw_payload) ⇒ Order
constructor
A new instance of Order.
Constructor Details
#initialize(raw_payload) ⇒ Order
Returns a new instance of Order.
17 18 19 |
# File 'lib/smartpay/requests/order.rb', line 17 def initialize(raw_payload) @payload = raw_payload.transform_keys(&:to_sym) end |
Instance Attribute Details
#payload ⇒ Object
Returns the value of attribute payload.
13 14 15 |
# File 'lib/smartpay/requests/order.rb', line 13 def payload @payload end |
Instance Method Details
#as_hash ⇒ Object
21 22 23 24 |
# File 'lib/smartpay/requests/order.rb', line 21 def as_hash check_requirement!(REQUIREMENT_KEY_NAME) normalize_payload end |