Class: Unit::Payment::BatchReleaseRequestBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/payment/batch_release_request_builder.rb

Instance Method Summary collapse

Constructor Details

#initializeBatchReleaseRequestBuilder

Returns a new instance of BatchReleaseRequestBuilder.



7
8
9
# File 'lib/unit/models/payment/batch_release_request_builder.rb', line 7

def initialize
  @requests = []
end

Instance Method Details

#add_request(account_id, batch_account_id, amount, description, sender_name, sender_address, sender_account_number, tags = nil, idempotency_key = nil) ⇒ Object



11
12
13
14
# File 'lib/unit/models/payment/batch_release_request_builder.rb', line 11

def add_request(, , amount, description, sender_name, sender_address, , tags = nil, idempotency_key = nil)
  request = Unit::Payment::CreateBatchReleaseRequest.new(, , amount, description, sender_name, sender_address, , tags, idempotency_key)
  @requests << request.to_hash
end

#to_hashObject



16
17
18
# File 'lib/unit/models/payment/batch_release_request_builder.rb', line 16

def to_hash
  { "data": @requests }
end