Class: UnivapayClientSdk::IssuerToken

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/issuer_token.rb

Overview

Issuer token or bank transfer instruction payload.

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(payment_type:, issuer_token: SKIP, call_method: SKIP, payload: SKIP, account_id: SKIP, branch_code: SKIP, branch_name: SKIP, account_holder_name: SKIP, account_number: SKIP, additional_properties: nil) ⇒ IssuerToken

Returns a new instance of IssuerToken.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 100

def initialize(payment_type:, issuer_token: SKIP, call_method: SKIP,
               payload: SKIP, account_id: SKIP, branch_code: SKIP,
               branch_name: SKIP, account_holder_name: SKIP,
               account_number: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @payment_type = payment_type
  @issuer_token = issuer_token unless issuer_token == SKIP
  @call_method = call_method unless call_method == SKIP
  @payload = payload unless payload == SKIP
  @account_id =  unless  == SKIP
  @branch_code = branch_code unless branch_code == SKIP
  @branch_name = branch_name unless branch_name == SKIP
  @account_holder_name =  unless  == SKIP
  @account_number =  unless  == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_holder_nameString

(Bank Transfer) Account holder name.

Returns:

  • (String)


51
52
53
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 51

def 
  @account_holder_name
end

#account_idString

(Bank Transfer) Unique ID of the bank account issued by the connected system.

Returns:

  • (String)


39
40
41
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 39

def 
  @account_id
end

#account_numberString

(Bank Transfer) Account number.

Returns:

  • (String)


55
56
57
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 55

def 
  @account_number
end

#branch_codeString

(Bank Transfer) Branch code.

Returns:

  • (String)


43
44
45
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 43

def branch_code
  @branch_code
end

#branch_nameString

(Bank Transfer) Branch name.

Returns:

  • (String)


47
48
49
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 47

def branch_name
  @branch_name
end

#call_methodIssuerTokenCallMethod

(Online) How the client should execute the token. - sdk / app: Direct use in native app environments/SDKs. - web: Direct use in special extended browser environments. - http_get / http_post: Execute directly in a new browser window or iframe.



26
27
28
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 26

def call_method
  @call_method
end

#issuer_tokenString

(Online) The token or payment URL provided by the payment provider for the consumer to execute.

Returns:

  • (String)


19
20
21
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 19

def issuer_token
  @issuer_token
end

#payloadIssuerTokenPayload

Key-value pairs required to complete the payment action, or null if not applicable. Used when call_method is http_post. When present, this JSON must be converted by the client to match the expected content_type (e.g., transformed into an application/x-www-form-urlencoded string) before sending the POST request.

Returns:



34
35
36
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 34

def payload
  @payload
end

#payment_typeIssuerTokenPaymentType

The type of payment method for the charge.



14
15
16
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 14

def payment_type
  @payment_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 120

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_type = hash.key?('payment_type') ? hash['payment_type'] : nil
  issuer_token = hash.key?('issuer_token') ? hash['issuer_token'] : SKIP
  call_method = hash.key?('call_method') ? hash['call_method'] : SKIP
  payload = IssuerTokenPayload.from_hash(hash['payload']) if hash['payload']
   = hash.key?('account_id') ? hash['account_id'] : SKIP
  branch_code = hash.key?('branch_code') ? hash['branch_code'] : SKIP
  branch_name = hash.key?('branch_name') ? hash['branch_name'] : SKIP
   =
    hash.key?('account_holder_name') ? hash['account_holder_name'] : SKIP
   =
    hash.key?('account_number') ? hash['account_number'] : 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.
  IssuerToken.new(payment_type: payment_type,
                  issuer_token: issuer_token,
                  call_method: call_method,
                  payload: payload,
                  account_id: ,
                  branch_code: branch_code,
                  branch_name: branch_name,
                  account_holder_name: ,
                  account_number: ,
                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 58

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_type'] = 'payment_type'
  @_hash['issuer_token'] = 'issuer_token'
  @_hash['call_method'] = 'call_method'
  @_hash['payload'] = 'payload'
  @_hash['account_id'] = 'account_id'
  @_hash['branch_code'] = 'branch_code'
  @_hash['branch_name'] = 'branch_name'
  @_hash['account_holder_name'] = 'account_holder_name'
  @_hash['account_number'] = 'account_number'
  @_hash
end

.nullablesObject

An array for nullable fields



87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 87

def self.nullables
  %w[
    issuer_token
    call_method
    payload
    account_id
    branch_code
    branch_name
    account_holder_name
    account_number
  ]
end

.optionalsObject

An array for optional fields



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 73

def self.optionals
  %w[
    issuer_token
    call_method
    payload
    account_id
    branch_code
    branch_name
    account_holder_name
    account_number
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



167
168
169
170
171
172
173
174
175
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 167

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_type: #{@payment_type.inspect}, issuer_token:"\
  " #{@issuer_token.inspect}, call_method: #{@call_method.inspect}, payload:"\
  " #{@payload.inspect}, account_id: #{@account_id.inspect}, branch_code:"\
  " #{@branch_code.inspect}, branch_name: #{@branch_name.inspect}, account_holder_name:"\
  " #{@account_holder_name.inspect}, account_number: #{@account_number.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



157
158
159
160
161
162
163
164
# File 'lib/univapay_client_sdk/models/issuer_token.rb', line 157

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_type: #{@payment_type}, issuer_token: #{@issuer_token},"\
  " call_method: #{@call_method}, payload: #{@payload}, account_id: #{@account_id},"\
  " branch_code: #{@branch_code}, branch_name: #{@branch_name}, account_holder_name:"\
  " #{@account_holder_name}, account_number: #{@account_number}, additional_properties:"\
  " #{@additional_properties}>"
end