Class: Unit::Payment::CreateWithPlaidTokenRequest
- Inherits:
-
Object
- Object
- Unit::Payment::CreateWithPlaidTokenRequest
- Defined in:
- lib/unit/models/payment/create_with_plaid_token_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_name ⇒ Object
readonly
Returns the value of attribute counterparty_name.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#idempotency_key ⇒ Object
readonly
Returns the value of attribute idempotency_key.
-
#plaid_processor_token ⇒ Object
readonly
Returns the value of attribute plaid_processor_token.
-
#same_day ⇒ Object
readonly
Returns the value of attribute same_day.
-
#sec_code ⇒ Object
readonly
Returns the value of attribute sec_code.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#verify_counterparty_balance ⇒ Object
readonly
Returns the value of attribute verify_counterparty_balance.
Instance Method Summary collapse
- #change_attributes ⇒ Object
-
#initialize(account_id:, amount:, direction:, description:, plaid_processor_token:, addenda: nil, idempotency_key: nil, counterparty_name: nil, tags: nil, verify_counterparty_balance: nil, same_day: nil, sec_code: nil) ⇒ CreateWithPlaidTokenRequest
constructor
A new instance of CreateWithPlaidTokenRequest.
- #to_hash ⇒ Object
- #to_json_api ⇒ Object
Constructor Details
#initialize(account_id:, amount:, direction:, description:, plaid_processor_token:, addenda: nil, idempotency_key: nil, counterparty_name: nil, tags: nil, verify_counterparty_balance: nil, same_day: nil, sec_code: nil) ⇒ CreateWithPlaidTokenRequest
Returns a new instance of CreateWithPlaidTokenRequest.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 25 def initialize(account_id:, amount:, direction:, description:, plaid_processor_token:, addenda: nil, idempotency_key: nil, counterparty_name: nil, tags: nil, verify_counterparty_balance: nil, same_day: nil, sec_code: nil) @account_id = account_id @amount = amount @direction = direction @description = description @plaid_processor_token = plaid_processor_token @addenda = addenda @idempotency_key = idempotency_key @counterparty_name = counterparty_name @tags = @verify_counterparty_balance = verify_counterparty_balance @same_day = same_day @sec_code = sec_code end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_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/payment/create_with_plaid_token_request.rb', line 8 def addenda @addenda end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def amount @amount end |
#counterparty_name ⇒ Object (readonly)
Returns the value of attribute counterparty_name.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def counterparty_name @counterparty_name end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def description @description end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def direction @direction end |
#idempotency_key ⇒ Object (readonly)
Returns the value of attribute idempotency_key.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def idempotency_key @idempotency_key end |
#plaid_processor_token ⇒ Object (readonly)
Returns the value of attribute plaid_processor_token.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def plaid_processor_token @plaid_processor_token end |
#same_day ⇒ Object (readonly)
Returns the value of attribute same_day.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def same_day @same_day end |
#sec_code ⇒ Object (readonly)
Returns the value of attribute sec_code.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def sec_code @sec_code end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def @tags end |
#verify_counterparty_balance ⇒ Object (readonly)
Returns the value of attribute verify_counterparty_balance.
8 9 10 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 8 def verify_counterparty_balance @verify_counterparty_balance end |
Instance Method Details
#change_attributes ⇒ Object
72 73 74 75 76 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 72 def change_attributes payload = to_hash payload[:attributes].compact! payload end |
#to_hash ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 50 def to_hash { "type": "achPayment", "attributes": { amount: amount, direction: direction, description: description, plaidProcessorToken: plaid_processor_token, addenda: addenda, idempotencyKey: idempotency_key, counterpartyName: counterparty_name, tags: , verifyCounterpartyBalance: verify_counterparty_balance, sameDay: same_day, secCode: sec_code }, "relationships": { "account": Unit::Types::Relationship.new("account", account_id).to_hash } } end |
#to_json_api ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/unit/models/payment/create_with_plaid_token_request.rb', line 42 def to_json_api payload = { "data": to_hash } payload[:data][:attributes].compact! payload.to_json end |