lunixi-sdk 2.0.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -0
- data/README.md +43 -4
- data/README.tr.md +28 -3
- data/docs/card-rewards.md +21 -0
- data/lib/lunixi/bank_connect.rb +132 -15
- data/lib/lunixi/bank_connect_filters.rb +13 -3
- data/lib/lunixi/bank_connect_pos.rb +165 -0
- data/lib/lunixi/bank_connect_values.rb +127 -5
- data/lib/lunixi/card_requests.rb +9 -1
- data/lib/lunixi/client.rb +38 -14
- data/lib/lunixi/direct_method_payment_request.rb +24 -2
- data/lib/lunixi/errors.rb +49 -0
- data/lib/lunixi/fraud.rb +3 -2
- data/lib/lunixi/fraud_uk_claims.rb +127 -0
- data/lib/lunixi/fraud_values.rb +46 -0
- data/lib/lunixi/marketplace.rb +2 -0
- data/lib/lunixi/payment_link_rules.rb +13 -1
- data/lib/lunixi/payment_link_values.rb +4 -0
- data/lib/lunixi/payment_links.rb +3 -1
- data/lib/lunixi/payment_values.rb +22 -2
- data/lib/lunixi/payments.rb +62 -6
- data/lib/lunixi/product_webhooks.rb +17 -1
- data/lib/lunixi/refund_to_wallet.rb +94 -0
- data/lib/lunixi/route_table.rb +10 -5
- data/lib/lunixi/routing_pin.rb +247 -0
- data/lib/lunixi/sanction.rb +77 -17
- data/lib/lunixi/sanction_batch.rb +215 -0
- data/lib/lunixi/sanction_values.rb +289 -5
- data/lib/lunixi/split_payment.rb +17 -2
- data/lib/lunixi/subscription_routing.rb +70 -0
- data/lib/lunixi/subscription_values.rb +26 -3
- data/lib/lunixi/subscriptions.rb +22 -2
- data/lib/lunixi/version.rb +1 -1
- data/lib/lunixi/wallet.rb +43 -7
- data/lib/lunixi/wallet_customer_sessions.rb +75 -0
- data/lib/lunixi/wallet_customer_tokens.rb +238 -0
- data/lib/lunixi/wallet_portal.rb +340 -0
- data/lib/lunixi/wallet_portal_routes.rb +171 -0
- data/lib/lunixi/wallet_routes.rb +28 -3
- data/lib/lunixi/wallet_rules.rb +131 -0
- data/lib/lunixi/wallet_values.rb +151 -0
- data/lib/lunixi.rb +12 -0
- metadata +14 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'ipaddr'
|
|
4
|
+
|
|
5
|
+
module Lunixi
|
|
6
|
+
# Field checks shared by the wallet merchant client and the wallet portal client: per-field rules,
|
|
7
|
+
# checked query parameters, customerContact and the end-user IP. Every check runs before anything is
|
|
8
|
+
# sent and fails with a ConfigurationError that names the field, never its value (passwords and codes
|
|
9
|
+
# included). Not a public API.
|
|
10
|
+
module WalletRules
|
|
11
|
+
EMAIL = /\A[^\s@]+@[^\s@]+\.[^\s@]+\z/
|
|
12
|
+
|
|
13
|
+
module_function
|
|
14
|
+
|
|
15
|
+
# Applies the rules to the fields that are present:
|
|
16
|
+
# pattern the string must match
|
|
17
|
+
# min/max string length (UTF-16 code units, as the gateway counts)
|
|
18
|
+
# trim the gateway trims the value; the trimmed value is checked and sent
|
|
19
|
+
# oneOf one of the listed strings
|
|
20
|
+
# int { min, max }: an integer (Integer or digit string), sent as an Integer
|
|
21
|
+
# list { max, pattern }: an Array of strings (or a comma-separated String), sent comma-separated
|
|
22
|
+
# Returns a copy with the values to send.
|
|
23
|
+
def apply!(label, rules, values)
|
|
24
|
+
values.to_h do |field, value|
|
|
25
|
+
rule = rules[field]
|
|
26
|
+
[field, rule ? check!("#{label}.#{field}", rule, value) : value]
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def check!(label, rule, value)
|
|
31
|
+
return integer!(label, rule['int'], value) if rule['int']
|
|
32
|
+
return list!(label, rule['list'], value) if rule['list']
|
|
33
|
+
raise ConfigurationError, "#{label} must be a string." unless value.is_a?(String)
|
|
34
|
+
|
|
35
|
+
text = rule['trim'] ? value.strip : value
|
|
36
|
+
length = utf16_length(text)
|
|
37
|
+
raise ConfigurationError, "#{label} must be at least #{rule['min']} characters." if rule['min'] && length < rule['min']
|
|
38
|
+
raise ConfigurationError, "#{label} must be at most #{rule['max']} characters." if rule['max'] && length > rule['max']
|
|
39
|
+
raise ConfigurationError, "#{label} must be one of #{rule['oneOf'].join(', ')}." if rule['oneOf'] && !rule['oneOf'].include?(text)
|
|
40
|
+
raise ConfigurationError, "#{label} has an invalid format." if rule['pattern'] && !matches?(rule['pattern'], text)
|
|
41
|
+
|
|
42
|
+
text
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def integer!(label, bounds, value)
|
|
46
|
+
number = value.is_a?(String) && value.match?(/\A\d+\z/) ? value.to_i : value
|
|
47
|
+
min = bounds['min']
|
|
48
|
+
max = bounds['max']
|
|
49
|
+
unless number.is_a?(Integer) && (min.nil? || number >= min) && (max.nil? || number <= max)
|
|
50
|
+
raise ConfigurationError, "#{label} must be an integer#{" #{min}" if min}#{"-#{max}" if max}."
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
number
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def list!(label, spec, value)
|
|
57
|
+
items = value.is_a?(String) ? value.split(',', -1) : value
|
|
58
|
+
unless items.is_a?(Array) && !items.empty? && (spec['max'].nil? || items.length <= spec['max'])
|
|
59
|
+
raise ConfigurationError, "#{label} must be a list of 1-#{spec['max']} values."
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
items.each do |item|
|
|
63
|
+
raise ConfigurationError, "#{label} has an invalid value." unless item.is_a?(String) && (spec['pattern'].nil? || matches?(spec['pattern'], item))
|
|
64
|
+
end
|
|
65
|
+
items.join(',')
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# The accepted query parameters of a route: unknown filters are refused, nil and '' are left out,
|
|
69
|
+
# requiredQuery must be present and the rules are applied.
|
|
70
|
+
def query!(name, route, filters)
|
|
71
|
+
given = RouteRequest.wire_keys!(filters || {}, route['query'] || [], name, 'filter').reject { |_, value| value == '' }
|
|
72
|
+
missing = (route['requiredQuery'] || []).reject { |key| given.key?(key) }
|
|
73
|
+
raise ConfigurationError, "#{name} requires #{missing.join(', ')}." unless missing.empty?
|
|
74
|
+
|
|
75
|
+
checked = route['rules'] ? apply!(name, route['rules'], given) : given
|
|
76
|
+
checked.each do |key, value|
|
|
77
|
+
unless value.is_a?(String) || value.is_a?(Integer) || value == true || value == false
|
|
78
|
+
raise ConfigurationError, "#{name} filter '#{key}' must be a string, an integer or a boolean."
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
checked
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# customerContact: { email } pins the address the customer session code goes to; it cannot be changed
|
|
85
|
+
# through the API later. The gateway requires externalCustomerId and accountType PERSONAL with it.
|
|
86
|
+
def customer_contact!(name, plain)
|
|
87
|
+
contact = plain['customerContact']
|
|
88
|
+
raise ConfigurationError, "#{name}.customerContact must be a Hash." unless contact.is_a?(Hash)
|
|
89
|
+
|
|
90
|
+
fields = RouteRequest.wire_keys!(contact, WALLET_CUSTOMER_CONTACT_FIELDS, "#{name}.customerContact")
|
|
91
|
+
email = fields['email'].is_a?(String) ? fields['email'].strip : ''
|
|
92
|
+
unless !email.empty? && email.length <= WALLET_CUSTOMER_CONTACT_EMAIL_MAX && email.match?(EMAIL)
|
|
93
|
+
raise ConfigurationError, "#{name}.customerContact.email must be an e-mail address of at most #{WALLET_CUSTOMER_CONTACT_EMAIL_MAX} characters."
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
external = plain['externalCustomerId']
|
|
97
|
+
raise ConfigurationError, "#{name} requires externalCustomerId with customerContact." unless external.is_a?(String) && !external.strip.empty?
|
|
98
|
+
raise ConfigurationError, "#{name} takes customerContact only with accountType PERSONAL." unless plain['accountType'] == WalletAccountType::PERSONAL
|
|
99
|
+
|
|
100
|
+
{ 'email' => email }
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# X-Lunixi-End-User-Ip: the end user's IP as you saw it (IPv4 or IPv6), a signal only (not signed).
|
|
104
|
+
def end_user_ip!(value)
|
|
105
|
+
text = value.is_a?(String) ? value.strip : ''
|
|
106
|
+
raise ConfigurationError, 'end_user_ip must be an IPv4 or IPv6 address.' unless !text.empty? && !text.include?('/') && valid_ip?(text)
|
|
107
|
+
|
|
108
|
+
text
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def valid_ip?(text)
|
|
112
|
+
IPAddr.new(text)
|
|
113
|
+
true
|
|
114
|
+
rescue ArgumentError # IPAddr::Error is an ArgumentError
|
|
115
|
+
false
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# String length in UTF-16 code units (the gateway's count).
|
|
119
|
+
def utf16_length(text)
|
|
120
|
+
text.each_char.sum { |char| char.ord > 0xFFFF ? 2 : 1 }
|
|
121
|
+
rescue ArgumentError, EncodingError
|
|
122
|
+
text.length
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def matches?(pattern, text)
|
|
126
|
+
text.match?(pattern)
|
|
127
|
+
rescue ArgumentError, EncodingError
|
|
128
|
+
false
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
data/lib/lunixi/wallet_values.rb
CHANGED
|
@@ -56,6 +56,157 @@ module Lunixi
|
|
|
56
56
|
ALL = [ACTIVE, ARCHIVED].freeze
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
# Merchant-vouched customer session (/api/v1/wallet/customer-sessions). The code goes to the contact
|
|
60
|
+
# pinned when the end user was created (customerContact); the channel is the platform's notification
|
|
61
|
+
# policy and is never sent by the merchant.
|
|
62
|
+
module WalletCustomerSessionRevokeReason
|
|
63
|
+
USER_DELETED = 'USER_DELETED'
|
|
64
|
+
WALLET_DETACHED = 'WALLET_DETACHED'
|
|
65
|
+
CREDENTIALS_CHANGED = 'CREDENTIALS_CHANGED'
|
|
66
|
+
ALL = [USER_DELETED, WALLET_DETACHED, CREDENTIALS_CHANGED].freeze
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Where the code was sent (information only; the merchant does not choose it).
|
|
70
|
+
module WalletCustomerSessionDeliveryChannel
|
|
71
|
+
EMAIL = 'EMAIL'
|
|
72
|
+
SMS = 'SMS'
|
|
73
|
+
ALL = [EMAIL, SMS].freeze
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# MERCHANT_LOGIN = first activation; LOGIN / DEVICE_VERIFY = an active customer signing in again.
|
|
77
|
+
module WalletCustomerSessionOtpPurpose
|
|
78
|
+
MERCHANT_LOGIN = 'MERCHANT_LOGIN'
|
|
79
|
+
LOGIN = 'LOGIN'
|
|
80
|
+
DEVICE_VERIFY = 'DEVICE_VERIFY'
|
|
81
|
+
ALL = [MERCHANT_LOGIN, LOGIN, DEVICE_VERIFY].freeze
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# enrollment of a create-end-user answer that carried customerContact.
|
|
85
|
+
module WalletCustomerEnrollmentStatus
|
|
86
|
+
CREATED = 'CREATED'
|
|
87
|
+
ALREADY_ENROLLED = 'ALREADY_ENROLLED'
|
|
88
|
+
LINKED_EXISTING = 'LINKED_EXISTING'
|
|
89
|
+
ALL = [CREATED, ALREADY_ENROLLED, LINKED_EXISTING].freeze
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
module WalletCustomerIdentityStatus
|
|
93
|
+
PENDING_ACTIVATION = 'PENDING_ACTIVATION'
|
|
94
|
+
ACTIVE = 'ACTIVE'
|
|
95
|
+
ALL = [PENDING_ACTIVATION, ACTIVE].freeze
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
module WalletCustomerAttachStatus
|
|
99
|
+
ATTACHED = 'ATTACHED'
|
|
100
|
+
ALREADY_ATTACHED = 'ALREADY_ATTACHED'
|
|
101
|
+
ALL = [ATTACHED, ALREADY_ATTACHED].freeze
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Error codes of the customer session routes and of the portal calls made with its tokens: only the
|
|
105
|
+
# codes the gateway really returns. A missing key permission is always 403 auth.permission.forbidden
|
|
106
|
+
# (body required, missing) on these routes, never WALLET_INSUFFICIENT_SCOPE.
|
|
107
|
+
module WalletCustomerSessionErrorCode
|
|
108
|
+
PERMISSION_FORBIDDEN = 'auth.permission.forbidden'
|
|
109
|
+
RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED'
|
|
110
|
+
# Wallet side
|
|
111
|
+
NOT_FOUND = 'WALLET_NOT_FOUND'
|
|
112
|
+
CONTACT_PINNED = 'WALLET_CUSTOMER_CONTACT_PINNED'
|
|
113
|
+
CONTACT_CONFLICT = 'WALLET_CUSTOMER_CONTACT_CONFLICT'
|
|
114
|
+
ENDUSER_ATTACH_MISMATCH = 'WALLET_ENDUSER_ATTACH_MISMATCH'
|
|
115
|
+
ATTACH_UNCONFIRMED = 'WALLET_CUSTOMER_ATTACH_UNCONFIRMED'
|
|
116
|
+
NOT_ENROLLED = 'WALLET_CUSTOMER_NOT_ENROLLED'
|
|
117
|
+
STATE_INVALID = 'WALLET_STATE_INVALID'
|
|
118
|
+
STORE_NAME_UNAVAILABLE = 'WALLET_STORE_NAME_UNAVAILABLE'
|
|
119
|
+
SESSION_NOT_ISSUED = 'WALLET_CUSTOMER_SESSION_NOT_ISSUED'
|
|
120
|
+
REVOKE_INCOMPLETE = 'WALLET_CUSTOMER_REVOKE_INCOMPLETE'
|
|
121
|
+
# Session tokens (refresh and portal)
|
|
122
|
+
SESSION_BINDING_MISMATCH = 'AUTH_SESSION_BINDING_MISMATCH'
|
|
123
|
+
SESSION_BINDING_REQUIRED = 'AUTH_SESSION_BINDING_REQUIRED'
|
|
124
|
+
REFRESH_REUSED = 'AUTH_REFRESH_REUSED'
|
|
125
|
+
REFRESH_INVALID = 'AUTH_REFRESH_INVALID'
|
|
126
|
+
REFRESH_IN_PROGRESS = 'AUTH_REFRESH_IN_PROGRESS'
|
|
127
|
+
SESSION_EXPIRED = 'AUTH_SESSION_EXPIRED'
|
|
128
|
+
CUSTOMER_SESSION_INVALID = 'AUTH_CUSTOMER_SESSION_INVALID'
|
|
129
|
+
CUSTOMER_REAUTH_REQUIRED = 'AUTH_CUSTOMER_REAUTH_REQUIRED'
|
|
130
|
+
DEVICE_REVERIFY_REQUIRED = 'AUTH_DEVICE_REVERIFY_REQUIRED'
|
|
131
|
+
# Customer authentication
|
|
132
|
+
MERCHANT_SESSION_INPUT_INVALID = 'AUTH_MERCHANT_SESSION_INPUT_INVALID'
|
|
133
|
+
MERCHANT_SESSION_UNAVAILABLE = 'AUTH_MERCHANT_SESSION_UNAVAILABLE'
|
|
134
|
+
MERCHANT_SESSION_RATE_LIMITED = 'AUTH_MERCHANT_SESSION_RATE_LIMITED'
|
|
135
|
+
MERCHANT_SESSION_PASSWORD_NOT_EXPECTED = 'AUTH_MERCHANT_SESSION_PASSWORD_NOT_EXPECTED'
|
|
136
|
+
MERCHANT_REVOKE_REASON_INVALID = 'AUTH_MERCHANT_REVOKE_REASON_INVALID'
|
|
137
|
+
CUSTOMER_PHONE_INVALID = 'AUTH_CUSTOMER_PHONE_INVALID'
|
|
138
|
+
CUSTOMER_EMAIL_REQUIRED = 'AUTH_CUSTOMER_EMAIL_REQUIRED'
|
|
139
|
+
CUSTOMER_PASSWORD_REQUIRED = 'AUTH_CUSTOMER_PASSWORD_REQUIRED'
|
|
140
|
+
CUSTOMER_PASSWORD_EXPIRED = 'AUTH_CUSTOMER_PASSWORD_EXPIRED'
|
|
141
|
+
CUSTOMER_OTP_DESTINATION_NOT_VERIFIED = 'AUTH_CUSTOMER_OTP_DESTINATION_NOT_VERIFIED'
|
|
142
|
+
INVALID_CREDENTIALS = 'AUTH_INVALID_CREDENTIALS'
|
|
143
|
+
CREDENTIAL_BINDING_MISMATCH = 'AUTH_CREDENTIAL_BINDING_MISMATCH'
|
|
144
|
+
ACCOUNT_NOT_ACTIVE = 'AUTH_ACCOUNT_NOT_ACTIVE'
|
|
145
|
+
ACCOUNT_LOCKED = 'AUTH_ACCOUNT_LOCKED'
|
|
146
|
+
CONTACT_SYNC_PENDING = 'AUTH_CONTACT_SYNC_PENDING'
|
|
147
|
+
OTP_INVALID = 'AUTH_OTP_INVALID'
|
|
148
|
+
OTP_INVALID_INPUT = 'AUTH_OTP_INVALID_INPUT'
|
|
149
|
+
OTP_VERIFY_FAILED = 'AUTH_OTP_VERIFY_FAILED'
|
|
150
|
+
OTP_EXPIRED = 'AUTH_OTP_EXPIRED'
|
|
151
|
+
OTP_NOT_PENDING = 'AUTH_OTP_NOT_PENDING'
|
|
152
|
+
OTP_FRESH_START_REQUIRED = 'AUTH_OTP_FRESH_START_REQUIRED'
|
|
153
|
+
OTP_RESEND_THROTTLED = 'AUTH_OTP_RESEND_THROTTLED'
|
|
154
|
+
OTP_ACCOUNT_LOCKED = 'AUTH_OTP_ACCOUNT_LOCKED'
|
|
155
|
+
OTP_ACCOUNT_UNAVAILABLE = 'AUTH_OTP_ACCOUNT_UNAVAILABLE'
|
|
156
|
+
OTP_DEVICE_UNAVAILABLE = 'AUTH_OTP_DEVICE_UNAVAILABLE'
|
|
157
|
+
OTP_CHANNEL_UNAVAILABLE = 'AUTH_OTP_CHANNEL_UNAVAILABLE'
|
|
158
|
+
SERVICE_UNAVAILABLE = 'AUTH_SERVICE_UNAVAILABLE'
|
|
159
|
+
INTERNAL_ERROR = 'AUTH_INTERNAL_ERROR'
|
|
160
|
+
# 502, customer-session endpoints only: auth answered with a code the gateway does not map.
|
|
161
|
+
UPSTREAM_ERROR = 'AUTH_UPSTREAM_ERROR'
|
|
162
|
+
# Phone verification (portal me/phone-verification/*)
|
|
163
|
+
CONTACT_CHANGE_IN_PROGRESS = 'AUTH_CONTACT_CHANGE_IN_PROGRESS'
|
|
164
|
+
CUSTOMER_IDENTITY_NOT_FOUND = 'AUTH_CUSTOMER_IDENTITY_NOT_FOUND'
|
|
165
|
+
PHONE_VERIFICATION_BINDING_INVALID = 'AUTH_CUSTOMER_PHONE_VERIFICATION_BINDING_INVALID'
|
|
166
|
+
PHONE_VERIFICATION_REJECTED = 'AUTH_CUSTOMER_PHONE_VERIFICATION_REJECTED'
|
|
167
|
+
PHONE_VERIFICATION_UNAVAILABLE = 'AUTH_CUSTOMER_PHONE_VERIFICATION_UNAVAILABLE'
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# 422 password policy refusals of complete (newPassword). The code is not consumed: ask for another
|
|
171
|
+
# password and complete again with the same code.
|
|
172
|
+
WALLET_CUSTOMER_PASSWORD_POLICY_CODES = %w[
|
|
173
|
+
AUTH_CUSTOMER_PASSWORD_TOO_SHORT AUTH_CUSTOMER_PASSWORD_TOO_LONG AUTH_CUSTOMER_PASSWORD_SEQUENTIAL
|
|
174
|
+
AUTH_CUSTOMER_PASSWORD_REPEATED AUTH_CUSTOMER_PASSWORD_DATE_PATTERN AUTH_CUSTOMER_PASSWORD_CONTAINS_PHONE
|
|
175
|
+
AUTH_CUSTOMER_PASSWORD_TOO_COMMON AUTH_CUSTOMER_PASSWORD_INVALID AUTH_CUSTOMER_PASSWORD_REUSED
|
|
176
|
+
].freeze
|
|
177
|
+
|
|
178
|
+
WALLET_UUID_PATTERN = /\A\h{8}-\h{4}-\h{4}-\h{4}-\h{12}\z/
|
|
179
|
+
# The plugin installation id (one per installation, stable): the customer's MERCHANT device is derived
|
|
180
|
+
# from it.
|
|
181
|
+
WALLET_CLIENT_INSTANCE_ID_PATTERN = /\A[A-Za-z0-9][A-Za-z0-9._:-]{7,127}\z/
|
|
182
|
+
# The device name the customer sees ("Mağaza: example.com"): 2–64 characters, starts with a letter or
|
|
183
|
+
# digit, no < > { } " and no line break. It is not a trust source; the shop name in the message comes
|
|
184
|
+
# from your registered organization name.
|
|
185
|
+
WALLET_CLIENT_LABEL_PATTERN = /\A[\p{L}\p{N}][^<>{}"\x00-\x1f\x7f]{1,63}\z/ # \x00-\x1f covers \r and \n
|
|
186
|
+
WALLET_LOCALE_PATTERN = /\A[a-z]{2,3}(?:-[A-Za-z]{2,4})?\z/
|
|
187
|
+
WALLET_SESSION_CODE_PATTERN = /\A\d{4,10}\z/
|
|
188
|
+
WALLET_CUSTOMER_REFRESH_TOKEN_PATTERN = /\Aat_custr_/
|
|
189
|
+
# customerContact of create end user: the code address, pinned for good.
|
|
190
|
+
WALLET_CUSTOMER_CONTACT_FIELDS = %w[email].freeze
|
|
191
|
+
WALLET_CUSTOMER_CONTACT_EMAIL_MAX = 160
|
|
192
|
+
|
|
193
|
+
# Per-field checks of the customer session routes, run before sending (the gateway DTO rules). trim:
|
|
194
|
+
# the gateway trims the value, so the SDK sends it trimmed. Strings only; lengths are UTF-16 code
|
|
195
|
+
# units, as the gateway counts.
|
|
196
|
+
WALLET_CUSTOMER_SESSION_RULES = {
|
|
197
|
+
'programId' => { 'pattern' => WALLET_UUID_PATTERN }.freeze,
|
|
198
|
+
'externalCustomerId' => { 'trim' => true, 'min' => 1, 'max' => 128 }.freeze,
|
|
199
|
+
'clientInstanceId' => { 'pattern' => WALLET_CLIENT_INSTANCE_ID_PATTERN }.freeze,
|
|
200
|
+
'clientLabel' => { 'trim' => true, 'pattern' => WALLET_CLIENT_LABEL_PATTERN }.freeze,
|
|
201
|
+
'locale' => { 'pattern' => WALLET_LOCALE_PATTERN }.freeze,
|
|
202
|
+
'password' => { 'min' => 1, 'max' => 256 }.freeze,
|
|
203
|
+
'challengeId' => { 'pattern' => WALLET_UUID_PATTERN }.freeze,
|
|
204
|
+
'code' => { 'pattern' => WALLET_SESSION_CODE_PATTERN }.freeze,
|
|
205
|
+
'newPassword' => { 'min' => 8, 'max' => 256 }.freeze,
|
|
206
|
+
'refreshToken' => { 'pattern' => WALLET_CUSTOMER_REFRESH_TOKEN_PATTERN, 'max' => 200 }.freeze,
|
|
207
|
+
'reason' => { 'oneOf' => WalletCustomerSessionRevokeReason::ALL }.freeze
|
|
208
|
+
}.freeze
|
|
209
|
+
|
|
59
210
|
# Minor units as a decimal string: "12550" is 125.50 TRY. Never a number.
|
|
60
211
|
WALLET_AMOUNT_PATTERN = /\A\d{1,18}\z/
|
|
61
212
|
# The gateway trims the Idempotency-Key header and accepts 1–128 characters.
|
data/lib/lunixi.rb
CHANGED
|
@@ -9,6 +9,7 @@ require_relative 'lunixi/product_category'
|
|
|
9
9
|
require_relative 'lunixi/signer'
|
|
10
10
|
require_relative 'lunixi/transport'
|
|
11
11
|
require_relative 'lunixi/payment_values'
|
|
12
|
+
require_relative 'lunixi/routing_pin'
|
|
12
13
|
require_relative 'lunixi/order_details'
|
|
13
14
|
require_relative 'lunixi/method_fields'
|
|
14
15
|
require_relative 'lunixi/promissory_note'
|
|
@@ -17,9 +18,12 @@ require_relative 'lunixi/split_payment'
|
|
|
17
18
|
require_relative 'lunixi/direct_method_payment_request'
|
|
18
19
|
require_relative 'lunixi/enabled_installments'
|
|
19
20
|
require_relative 'lunixi/card_requests'
|
|
21
|
+
require_relative 'lunixi/refund_to_wallet'
|
|
20
22
|
require_relative 'lunixi/payments'
|
|
21
23
|
require_relative 'lunixi/reference'
|
|
22
24
|
require_relative 'lunixi/checkout'
|
|
25
|
+
require_relative 'lunixi/fraud_values'
|
|
26
|
+
require_relative 'lunixi/fraud_uk_claims'
|
|
23
27
|
require_relative 'lunixi/fraud'
|
|
24
28
|
require_relative 'lunixi/payment_link_values'
|
|
25
29
|
require_relative 'lunixi/payment_link_rules'
|
|
@@ -46,12 +50,19 @@ require_relative 'lunixi/route_response'
|
|
|
46
50
|
require_relative 'lunixi/route_value'
|
|
47
51
|
require_relative 'lunixi/wallet_values'
|
|
48
52
|
require_relative 'lunixi/wallet_routes'
|
|
53
|
+
require_relative 'lunixi/wallet_portal_routes'
|
|
54
|
+
require_relative 'lunixi/wallet_rules'
|
|
49
55
|
require_relative 'lunixi/wallet'
|
|
50
56
|
require_relative 'lunixi/wallet_resources'
|
|
57
|
+
require_relative 'lunixi/wallet_customer_tokens'
|
|
58
|
+
require_relative 'lunixi/wallet_customer_sessions'
|
|
59
|
+
require_relative 'lunixi/wallet_portal'
|
|
51
60
|
require_relative 'lunixi/bank_connect_values'
|
|
52
61
|
require_relative 'lunixi/bank_connect_filters'
|
|
53
62
|
require_relative 'lunixi/bank_connect'
|
|
63
|
+
require_relative 'lunixi/bank_connect_pos'
|
|
54
64
|
require_relative 'lunixi/sanction_values'
|
|
65
|
+
require_relative 'lunixi/sanction_batch'
|
|
55
66
|
require_relative 'lunixi/sanction'
|
|
56
67
|
require_relative 'lunixi/insurance_values'
|
|
57
68
|
require_relative 'lunixi/insurance_request'
|
|
@@ -59,6 +70,7 @@ require_relative 'lunixi/insurance'
|
|
|
59
70
|
require_relative 'lunixi/route_table'
|
|
60
71
|
require_relative 'lunixi/subscription_values'
|
|
61
72
|
require_relative 'lunixi/subscriptions'
|
|
73
|
+
require_relative 'lunixi/subscription_routing'
|
|
62
74
|
require_relative 'lunixi/subscription_resources'
|
|
63
75
|
require_relative 'lunixi/kyc_values'
|
|
64
76
|
require_relative 'lunixi/kyc'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lunixi-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lunixi
|
|
@@ -106,6 +106,7 @@ files:
|
|
|
106
106
|
- README.tr.md
|
|
107
107
|
- SECURITY.md
|
|
108
108
|
- docs/PUBLISHING.md
|
|
109
|
+
- docs/card-rewards.md
|
|
109
110
|
- docs/rails.en.md
|
|
110
111
|
- docs/rails.tr.md
|
|
111
112
|
- docs/ruby.en.md
|
|
@@ -113,6 +114,7 @@ files:
|
|
|
113
114
|
- lib/lunixi.rb
|
|
114
115
|
- lib/lunixi/bank_connect.rb
|
|
115
116
|
- lib/lunixi/bank_connect_filters.rb
|
|
117
|
+
- lib/lunixi/bank_connect_pos.rb
|
|
116
118
|
- lib/lunixi/bank_connect_values.rb
|
|
117
119
|
- lib/lunixi/bank_transfer.rb
|
|
118
120
|
- lib/lunixi/card_requests.rb
|
|
@@ -122,6 +124,8 @@ files:
|
|
|
122
124
|
- lib/lunixi/enabled_installments.rb
|
|
123
125
|
- lib/lunixi/errors.rb
|
|
124
126
|
- lib/lunixi/fraud.rb
|
|
127
|
+
- lib/lunixi/fraud_uk_claims.rb
|
|
128
|
+
- lib/lunixi/fraud_values.rb
|
|
125
129
|
- lib/lunixi/identity.rb
|
|
126
130
|
- lib/lunixi/identity_values.rb
|
|
127
131
|
- lib/lunixi/insurance.rb
|
|
@@ -162,22 +166,31 @@ files:
|
|
|
162
166
|
- lib/lunixi/product_webhooks.rb
|
|
163
167
|
- lib/lunixi/promissory_note.rb
|
|
164
168
|
- lib/lunixi/reference.rb
|
|
169
|
+
- lib/lunixi/refund_to_wallet.rb
|
|
165
170
|
- lib/lunixi/route_request.rb
|
|
166
171
|
- lib/lunixi/route_response.rb
|
|
167
172
|
- lib/lunixi/route_table.rb
|
|
168
173
|
- lib/lunixi/route_value.rb
|
|
174
|
+
- lib/lunixi/routing_pin.rb
|
|
169
175
|
- lib/lunixi/sanction.rb
|
|
176
|
+
- lib/lunixi/sanction_batch.rb
|
|
170
177
|
- lib/lunixi/sanction_values.rb
|
|
171
178
|
- lib/lunixi/signer.rb
|
|
172
179
|
- lib/lunixi/split_payment.rb
|
|
173
180
|
- lib/lunixi/subscription_resources.rb
|
|
181
|
+
- lib/lunixi/subscription_routing.rb
|
|
174
182
|
- lib/lunixi/subscription_values.rb
|
|
175
183
|
- lib/lunixi/subscriptions.rb
|
|
176
184
|
- lib/lunixi/transport.rb
|
|
177
185
|
- lib/lunixi/version.rb
|
|
178
186
|
- lib/lunixi/wallet.rb
|
|
187
|
+
- lib/lunixi/wallet_customer_sessions.rb
|
|
188
|
+
- lib/lunixi/wallet_customer_tokens.rb
|
|
189
|
+
- lib/lunixi/wallet_portal.rb
|
|
190
|
+
- lib/lunixi/wallet_portal_routes.rb
|
|
179
191
|
- lib/lunixi/wallet_resources.rb
|
|
180
192
|
- lib/lunixi/wallet_routes.rb
|
|
193
|
+
- lib/lunixi/wallet_rules.rb
|
|
181
194
|
- lib/lunixi/wallet_values.rb
|
|
182
195
|
- lib/lunixi/webhook.rb
|
|
183
196
|
- lib/lunixi/wire_money.rb
|