payabli 3.0.5 → 3.0.6
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/.fern/metadata.json +4 -4
- data/README.md +4 -1
- data/lib/payabli/bill/client.rb +119 -0
- data/lib/payabli/boarding/client.rb +209 -0
- data/lib/payabli/charge_backs/client.rb +20 -0
- data/lib/payabli/check_capture/client.rb +10 -0
- data/lib/payabli/client.rb +29 -5
- data/lib/payabli/cloud/client.rb +29 -0
- data/lib/payabli/customer/client.rb +54 -0
- data/lib/payabli/export/client.rb +321 -0
- data/lib/payabli/funding/client.rb +9 -0
- data/lib/payabli/ghost_card/client.rb +31 -0
- data/lib/payabli/hosted_payment_pages/client.rb +23 -0
- data/lib/payabli/import/client.rb +15 -0
- data/lib/payabli/internal/http/raw_client.rb +26 -0
- data/lib/payabli/internal/oauth_provider.rb +73 -0
- data/lib/payabli/internal/routing_auth_provider.rb +51 -0
- data/lib/payabli/invoice/client.rb +118 -0
- data/lib/payabli/line_item/client.rb +43 -0
- data/lib/payabli/management/client.rb +13 -0
- data/lib/payabli/money_in/client.rb +238 -0
- data/lib/payabli/money_out/client.rb +94 -0
- data/lib/payabli/notification/client.rb +46 -0
- data/lib/payabli/notificationlogs/client.rb +27 -0
- data/lib/payabli/ocr/client.rb +10 -0
- data/lib/payabli/organization/client.rb +91 -0
- data/lib/payabli/payment_link/client.rb +367 -0
- data/lib/payabli/payment_method_domain/client.rb +56 -0
- data/lib/payabli/payout_subscription/client.rb +50 -0
- data/lib/payabli/paypoint/client.rb +56 -0
- data/lib/payabli/query/client.rb +414 -0
- data/lib/payabli/statistic/client.rb +39 -0
- data/lib/payabli/subscription/client.rb +46 -0
- data/lib/payabli/templates/client.rb +28 -0
- data/lib/payabli/token/client.rb +8 -0
- data/lib/payabli/token_storage/client.rb +55 -0
- data/lib/payabli/user/client.rb +67 -0
- data/lib/payabli/vendor/client.rb +102 -0
- data/lib/payabli/version.rb +1 -1
- data/lib/payabli/wallet/client.rb +34 -0
- data/lib/payabli.rb +2 -0
- data/reference.md +219 -219
- data/wiremock/wiremock-mappings.json +32 -1302
- metadata +3 -1
|
@@ -28,6 +28,16 @@ module Payabli
|
|
|
28
28
|
# @option params [Hash[String, String, nil], nil] :parameters
|
|
29
29
|
# @option params [String, nil] :start_date
|
|
30
30
|
#
|
|
31
|
+
# @example
|
|
32
|
+
# client.statistic.basic_stats(
|
|
33
|
+
# mode: "custom",
|
|
34
|
+
# freq: "m",
|
|
35
|
+
# level: 2,
|
|
36
|
+
# entry_id: 1000000,
|
|
37
|
+
# end_date: "2025-11-30",
|
|
38
|
+
# start_date: "2025-11-01"
|
|
39
|
+
# )
|
|
40
|
+
#
|
|
31
41
|
# @return [Array[Payabli::Types::StatBasicExtendedQueryRecord]]
|
|
32
42
|
def basic_stats(request_options: {}, **params)
|
|
33
43
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -36,10 +46,12 @@ module Payabli
|
|
|
36
46
|
query_params["parameters"] = params[:parameters] if params.key?(:parameters)
|
|
37
47
|
query_params["startDate"] = params[:start_date] if params.key?(:start_date)
|
|
38
48
|
|
|
49
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
39
50
|
request = Payabli::Internal::JSON::Request.new(
|
|
40
51
|
base_url: request_options[:base_url],
|
|
41
52
|
method: "GET",
|
|
42
53
|
path: "Statistic/basic/#{URI.encode_uri_component(params[:mode].to_s)}/#{URI.encode_uri_component(params[:freq].to_s)}/#{URI.encode_uri_component(params[:level].to_s)}/#{URI.encode_uri_component(params[:entry_id].to_s)}",
|
|
54
|
+
headers: headers,
|
|
43
55
|
query: query_params,
|
|
44
56
|
request_options: request_options
|
|
45
57
|
)
|
|
@@ -69,16 +81,25 @@ module Payabli
|
|
|
69
81
|
# @option params [Integer] :customer_id
|
|
70
82
|
# @option params [Hash[String, String, nil], nil] :parameters
|
|
71
83
|
#
|
|
84
|
+
# @example
|
|
85
|
+
# client.statistic.customer_basic_stats(
|
|
86
|
+
# mode: "ytd",
|
|
87
|
+
# freq: "m",
|
|
88
|
+
# customer_id: 4440
|
|
89
|
+
# )
|
|
90
|
+
#
|
|
72
91
|
# @return [Array[Payabli::Types::SubscriptionStatsQueryRecord]]
|
|
73
92
|
def customer_basic_stats(request_options: {}, **params)
|
|
74
93
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
75
94
|
query_params = {}
|
|
76
95
|
query_params["parameters"] = params[:parameters] if params.key?(:parameters)
|
|
77
96
|
|
|
97
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
78
98
|
request = Payabli::Internal::JSON::Request.new(
|
|
79
99
|
base_url: request_options[:base_url],
|
|
80
100
|
method: "GET",
|
|
81
101
|
path: "Statistic/customerbasic/#{URI.encode_uri_component(params[:mode].to_s)}/#{URI.encode_uri_component(params[:freq].to_s)}/#{URI.encode_uri_component(params[:customer_id].to_s)}",
|
|
102
|
+
headers: headers,
|
|
82
103
|
query: query_params,
|
|
83
104
|
request_options: request_options
|
|
84
105
|
)
|
|
@@ -108,16 +129,25 @@ module Payabli
|
|
|
108
129
|
# @option params [Integer] :entry_id
|
|
109
130
|
# @option params [Hash[String, String, nil], nil] :parameters
|
|
110
131
|
#
|
|
132
|
+
# @example
|
|
133
|
+
# client.statistic.sub_stats(
|
|
134
|
+
# interval: "30",
|
|
135
|
+
# level: 2,
|
|
136
|
+
# entry_id: 1000000
|
|
137
|
+
# )
|
|
138
|
+
#
|
|
111
139
|
# @return [Array[Payabli::Types::StatBasicQueryRecord]]
|
|
112
140
|
def sub_stats(request_options: {}, **params)
|
|
113
141
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
114
142
|
query_params = {}
|
|
115
143
|
query_params["parameters"] = params[:parameters] if params.key?(:parameters)
|
|
116
144
|
|
|
145
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
117
146
|
request = Payabli::Internal::JSON::Request.new(
|
|
118
147
|
base_url: request_options[:base_url],
|
|
119
148
|
method: "GET",
|
|
120
149
|
path: "Statistic/subscriptions/#{URI.encode_uri_component(params[:interval].to_s)}/#{URI.encode_uri_component(params[:level].to_s)}/#{URI.encode_uri_component(params[:entry_id].to_s)}",
|
|
150
|
+
headers: headers,
|
|
121
151
|
query: query_params,
|
|
122
152
|
request_options: request_options
|
|
123
153
|
)
|
|
@@ -147,16 +177,25 @@ module Payabli
|
|
|
147
177
|
# @option params [Integer] :id_vendor
|
|
148
178
|
# @option params [Hash[String, String, nil], nil] :parameters
|
|
149
179
|
#
|
|
180
|
+
# @example
|
|
181
|
+
# client.statistic.vendor_basic_stats(
|
|
182
|
+
# mode: "ytd",
|
|
183
|
+
# freq: "m",
|
|
184
|
+
# id_vendor: 1
|
|
185
|
+
# )
|
|
186
|
+
#
|
|
150
187
|
# @return [Array[Payabli::Types::StatisticsVendorQueryRecord]]
|
|
151
188
|
def vendor_basic_stats(request_options: {}, **params)
|
|
152
189
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
153
190
|
query_params = {}
|
|
154
191
|
query_params["parameters"] = params[:parameters] if params.key?(:parameters)
|
|
155
192
|
|
|
193
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
156
194
|
request = Payabli::Internal::JSON::Request.new(
|
|
157
195
|
base_url: request_options[:base_url],
|
|
158
196
|
method: "GET",
|
|
159
197
|
path: "Statistic/vendorbasic/#{URI.encode_uri_component(params[:mode].to_s)}/#{URI.encode_uri_component(params[:freq].to_s)}/#{URI.encode_uri_component(params[:id_vendor].to_s)}",
|
|
198
|
+
headers: headers,
|
|
160
199
|
query: query_params,
|
|
161
200
|
request_options: request_options
|
|
162
201
|
)
|
|
@@ -21,13 +21,18 @@ module Payabli
|
|
|
21
21
|
# @option request_options [Integer] :timeout_in_seconds
|
|
22
22
|
# @option params [Integer] :sub_id
|
|
23
23
|
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.subscription.get_subscription(sub_id: 231)
|
|
26
|
+
#
|
|
24
27
|
# @return [Payabli::Types::SubscriptionQueryRecords]
|
|
25
28
|
def get_subscription(request_options: {}, **params)
|
|
26
29
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
30
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
27
31
|
request = Payabli::Internal::JSON::Request.new(
|
|
28
32
|
base_url: request_options[:base_url],
|
|
29
33
|
method: "GET",
|
|
30
34
|
path: "Subscription/#{URI.encode_uri_component(params[:sub_id].to_s)}",
|
|
35
|
+
headers: headers,
|
|
31
36
|
request_options: request_options
|
|
32
37
|
)
|
|
33
38
|
begin
|
|
@@ -55,6 +60,12 @@ module Payabli
|
|
|
55
60
|
# @option request_options [Integer] :timeout_in_seconds
|
|
56
61
|
# @option params [Integer] :sub_id
|
|
57
62
|
#
|
|
63
|
+
# @example
|
|
64
|
+
# client.subscription.update_subscription(
|
|
65
|
+
# sub_id: 231,
|
|
66
|
+
# set_pause: true
|
|
67
|
+
# )
|
|
68
|
+
#
|
|
58
69
|
# @return [Payabli::Types::UpdateSubscriptionResponse]
|
|
59
70
|
def update_subscription(request_options: {}, **params)
|
|
60
71
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -62,10 +73,12 @@ module Payabli
|
|
|
62
73
|
non_body_param_names = %w[subId]
|
|
63
74
|
body = request_data.except(*non_body_param_names)
|
|
64
75
|
|
|
76
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
65
77
|
request = Payabli::Internal::JSON::Request.new(
|
|
66
78
|
base_url: request_options[:base_url],
|
|
67
79
|
method: "PUT",
|
|
68
80
|
path: "Subscription/#{URI.encode_uri_component(params[:sub_id].to_s)}",
|
|
81
|
+
headers: headers,
|
|
69
82
|
body: body,
|
|
70
83
|
request_options: request_options
|
|
71
84
|
)
|
|
@@ -94,13 +107,18 @@ module Payabli
|
|
|
94
107
|
# @option request_options [Integer] :timeout_in_seconds
|
|
95
108
|
# @option params [Integer] :sub_id
|
|
96
109
|
#
|
|
110
|
+
# @example
|
|
111
|
+
# client.subscription.remove_subscription(sub_id: 231)
|
|
112
|
+
#
|
|
97
113
|
# @return [Payabli::Types::RemoveSubscriptionResponse]
|
|
98
114
|
def remove_subscription(request_options: {}, **params)
|
|
99
115
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
116
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
100
117
|
request = Payabli::Internal::JSON::Request.new(
|
|
101
118
|
base_url: request_options[:base_url],
|
|
102
119
|
method: "DELETE",
|
|
103
120
|
path: "Subscription/#{URI.encode_uri_component(params[:sub_id].to_s)}",
|
|
121
|
+
headers: headers,
|
|
104
122
|
request_options: request_options
|
|
105
123
|
)
|
|
106
124
|
begin
|
|
@@ -130,6 +148,33 @@ module Payabli
|
|
|
130
148
|
# @option params [Boolean, nil] :force_customer_creation
|
|
131
149
|
# @option params [String, nil] :idempotency_key
|
|
132
150
|
#
|
|
151
|
+
# @example
|
|
152
|
+
# client.subscription.new_subscription(
|
|
153
|
+
# customer_data: {
|
|
154
|
+
# customer_id: 4440
|
|
155
|
+
# },
|
|
156
|
+
# entry_point: "8cfec329267",
|
|
157
|
+
# payment_details: {
|
|
158
|
+
# service_fee: 0,
|
|
159
|
+
# total_amount: 100
|
|
160
|
+
# },
|
|
161
|
+
# payment_method: {
|
|
162
|
+
# cardcvv: "123",
|
|
163
|
+
# cardexp: "12/29",
|
|
164
|
+
# card_holder: "John Cassian",
|
|
165
|
+
# cardnumber: "4111111111111111",
|
|
166
|
+
# cardzip: "37615",
|
|
167
|
+
# initiator: "payor",
|
|
168
|
+
# method_: "card"
|
|
169
|
+
# },
|
|
170
|
+
# schedule_details: {
|
|
171
|
+
# end_date: "2025-03-20",
|
|
172
|
+
# frequency: "weekly",
|
|
173
|
+
# plan_id: 1,
|
|
174
|
+
# start_date: "2024-09-20"
|
|
175
|
+
# }
|
|
176
|
+
# )
|
|
177
|
+
#
|
|
133
178
|
# @return [Payabli::Types::AddSubscriptionResponse]
|
|
134
179
|
def new_subscription(request_options: {}, **params)
|
|
135
180
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -143,6 +188,7 @@ module Payabli
|
|
|
143
188
|
headers = {}
|
|
144
189
|
headers["idempotencyKey"] = params[:idempotency_key] if params[:idempotency_key]
|
|
145
190
|
|
|
191
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]).merge(headers)
|
|
146
192
|
request = Payabli::Internal::JSON::Request.new(
|
|
147
193
|
base_url: request_options[:base_url],
|
|
148
194
|
method: "POST",
|
|
@@ -21,13 +21,18 @@ module Payabli
|
|
|
21
21
|
# @option request_options [Integer] :timeout_in_seconds
|
|
22
22
|
# @option params [Integer] :template_id
|
|
23
23
|
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.templates.delete_template(template_id: 80)
|
|
26
|
+
#
|
|
24
27
|
# @return [Payabli::Types::PayabliApiResponseTemplateId]
|
|
25
28
|
def delete_template(request_options: {}, **params)
|
|
26
29
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
30
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
27
31
|
request = Payabli::Internal::JSON::Request.new(
|
|
28
32
|
base_url: request_options[:base_url],
|
|
29
33
|
method: "DELETE",
|
|
30
34
|
path: "Templates/#{URI.encode_uri_component(params[:template_id].to_s)}",
|
|
35
|
+
headers: headers,
|
|
31
36
|
request_options: request_options
|
|
32
37
|
)
|
|
33
38
|
begin
|
|
@@ -56,13 +61,21 @@ module Payabli
|
|
|
56
61
|
# @option params [Integer] :template_id
|
|
57
62
|
# @option params [Boolean] :ignore_empty
|
|
58
63
|
#
|
|
64
|
+
# @example
|
|
65
|
+
# client.templates.getlink_template(
|
|
66
|
+
# template_id: 80,
|
|
67
|
+
# ignore_empty: true
|
|
68
|
+
# )
|
|
69
|
+
#
|
|
59
70
|
# @return [Payabli::Types::BoardingLinkApiResponse]
|
|
60
71
|
def getlink_template(request_options: {}, **params)
|
|
61
72
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
73
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
62
74
|
request = Payabli::Internal::JSON::Request.new(
|
|
63
75
|
base_url: request_options[:base_url],
|
|
64
76
|
method: "GET",
|
|
65
77
|
path: "Templates/getlink/#{URI.encode_uri_component(params[:template_id].to_s)}/#{URI.encode_uri_component(params[:ignore_empty].to_s)}",
|
|
78
|
+
headers: headers,
|
|
66
79
|
request_options: request_options
|
|
67
80
|
)
|
|
68
81
|
begin
|
|
@@ -90,13 +103,18 @@ module Payabli
|
|
|
90
103
|
# @option request_options [Integer] :timeout_in_seconds
|
|
91
104
|
# @option params [Integer] :template_id
|
|
92
105
|
#
|
|
106
|
+
# @example
|
|
107
|
+
# client.templates.get_template(template_id: 80)
|
|
108
|
+
#
|
|
93
109
|
# @return [Payabli::Types::TemplateQueryRecord]
|
|
94
110
|
def get_template(request_options: {}, **params)
|
|
95
111
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
112
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
96
113
|
request = Payabli::Internal::JSON::Request.new(
|
|
97
114
|
base_url: request_options[:base_url],
|
|
98
115
|
method: "GET",
|
|
99
116
|
path: "Templates/get/#{URI.encode_uri_component(params[:template_id].to_s)}",
|
|
117
|
+
headers: headers,
|
|
100
118
|
request_options: request_options
|
|
101
119
|
)
|
|
102
120
|
begin
|
|
@@ -130,6 +148,14 @@ module Payabli
|
|
|
130
148
|
# @option params [Hash[String, String, nil], nil] :parameters
|
|
131
149
|
# @option params [String, nil] :sort_by
|
|
132
150
|
#
|
|
151
|
+
# @example
|
|
152
|
+
# client.templates.list_templates(
|
|
153
|
+
# org_id: 123,
|
|
154
|
+
# from_record: 251,
|
|
155
|
+
# limit_record: 0,
|
|
156
|
+
# sort_by: "desc(field_name)"
|
|
157
|
+
# )
|
|
158
|
+
#
|
|
133
159
|
# @return [Payabli::Types::TemplateQueryResponse]
|
|
134
160
|
def list_templates(request_options: {}, **params)
|
|
135
161
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -139,10 +165,12 @@ module Payabli
|
|
|
139
165
|
query_params["parameters"] = params[:parameters] if params.key?(:parameters)
|
|
140
166
|
query_params["sortBy"] = params[:sort_by] if params.key?(:sort_by)
|
|
141
167
|
|
|
168
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
142
169
|
request = Payabli::Internal::JSON::Request.new(
|
|
143
170
|
base_url: request_options[:base_url],
|
|
144
171
|
method: "GET",
|
|
145
172
|
path: "Query/templates/#{URI.encode_uri_component(params[:org_id].to_s)}",
|
|
173
|
+
headers: headers,
|
|
146
174
|
query: query_params,
|
|
147
175
|
request_options: request_options
|
|
148
176
|
)
|
data/lib/payabli/token/client.rb
CHANGED
|
@@ -23,13 +23,21 @@ module Payabli
|
|
|
23
23
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
24
24
|
# @option request_options [Integer] :timeout_in_seconds
|
|
25
25
|
#
|
|
26
|
+
# @example
|
|
27
|
+
# client.token.create_server_side_token(
|
|
28
|
+
# client_id: "YOUR_CLIENT_ID",
|
|
29
|
+
# client_secret: "YOUR_CLIENT_SECRET"
|
|
30
|
+
# )
|
|
31
|
+
#
|
|
26
32
|
# @return [Payabli::Types::PayabliAccessTokenResponse]
|
|
27
33
|
def create_server_side_token(request_options: {}, **params)
|
|
28
34
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
35
|
+
headers = @client.auth_headers_for_endpoint(security: nil)
|
|
29
36
|
request = Payabli::Internal::JSON::Request.new(
|
|
30
37
|
base_url: request_options[:base_url],
|
|
31
38
|
method: "POST",
|
|
32
39
|
path: "v2/Token/serverside",
|
|
40
|
+
headers: headers,
|
|
33
41
|
body: Payabli::Token::Types::CreateServerSideTokenRequest.new(params).to_h,
|
|
34
42
|
request_options: request_options
|
|
35
43
|
)
|
|
@@ -27,6 +27,26 @@ module Payabli
|
|
|
27
27
|
# @option params [Boolean, nil] :temporary
|
|
28
28
|
# @option params [String, nil] :idempotency_key
|
|
29
29
|
#
|
|
30
|
+
# @example
|
|
31
|
+
# client.token_storage.add_method(
|
|
32
|
+
# customer_data: {
|
|
33
|
+
# customer_id: 4440
|
|
34
|
+
# },
|
|
35
|
+
# entry_point: "8cfec329267",
|
|
36
|
+
# fallback_auth: true,
|
|
37
|
+
# fallback_auth_amount: 100,
|
|
38
|
+
# method_description: "Primary Visa card",
|
|
39
|
+
# payment_method: {
|
|
40
|
+
# cardcvv: "123",
|
|
41
|
+
# cardexp: "12/29",
|
|
42
|
+
# card_holder: "John Doe",
|
|
43
|
+
# cardnumber: "4111111111111111",
|
|
44
|
+
# cardzip: "12345",
|
|
45
|
+
# method_: "card"
|
|
46
|
+
# },
|
|
47
|
+
# source: "api"
|
|
48
|
+
# )
|
|
49
|
+
#
|
|
30
50
|
# @return [Payabli::Types::AddMethodResponse]
|
|
31
51
|
def add_method(request_options: {}, **params)
|
|
32
52
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -41,6 +61,7 @@ module Payabli
|
|
|
41
61
|
headers = {}
|
|
42
62
|
headers["idempotencyKey"] = params[:idempotency_key] if params[:idempotency_key]
|
|
43
63
|
|
|
64
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]).merge(headers)
|
|
44
65
|
request = Payabli::Internal::JSON::Request.new(
|
|
45
66
|
base_url: request_options[:base_url],
|
|
46
67
|
method: "POST",
|
|
@@ -77,6 +98,13 @@ module Payabli
|
|
|
77
98
|
# @option params [Integer, nil] :card_expiration_format
|
|
78
99
|
# @option params [Boolean, nil] :include_temporary
|
|
79
100
|
#
|
|
101
|
+
# @example
|
|
102
|
+
# client.token_storage.get_method(
|
|
103
|
+
# method_id: "32-8877drt00045632-678",
|
|
104
|
+
# card_expiration_format: 1,
|
|
105
|
+
# include_temporary: false
|
|
106
|
+
# )
|
|
107
|
+
#
|
|
80
108
|
# @return [Payabli::Types::GetMethodResponse]
|
|
81
109
|
def get_method(request_options: {}, **params)
|
|
82
110
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -84,10 +112,12 @@ module Payabli
|
|
|
84
112
|
query_params["cardExpirationFormat"] = params[:card_expiration_format] if params.key?(:card_expiration_format)
|
|
85
113
|
query_params["includeTemporary"] = params[:include_temporary] if params.key?(:include_temporary)
|
|
86
114
|
|
|
115
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
87
116
|
request = Payabli::Internal::JSON::Request.new(
|
|
88
117
|
base_url: request_options[:base_url],
|
|
89
118
|
method: "GET",
|
|
90
119
|
path: "TokenStorage/#{URI.encode_uri_component(params[:method_id].to_s)}",
|
|
120
|
+
headers: headers,
|
|
91
121
|
query: query_params,
|
|
92
122
|
request_options: request_options
|
|
93
123
|
)
|
|
@@ -117,6 +147,24 @@ module Payabli
|
|
|
117
147
|
# @option params [String] :method_id
|
|
118
148
|
# @option params [Boolean, nil] :ach_validation
|
|
119
149
|
#
|
|
150
|
+
# @example
|
|
151
|
+
# client.token_storage.update_method(
|
|
152
|
+
# method_id: "32-8877drt00045632-678",
|
|
153
|
+
# customer_data: {
|
|
154
|
+
# customer_id: 4440
|
|
155
|
+
# },
|
|
156
|
+
# entry_point: "8cfec329267",
|
|
157
|
+
# fallback_auth: true,
|
|
158
|
+
# payment_method: {
|
|
159
|
+
# cardcvv: "123",
|
|
160
|
+
# cardexp: "12/29",
|
|
161
|
+
# card_holder: "John Doe",
|
|
162
|
+
# cardnumber: "4111111111111111",
|
|
163
|
+
# cardzip: "12345",
|
|
164
|
+
# method_: "card"
|
|
165
|
+
# }
|
|
166
|
+
# )
|
|
167
|
+
#
|
|
120
168
|
# @return [Payabli::Types::PayabliApiResponsePaymethodDelete]
|
|
121
169
|
def update_method(request_options: {}, **params)
|
|
122
170
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -128,10 +176,12 @@ module Payabli
|
|
|
128
176
|
query_params["achValidation"] = params[:ach_validation] if params.key?(:ach_validation)
|
|
129
177
|
params = params.except(*query_param_names)
|
|
130
178
|
|
|
179
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
131
180
|
request = Payabli::Internal::JSON::Request.new(
|
|
132
181
|
base_url: request_options[:base_url],
|
|
133
182
|
method: "PUT",
|
|
134
183
|
path: "TokenStorage/#{URI.encode_uri_component(params[:method_id].to_s)}",
|
|
184
|
+
headers: headers,
|
|
135
185
|
query: query_params,
|
|
136
186
|
body: Payabli::Types::RequestTokenStorage.new(body_params).to_h,
|
|
137
187
|
request_options: request_options
|
|
@@ -161,13 +211,18 @@ module Payabli
|
|
|
161
211
|
# @option request_options [Integer] :timeout_in_seconds
|
|
162
212
|
# @option params [String] :method_id
|
|
163
213
|
#
|
|
214
|
+
# @example
|
|
215
|
+
# client.token_storage.remove_method(method_id: "32-8877drt00045632-678")
|
|
216
|
+
#
|
|
164
217
|
# @return [Payabli::Types::PayabliApiResponsePaymethodDelete]
|
|
165
218
|
def remove_method(request_options: {}, **params)
|
|
166
219
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
220
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
167
221
|
request = Payabli::Internal::JSON::Request.new(
|
|
168
222
|
base_url: request_options[:base_url],
|
|
169
223
|
method: "DELETE",
|
|
170
224
|
path: "TokenStorage/#{URI.encode_uri_component(params[:method_id].to_s)}",
|
|
225
|
+
headers: headers,
|
|
171
226
|
request_options: request_options
|
|
172
227
|
)
|
|
173
228
|
begin
|
data/lib/payabli/user/client.rb
CHANGED
|
@@ -20,13 +20,18 @@ module Payabli
|
|
|
20
20
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
21
21
|
# @option request_options [Integer] :timeout_in_seconds
|
|
22
22
|
#
|
|
23
|
+
# @example
|
|
24
|
+
# client.user.add_user
|
|
25
|
+
#
|
|
23
26
|
# @return [Payabli::Types::AddUserResponse]
|
|
24
27
|
def add_user(request_options: {}, **params)
|
|
25
28
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
29
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
26
30
|
request = Payabli::Internal::JSON::Request.new(
|
|
27
31
|
base_url: request_options[:base_url],
|
|
28
32
|
method: "POST",
|
|
29
33
|
path: "User",
|
|
34
|
+
headers: headers,
|
|
30
35
|
body: Payabli::Types::UserData.new(params).to_h,
|
|
31
36
|
request_options: request_options
|
|
32
37
|
)
|
|
@@ -57,6 +62,12 @@ module Payabli
|
|
|
57
62
|
# @option params [String, nil] :entry
|
|
58
63
|
# @option params [Integer, nil] :level
|
|
59
64
|
#
|
|
65
|
+
# @example
|
|
66
|
+
# client.user.get_user(
|
|
67
|
+
# user_id: 1000000,
|
|
68
|
+
# entry: "8cfec329267"
|
|
69
|
+
# )
|
|
70
|
+
#
|
|
60
71
|
# @return [Payabli::Types::UserQueryRecord]
|
|
61
72
|
def get_user(request_options: {}, **params)
|
|
62
73
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -64,10 +75,12 @@ module Payabli
|
|
|
64
75
|
query_params["entry"] = params[:entry] if params.key?(:entry)
|
|
65
76
|
query_params["level"] = params[:level] if params.key?(:level)
|
|
66
77
|
|
|
78
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
67
79
|
request = Payabli::Internal::JSON::Request.new(
|
|
68
80
|
base_url: request_options[:base_url],
|
|
69
81
|
method: "GET",
|
|
70
82
|
path: "User/#{URI.encode_uri_component(params[:user_id].to_s)}",
|
|
83
|
+
headers: headers,
|
|
71
84
|
query: query_params,
|
|
72
85
|
request_options: request_options
|
|
73
86
|
)
|
|
@@ -96,13 +109,18 @@ module Payabli
|
|
|
96
109
|
# @option request_options [Integer] :timeout_in_seconds
|
|
97
110
|
# @option params [Integer] :user_id
|
|
98
111
|
#
|
|
112
|
+
# @example
|
|
113
|
+
# client.user.edit_user(user_id: 1000000)
|
|
114
|
+
#
|
|
99
115
|
# @return [Payabli::Types::PayabliApiResponse]
|
|
100
116
|
def edit_user(request_options: {}, **params)
|
|
101
117
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
118
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
102
119
|
request = Payabli::Internal::JSON::Request.new(
|
|
103
120
|
base_url: request_options[:base_url],
|
|
104
121
|
method: "PUT",
|
|
105
122
|
path: "User/#{URI.encode_uri_component(params[:user_id].to_s)}",
|
|
123
|
+
headers: headers,
|
|
106
124
|
body: Payabli::Types::UserData.new(params).to_h,
|
|
107
125
|
request_options: request_options
|
|
108
126
|
)
|
|
@@ -131,13 +149,18 @@ module Payabli
|
|
|
131
149
|
# @option request_options [Integer] :timeout_in_seconds
|
|
132
150
|
# @option params [Integer] :user_id
|
|
133
151
|
#
|
|
152
|
+
# @example
|
|
153
|
+
# client.user.delete_user(user_id: 1000000)
|
|
154
|
+
#
|
|
134
155
|
# @return [Payabli::Types::DeleteUserResponse]
|
|
135
156
|
def delete_user(request_options: {}, **params)
|
|
136
157
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
158
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
137
159
|
request = Payabli::Internal::JSON::Request.new(
|
|
138
160
|
base_url: request_options[:base_url],
|
|
139
161
|
method: "DELETE",
|
|
140
162
|
path: "User/#{URI.encode_uri_component(params[:user_id].to_s)}",
|
|
163
|
+
headers: headers,
|
|
141
164
|
request_options: request_options
|
|
142
165
|
)
|
|
143
166
|
begin
|
|
@@ -165,6 +188,9 @@ module Payabli
|
|
|
165
188
|
# @option request_options [Integer] :timeout_in_seconds
|
|
166
189
|
# @option params [String] :provider
|
|
167
190
|
#
|
|
191
|
+
# @example
|
|
192
|
+
# client.user.auth_user(provider: "provider")
|
|
193
|
+
#
|
|
168
194
|
# @return [Payabli::Types::PayabliApiResponseMfaBasic]
|
|
169
195
|
def auth_user(request_options: {}, **params)
|
|
170
196
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -172,10 +198,12 @@ module Payabli
|
|
|
172
198
|
non_body_param_names = %w[provider]
|
|
173
199
|
body = request_data.except(*non_body_param_names)
|
|
174
200
|
|
|
201
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
175
202
|
request = Payabli::Internal::JSON::Request.new(
|
|
176
203
|
base_url: request_options[:base_url],
|
|
177
204
|
method: "POST",
|
|
178
205
|
path: "User/auth/#{URI.encode_uri_component(params[:provider].to_s)}",
|
|
206
|
+
headers: headers,
|
|
179
207
|
body: body,
|
|
180
208
|
request_options: request_options
|
|
181
209
|
)
|
|
@@ -203,12 +231,17 @@ module Payabli
|
|
|
203
231
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
204
232
|
# @option request_options [Integer] :timeout_in_seconds
|
|
205
233
|
#
|
|
234
|
+
# @example
|
|
235
|
+
# client.user.auth_refresh_user
|
|
236
|
+
#
|
|
206
237
|
# @return [Payabli::Types::PayabliApiResponseUserMfa]
|
|
207
238
|
def auth_refresh_user(request_options: {}, **_params)
|
|
239
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
208
240
|
request = Payabli::Internal::JSON::Request.new(
|
|
209
241
|
base_url: request_options[:base_url],
|
|
210
242
|
method: "POST",
|
|
211
243
|
path: "User/authrefresh",
|
|
244
|
+
headers: headers,
|
|
212
245
|
request_options: request_options
|
|
213
246
|
)
|
|
214
247
|
begin
|
|
@@ -235,13 +268,18 @@ module Payabli
|
|
|
235
268
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
236
269
|
# @option request_options [Integer] :timeout_in_seconds
|
|
237
270
|
#
|
|
271
|
+
# @example
|
|
272
|
+
# client.user.auth_reset_user
|
|
273
|
+
#
|
|
238
274
|
# @return [Payabli::Types::AuthResetUserResponse]
|
|
239
275
|
def auth_reset_user(request_options: {}, **params)
|
|
240
276
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
277
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
241
278
|
request = Payabli::Internal::JSON::Request.new(
|
|
242
279
|
base_url: request_options[:base_url],
|
|
243
280
|
method: "POST",
|
|
244
281
|
path: "User/authreset",
|
|
282
|
+
headers: headers,
|
|
245
283
|
body: Payabli::User::Types::UserAuthResetRequest.new(params).to_h,
|
|
246
284
|
request_options: request_options
|
|
247
285
|
)
|
|
@@ -269,13 +307,18 @@ module Payabli
|
|
|
269
307
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
270
308
|
# @option request_options [Integer] :timeout_in_seconds
|
|
271
309
|
#
|
|
310
|
+
# @example
|
|
311
|
+
# client.user.change_psw_user
|
|
312
|
+
#
|
|
272
313
|
# @return [Payabli::Types::ChangePswUserResponse]
|
|
273
314
|
def change_psw_user(request_options: {}, **params)
|
|
274
315
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
316
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
275
317
|
request = Payabli::Internal::JSON::Request.new(
|
|
276
318
|
base_url: request_options[:base_url],
|
|
277
319
|
method: "PUT",
|
|
278
320
|
path: "User/authpsw",
|
|
321
|
+
headers: headers,
|
|
279
322
|
body: Payabli::User::Types::UserAuthPswResetRequest.new(params).to_h,
|
|
280
323
|
request_options: request_options
|
|
281
324
|
)
|
|
@@ -303,12 +346,17 @@ module Payabli
|
|
|
303
346
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
304
347
|
# @option request_options [Integer] :timeout_in_seconds
|
|
305
348
|
#
|
|
349
|
+
# @example
|
|
350
|
+
# client.user.logout_user
|
|
351
|
+
#
|
|
306
352
|
# @return [Payabli::Types::LogoutUserResponse]
|
|
307
353
|
def logout_user(request_options: {}, **_params)
|
|
354
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
308
355
|
request = Payabli::Internal::JSON::Request.new(
|
|
309
356
|
base_url: request_options[:base_url],
|
|
310
357
|
method: "GET",
|
|
311
358
|
path: "User/authlogout",
|
|
359
|
+
headers: headers,
|
|
312
360
|
request_options: request_options
|
|
313
361
|
)
|
|
314
362
|
begin
|
|
@@ -335,13 +383,18 @@ module Payabli
|
|
|
335
383
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
336
384
|
# @option request_options [Integer] :timeout_in_seconds
|
|
337
385
|
#
|
|
386
|
+
# @example
|
|
387
|
+
# client.user.validate_mfa_user
|
|
388
|
+
#
|
|
338
389
|
# @return [Payabli::Types::PayabliApiResponseUserMfa]
|
|
339
390
|
def validate_mfa_user(request_options: {}, **params)
|
|
340
391
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
392
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
341
393
|
request = Payabli::Internal::JSON::Request.new(
|
|
342
394
|
base_url: request_options[:base_url],
|
|
343
395
|
method: "POST",
|
|
344
396
|
path: "User/mfa",
|
|
397
|
+
headers: headers,
|
|
345
398
|
body: Payabli::User::Types::MfaValidationData.new(params).to_h,
|
|
346
399
|
request_options: request_options
|
|
347
400
|
)
|
|
@@ -370,13 +423,18 @@ module Payabli
|
|
|
370
423
|
# @option request_options [Integer] :timeout_in_seconds
|
|
371
424
|
# @option params [Integer] :user_id
|
|
372
425
|
#
|
|
426
|
+
# @example
|
|
427
|
+
# client.user.edit_mfa_user(user_id: 1000000)
|
|
428
|
+
#
|
|
373
429
|
# @return [Payabli::Types::EditMfaUserResponse]
|
|
374
430
|
def edit_mfa_user(request_options: {}, **params)
|
|
375
431
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
432
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
376
433
|
request = Payabli::Internal::JSON::Request.new(
|
|
377
434
|
base_url: request_options[:base_url],
|
|
378
435
|
method: "PUT",
|
|
379
436
|
path: "User/mfa/#{URI.encode_uri_component(params[:user_id].to_s)}",
|
|
437
|
+
headers: headers,
|
|
380
438
|
body: Payabli::Types::MfaData.new(params).to_h,
|
|
381
439
|
request_options: request_options
|
|
382
440
|
)
|
|
@@ -407,13 +465,22 @@ module Payabli
|
|
|
407
465
|
# @option params [String] :entry
|
|
408
466
|
# @option params [Integer] :entry_type
|
|
409
467
|
#
|
|
468
|
+
# @example
|
|
469
|
+
# client.user.resend_mfa_code(
|
|
470
|
+
# usrname: "usrname",
|
|
471
|
+
# entry: "8cfec329267",
|
|
472
|
+
# entry_type: 1
|
|
473
|
+
# )
|
|
474
|
+
#
|
|
410
475
|
# @return [Payabli::Types::PayabliApiResponseMfaBasic]
|
|
411
476
|
def resend_mfa_code(request_options: {}, **params)
|
|
412
477
|
params = Payabli::Internal::Types::Utils.normalize_keys(params)
|
|
478
|
+
headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }])
|
|
413
479
|
request = Payabli::Internal::JSON::Request.new(
|
|
414
480
|
base_url: request_options[:base_url],
|
|
415
481
|
method: "POST",
|
|
416
482
|
path: "User/resendmfa/#{URI.encode_uri_component(params[:usrname].to_s)}/#{URI.encode_uri_component(params[:entry].to_s)}/#{URI.encode_uri_component(params[:entry_type].to_s)}",
|
|
483
|
+
headers: headers,
|
|
417
484
|
request_options: request_options
|
|
418
485
|
)
|
|
419
486
|
begin
|