Class: ModernTreasury::CounterpartyCollectAccountRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::CounterpartyCollectAccountRequest
- Defined in:
- lib/modern_treasury/models/counterparty_collect_account_request.rb
Overview
CounterpartyCollectAccountRequest Model.
Instance Attribute Summary collapse
-
#custom_redirect ⇒ String
The URL you want your customer to visit upon filling out the form.
-
#direction ⇒ Direction
One of ‘credit` or `debit`.
-
#fields ⇒ Array[Field]
The list of fields you want on the form.
-
#send_email ⇒ TrueClass | FalseClass
By default, Modern Treasury will send an email to your counterparty that includes a link to the form they must fill out.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(direction:, send_email: SKIP, fields: SKIP, custom_redirect: SKIP, additional_properties: nil) ⇒ CounterpartyCollectAccountRequest
constructor
A new instance of CounterpartyCollectAccountRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(direction:, send_email: SKIP, fields: SKIP, custom_redirect: SKIP, additional_properties: nil) ⇒ CounterpartyCollectAccountRequest
Returns a new instance of CounterpartyCollectAccountRequest.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 64 def initialize(direction:, send_email: SKIP, fields: SKIP, custom_redirect: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @direction = direction @send_email = send_email unless send_email == SKIP @fields = fields unless fields == SKIP @custom_redirect = custom_redirect unless custom_redirect == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#custom_redirect ⇒ String
The URL you want your customer to visit upon filling out the form. By default, they will be sent to a Modern Treasury landing page. This must be a valid HTTPS URL if set.
38 39 40 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 38 def custom_redirect @custom_redirect end |
#direction ⇒ Direction
One of ‘credit` or `debit`. Use `credit` when you want to pay a counterparty. Use `debit` when you need to charge a counterparty. This field helps us send a more tailored email to your counterparties.“
16 17 18 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 16 def direction @direction end |
#fields ⇒ Array[Field]
The list of fields you want on the form. This field is optional and if it is not set, will default to ["nameOnAccount", "accountType", "accountNumber", "routingNumber", "address"]. The full list of options is ["name", "nameOnAccount", "taxpayerIdentifier", "accountType", "accountNumber", "routingNumber", "address", "ibanNumber", "swiftCode"].
32 33 34 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 32 def fields @fields end |
#send_email ⇒ TrueClass | FalseClass
By default, Modern Treasury will send an email to your counterparty that includes a link to the form they must fill out. However, if you would like to send the counterparty the link, you can set this parameter to ‘false`. The JSON body will include the link to the secure Modern Treasury form.
23 24 25 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 23 def send_email @send_email end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 77 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. direction = hash.key?('direction') ? hash['direction'] : nil send_email = hash.key?('send_email') ? hash['send_email'] : SKIP fields = hash.key?('fields') ? hash['fields'] : SKIP custom_redirect = hash.key?('custom_redirect') ? hash['custom_redirect'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. CounterpartyCollectAccountRequest.new(direction: direction, send_email: send_email, fields: fields, custom_redirect: custom_redirect, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['direction'] = 'direction' @_hash['send_email'] = 'send_email' @_hash['fields'] = 'fields' @_hash['custom_redirect'] = 'custom_redirect' @_hash end |
.nullables ⇒ Object
An array for nullable fields
60 61 62 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 60 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 54 55 56 57 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 51 def self.optionals %w[ send_email fields custom_redirect ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
110 111 112 113 114 115 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 110 def inspect class_name = self.class.name.split('::').last "<#{class_name} direction: #{@direction.inspect}, send_email: #{@send_email.inspect},"\ " fields: #{@fields.inspect}, custom_redirect: #{@custom_redirect.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 |
# File 'lib/modern_treasury/models/counterparty_collect_account_request.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} direction: #{@direction}, send_email: #{@send_email}, fields: #{@fields},"\ " custom_redirect: #{@custom_redirect}, additional_properties: #{@additional_properties}>" end |