Class: ThePlaidApi::ExternalPaymentInitiationConsentOptions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/external_payment_initiation_consent_options.rb

Overview

(Deprecated) Additional payment consent options. Please use ‘payer_details` to specify the account.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(request_refund_details: SKIP, iban: SKIP, bacs: SKIP, additional_properties: nil) ⇒ ExternalPaymentInitiationConsentOptions

Returns a new instance of ExternalPaymentInitiationConsentOptions.



59
60
61
62
63
64
65
66
67
68
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 59

def initialize(request_refund_details: SKIP, iban: SKIP, bacs: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @request_refund_details = request_refund_details unless request_refund_details == SKIP
  @iban = iban unless iban == SKIP
  @bacs = bacs unless bacs == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#bacsPaymentInitiationOptionalRestrictionBacs

An optional object used to restrict the accounts used for payments. If provided, the end user will be able to send payments only from the specified bank account.



30
31
32
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 30

def bacs
  @bacs
end

#ibanString

The International Bank Account Number (IBAN) for the payer’s account. Where possible, the end user will be able to set up payment consent using only the specified bank account if provided.

Returns:

  • (String)


24
25
26
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 24

def iban
  @iban
end

#request_refund_detailsTrueClass | FalseClass

When ‘true`, Plaid will attempt to request refund details from the payee’s financial institution. Support varies between financial institutions and will not always be available. If refund details could be retrieved, they will be available in the ‘/payment_initiation/payment/get` response.

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 18

def request_refund_details
  @request_refund_details
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  request_refund_details =
    hash.key?('request_refund_details') ? hash['request_refund_details'] : SKIP
  iban = hash.key?('iban') ? hash['iban'] : SKIP
  bacs = PaymentInitiationOptionalRestrictionBacs.from_hash(hash['bacs']) if hash['bacs']

  # 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.
  ExternalPaymentInitiationConsentOptions.new(request_refund_details: request_refund_details,
                                              iban: iban,
                                              bacs: bacs,
                                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_refund_details'] = 'request_refund_details'
  @_hash['iban'] = 'iban'
  @_hash['bacs'] = 'bacs'
  @_hash
end

.nullablesObject

An array for nullable fields



51
52
53
54
55
56
57
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 51

def self.nullables
  %w[
    request_refund_details
    iban
    bacs
  ]
end

.optionalsObject

An array for optional fields



42
43
44
45
46
47
48
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 42

def self.optionals
  %w[
    request_refund_details
    iban
    bacs
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



102
103
104
105
106
107
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 102

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} request_refund_details: #{@request_refund_details.inspect}, iban:"\
  " #{@iban.inspect}, bacs: #{@bacs.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



95
96
97
98
99
# File 'lib/the_plaid_api/models/external_payment_initiation_consent_options.rb', line 95

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} request_refund_details: #{@request_refund_details}, iban: #{@iban}, bacs:"\
  " #{@bacs}, additional_properties: #{@additional_properties}>"
end