payabli 3.0.4 → 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/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 +8 -6
- 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 +8 -2
- 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/types/application_data.rb +1 -1
- data/lib/payabli/types/application_data_managed.rb +1 -1
- data/lib/payabli/types/application_data_odp.rb +1 -1
- data/lib/payabli/types/application_data_pay_in.rb +1 -1
- data/lib/payabli/types/on_create.rb +1 -1
- data/lib/payabli/types/pay_method_body_all_fields.rb +1 -1
- 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 +1 -0
- data/reference.md +219 -219
- data/wiremock/wiremock-mappings.json +32 -1302
- metadata +3 -2
|
@@ -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
|
|
@@ -113,7 +113,7 @@ module Payabli
|
|
|
113
113
|
|
|
114
114
|
field :rep_office, -> { String }, optional: true, nullable: false, api_name: "RepOffice"
|
|
115
115
|
|
|
116
|
-
field :on_create, -> { String }, optional: true, nullable: false, api_name: "onCreate"
|
|
116
|
+
field :on_create, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "onCreate"
|
|
117
117
|
end
|
|
118
118
|
end
|
|
119
119
|
end
|
|
@@ -83,7 +83,7 @@ module Payabli
|
|
|
83
83
|
|
|
84
84
|
field :rep_office, -> { String }, optional: true, nullable: false, api_name: "RepOffice"
|
|
85
85
|
|
|
86
|
-
field :on_create, -> { String }, optional: true, nullable: false, api_name: "onCreate"
|
|
86
|
+
field :on_create, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "onCreate"
|
|
87
87
|
end
|
|
88
88
|
end
|
|
89
89
|
end
|
|
@@ -95,7 +95,7 @@ module Payabli
|
|
|
95
95
|
|
|
96
96
|
field :rep_office, -> { String }, optional: true, nullable: false, api_name: "RepOffice"
|
|
97
97
|
|
|
98
|
-
field :on_create, -> { String }, optional: true, nullable: false, api_name: "onCreate"
|
|
98
|
+
field :on_create, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "onCreate"
|
|
99
99
|
end
|
|
100
100
|
end
|
|
101
101
|
end
|
|
@@ -116,7 +116,7 @@ module Payabli
|
|
|
116
116
|
|
|
117
117
|
field :rep_office, -> { String }, optional: true, nullable: false, api_name: "RepOffice"
|
|
118
118
|
|
|
119
|
-
field :on_create, -> { String }, optional: true, nullable: false, api_name: "onCreate"
|
|
119
|
+
field :on_create, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "onCreate"
|
|
120
120
|
end
|
|
121
121
|
end
|
|
122
122
|
end
|
|
@@ -26,7 +26,7 @@ module Payabli
|
|
|
26
26
|
|
|
27
27
|
field :device, -> { String }, optional: true, nullable: false
|
|
28
28
|
|
|
29
|
-
field :
|
|
29
|
+
field :initiator, -> { String }, optional: true, nullable: false
|
|
30
30
|
|
|
31
31
|
field :method_, -> { Payabli::Types::Methodall }, optional: true, nullable: false, api_name: "method"
|
|
32
32
|
|