Class: Unit::RecurringPayment::CreateRecurringCreditAchPaymentRequest
- Inherits:
-
Object
- Object
- Unit::RecurringPayment::CreateRecurringCreditAchPaymentRequest
- Defined in:
- lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#addenda ⇒ Object
readonly
Returns the value of attribute addenda.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#counterparty_id ⇒ Object
readonly
Returns the value of attribute counterparty_id.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#idempotency_key ⇒ Object
readonly
Returns the value of attribute idempotency_key.
-
#schedule ⇒ Object
readonly
Returns the value of attribute schedule.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(account_id, counterparty_id, amount, description, schedule, addenda = nil, idempotency_key = nil, tags = nil) ⇒ CreateRecurringCreditAchPaymentRequest
constructor
A new instance of CreateRecurringCreditAchPaymentRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(account_id, counterparty_id, amount, description, schedule, addenda = nil, idempotency_key = nil, tags = nil) ⇒ CreateRecurringCreditAchPaymentRequest
Returns a new instance of CreateRecurringCreditAchPaymentRequest.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb', line 18 def initialize(account_id, counterparty_id, amount, description, schedule, addenda = nil, idempotency_key = nil, = nil) @account_id = account_id @counterparty_id = counterparty_id @amount = amount @description = description @addenda = addenda @schedule = schedule @idempotency_key = idempotency_key @tags = end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb', line 8 def account_id @account_id end |
#addenda ⇒ Object (readonly)
Returns the value of attribute addenda.
8 9 10 |
# File 'lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb', line 8 def addenda @addenda end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
8 9 10 |
# File 'lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb', line 8 def amount @amount end |
#counterparty_id ⇒ Object (readonly)
Returns the value of attribute counterparty_id.
8 9 10 |
# File 'lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb', line 8 def counterparty_id @counterparty_id end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/unit/models/recurring_payment/create_recurring_credit_ach_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/recurring_payment/create_recurring_credit_ach_payment_request.rb', line 8 def idempotency_key @idempotency_key end |
#schedule ⇒ Object (readonly)
Returns the value of attribute schedule.
8 9 10 |
# File 'lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb', line 8 def schedule @schedule end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb', line 8 def @tags end |
Instance Method Details
#to_json_api ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb', line 29 def to_json_api payload = { "data": { "type": "recurringCreditAchPayment", "attributes": { "amount": amount, "description": description, "addenda": addenda, "schedule": schedule&.represent, "idempotencyKey": idempotency_key, "tags": }, "relationships": { account: Unit::Types::Relationship.new("depositAccount", account_id).to_hash, counterparty: Unit::Types::Relationship.new("counterparty", counterparty_id).to_hash } } } payload[:data][:attributes].compact! payload.to_json end |