Class: Unit::Counterparty::CreateWithPlaidTokenRequest
- Inherits:
-
Object
- Object
- Unit::Counterparty::CreateWithPlaidTokenRequest
- Defined in:
- lib/unit/models/counterparty/create_with_plaid_token_request.rb
Instance Attribute Summary collapse
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#idempotency_key ⇒ Object
readonly
Returns the value of attribute idempotency_key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#permissions ⇒ Object
readonly
Returns the value of attribute permissions.
-
#plaid_processor_token ⇒ Object
readonly
Returns the value of attribute plaid_processor_token.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#verify_name ⇒ Object
readonly
Returns the value of attribute verify_name.
Instance Method Summary collapse
-
#initialize(customer_id, type, name, plaid_processor_token, verify_name = nil, permissions = nil, tags = nil, idempotency_key = nil) ⇒ CreateWithPlaidTokenRequest
constructor
A new instance of CreateWithPlaidTokenRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(customer_id, type, name, plaid_processor_token, verify_name = nil, permissions = nil, tags = nil, idempotency_key = nil) ⇒ CreateWithPlaidTokenRequest
Returns a new instance of CreateWithPlaidTokenRequest.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 19 def initialize(customer_id, type, name, plaid_processor_token, verify_name = nil, = nil, = nil, idempotency_key = nil) @customer_id = customer_id @type = type @name = name @plaid_processor_token = plaid_processor_token @verify_name = verify_name @permissions = @tags = @idempotency_key = idempotency_key end |
Instance Attribute Details
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 8 def customer_id @customer_id end |
#idempotency_key ⇒ Object (readonly)
Returns the value of attribute idempotency_key.
8 9 10 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 8 def idempotency_key @idempotency_key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 8 def name @name end |
#permissions ⇒ Object (readonly)
Returns the value of attribute permissions.
8 9 10 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 8 def @permissions end |
#plaid_processor_token ⇒ Object (readonly)
Returns the value of attribute plaid_processor_token.
8 9 10 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 8 def plaid_processor_token @plaid_processor_token end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 8 def @tags end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 8 def type @type end |
#verify_name ⇒ Object (readonly)
Returns the value of attribute verify_name.
8 9 10 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 8 def verify_name @verify_name end |
Instance Method Details
#to_json_api ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/unit/models/counterparty/create_with_plaid_token_request.rb', line 30 def to_json_api payload = { "data": { "type": "achCounterparty", "attributes": { type: type, name: name, plaidProcessorToken: plaid_processor_token, verifyName: verify_name, permissions: , tags: , idempotencyKey: idempotency_key }, "relationships": { customer: Unit::Types::Relationship.new("customer", customer_id).to_hash } } } payload[:data][:attributes].compact! payload.to_json end |