Class: Blockchain0x::Resources::PaymentCreateBody
- Inherits:
-
Struct
- Object
- Struct
- Blockchain0x::Resources::PaymentCreateBody
- Defined in:
- lib/blockchain0x/resources/payments.rb
Overview
PaymentCreateBody is the typed body for POST /v1/payments. Snake_case on the Ruby side; camelCase on the wire (via ‘#to_h_wire`). Mirrors the Python PaymentCreateBody dataclass + Go PaymentCreateRequest struct.
Instance Attribute Summary collapse
-
#agent_id ⇒ Object
Returns the value of attribute agent_id.
-
#amount_wei ⇒ Object
Returns the value of attribute amount_wei.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#to ⇒ Object
Returns the value of attribute to.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(agent_id:, to:, amount_wei:, token: nil, metadata: nil) ⇒ PaymentCreateBody
constructor
A new instance of PaymentCreateBody.
- #to_h_wire ⇒ Object
Constructor Details
#initialize(agent_id:, to:, amount_wei:, token: nil, metadata: nil) ⇒ PaymentCreateBody
Returns a new instance of PaymentCreateBody.
33 34 35 |
# File 'lib/blockchain0x/resources/payments.rb', line 33 def initialize(agent_id:, to:, amount_wei:, token: nil, metadata: nil) super end |
Instance Attribute Details
#agent_id ⇒ Object
Returns the value of attribute agent_id
25 26 27 |
# File 'lib/blockchain0x/resources/payments.rb', line 25 def agent_id @agent_id end |
#amount_wei ⇒ Object
Returns the value of attribute amount_wei
25 26 27 |
# File 'lib/blockchain0x/resources/payments.rb', line 25 def amount_wei @amount_wei end |
#metadata ⇒ Object
Returns the value of attribute metadata
25 26 27 |
# File 'lib/blockchain0x/resources/payments.rb', line 25 def @metadata end |
#to ⇒ Object
Returns the value of attribute to
25 26 27 |
# File 'lib/blockchain0x/resources/payments.rb', line 25 def to @to end |
#token ⇒ Object
Returns the value of attribute token
25 26 27 |
# File 'lib/blockchain0x/resources/payments.rb', line 25 def token @token end |
Instance Method Details
#to_h_wire ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/blockchain0x/resources/payments.rb', line 37 def to_h_wire h = { 'agentId' => agent_id, 'to' => to, 'amountWei' => amount_wei, } h['token'] = token unless token.nil? h['metadata'] = .to_h unless .nil? h end |