Class: Unit::CheckPayment::OriginateCheckPaymentRequest
- Inherits:
-
Object
- Object
- Unit::CheckPayment::OriginateCheckPaymentRequest
- Defined in:
- lib/unit/models/check_payment/originate_check_payment_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#counterparty ⇒ Object
readonly
Returns the value of attribute counterparty.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#customer_type ⇒ Object
readonly
Returns the value of attribute customer_type.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#idempotency_key ⇒ Object
readonly
Returns the value of attribute idempotency_key.
-
#memo ⇒ Object
readonly
Returns the value of attribute memo.
-
#send_date ⇒ Object
readonly
Returns the value of attribute send_date.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(account_id, customer_id, customer_type, amount, counterparty, description, idempotency_key, memo, send_date, tags = nil) ⇒ OriginateCheckPaymentRequest
constructor
A new instance of OriginateCheckPaymentRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(account_id, customer_id, customer_type, amount, counterparty, description, idempotency_key, memo, send_date, tags = nil) ⇒ OriginateCheckPaymentRequest
Returns a new instance of OriginateCheckPaymentRequest.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 20 def initialize(account_id, customer_id, customer_type, amount, counterparty, description, idempotency_key, memo, send_date, = nil) @account_id = account_id @customer_id = customer_id @customer_type = customer_type @amount = amount @counterparty = counterparty @description = description @idempotency_key = idempotency_key @memo = memo @send_date = send_date @tags = end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def account_id @account_id end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def amount @amount end |
#counterparty ⇒ Object (readonly)
Returns the value of attribute counterparty.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def counterparty @counterparty end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def customer_id @customer_id end |
#customer_type ⇒ Object (readonly)
Returns the value of attribute customer_type.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def customer_type @customer_type end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def description @description end |
#idempotency_key ⇒ Object (readonly)
Returns the value of attribute idempotency_key.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def idempotency_key @idempotency_key end |
#memo ⇒ Object (readonly)
Returns the value of attribute memo.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def memo @memo end |
#send_date ⇒ Object (readonly)
Returns the value of attribute send_date.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def send_date @send_date end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 8 def @tags end |
Instance Method Details
#to_json_api ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/unit/models/check_payment/originate_check_payment_request.rb', line 33 def to_json_api payload = { "data": { "type": "checkPayment", "attributes": { "amount": amount, "counterparty": counterparty.represent, "description": description, "memo": memo, "sendDate": send_date, "idempotencyKey": idempotency_key, "tags": }, "relationships": { "account": Unit::Types::Relationship.new("depositAccount", account_id).to_hash, "customer": Unit::Types::Relationship.new(customer_type, customer_id).to_hash } } } payload[:data][:attributes].compact! payload.to_json end |