Class: Unit::Payment::CreateBatchReleaseRequest
- Inherits:
-
Object
- Object
- Unit::Payment::CreateBatchReleaseRequest
- Defined in:
- lib/unit/models/payment/create_batch_release_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.
-
#batch_account_id ⇒ Object
readonly
Returns the value of attribute batch_account_id.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#idempotency_key ⇒ Object
readonly
Returns the value of attribute idempotency_key.
-
#sender_account_number ⇒ Object
readonly
Returns the value of attribute sender_account_number.
-
#sender_address ⇒ Object
readonly
Returns the value of attribute sender_address.
-
#sender_name ⇒ Object
readonly
Returns the value of attribute sender_name.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(account_id, batch_account_id, amount, description, sender_name, sender_address, sender_account_number, tags = nil, idempotency_key = nil) ⇒ CreateBatchReleaseRequest
constructor
A new instance of CreateBatchReleaseRequest.
- #to_hash ⇒ Object
Constructor Details
#initialize(account_id, batch_account_id, amount, description, sender_name, sender_address, sender_account_number, tags = nil, idempotency_key = nil) ⇒ CreateBatchReleaseRequest
Returns a new instance of CreateBatchReleaseRequest.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/unit/models/payment/create_batch_release_request.rb', line 20 def initialize(account_id, batch_account_id, amount, description, sender_name, sender_address, sender_account_number, = nil, idempotency_key = nil) @account_id = account_id @batch_account_id = batch_account_id @amount = amount @description = description @sender_name = sender_name @sender_address = sender_address @sender_account_number = sender_account_number @tags = @idempotency_key = idempotency_key end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/payment/create_batch_release_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/payment/create_batch_release_request.rb', line 8 def amount @amount end |
#batch_account_id ⇒ Object (readonly)
Returns the value of attribute batch_account_id.
8 9 10 |
# File 'lib/unit/models/payment/create_batch_release_request.rb', line 8 def batch_account_id @batch_account_id end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/unit/models/payment/create_batch_release_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/payment/create_batch_release_request.rb', line 8 def idempotency_key @idempotency_key end |
#sender_account_number ⇒ Object (readonly)
Returns the value of attribute sender_account_number.
8 9 10 |
# File 'lib/unit/models/payment/create_batch_release_request.rb', line 8 def sender_account_number @sender_account_number end |
#sender_address ⇒ Object (readonly)
Returns the value of attribute sender_address.
8 9 10 |
# File 'lib/unit/models/payment/create_batch_release_request.rb', line 8 def sender_address @sender_address end |
#sender_name ⇒ Object (readonly)
Returns the value of attribute sender_name.
8 9 10 |
# File 'lib/unit/models/payment/create_batch_release_request.rb', line 8 def sender_name @sender_name end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/payment/create_batch_release_request.rb', line 8 def @tags end |
Instance Method Details
#to_hash ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/unit/models/payment/create_batch_release_request.rb', line 32 def to_hash payload = { "type": "batchRelease", "attributes": { "amount": amount, "description": description, "senderName": sender_name, "senderAddress": sender_address&.represent, "senderAccountNumber": sender_account_number, "tags": , "idempotencyKey": idempotency_key }, "relationships": { "batchAccount": Unit::Types::Relationship.new("batchAccount", batch_account_id).to_hash, "receiver": Unit::Types::Relationship.new("depositAccount", account_id).to_hash } } payload[:attributes].compact! payload end |