pago-sdk 1.0.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 +7 -0
- data/LICENSE +21 -0
- data/README.md +131 -0
- data/lib/pago/base_client.rb +116 -0
- data/lib/pago/errors.rb +83 -0
- data/lib/pago/http.rb +78 -0
- data/lib/pago/model.rb +86 -0
- data/lib/pago/paginator.rb +67 -0
- data/lib/pago/serde.rb +186 -0
- data/lib/pago/service.rb +17 -0
- data/lib/pago/v2026_04/client.rb +124 -0
- data/lib/pago/v2026_04/enums.rb +4552 -0
- data/lib/pago/v2026_04/errors.rb +1121 -0
- data/lib/pago/v2026_04/models.rb +46344 -0
- data/lib/pago/v2026_04/services/benefit_grants.rb +48 -0
- data/lib/pago/v2026_04/services/benefits.rb +179 -0
- data/lib/pago/v2026_04/services/checkout_links.rb +131 -0
- data/lib/pago/v2026_04/services/checkouts.rb +185 -0
- data/lib/pago/v2026_04/services/custom_fields.rb +132 -0
- data/lib/pago/v2026_04/services/customer_meters.rb +69 -0
- data/lib/pago/v2026_04/services/customer_portal.rb +1181 -0
- data/lib/pago/v2026_04/services/customer_seats.rb +137 -0
- data/lib/pago/v2026_04/services/customer_sessions.rb +35 -0
- data/lib/pago/v2026_04/services/customers.rb +556 -0
- data/lib/pago/v2026_04/services/discounts.rb +131 -0
- data/lib/pago/v2026_04/services/disputes.rb +93 -0
- data/lib/pago/v2026_04/services/event_types.rb +74 -0
- data/lib/pago/v2026_04/services/events.rb +126 -0
- data/lib/pago/v2026_04/services/files.rb +135 -0
- data/lib/pago/v2026_04/services/license_keys.rb +183 -0
- data/lib/pago/v2026_04/services/members.rb +47 -0
- data/lib/pago/v2026_04/services/meters.rb +142 -0
- data/lib/pago/v2026_04/services/metrics.rb +188 -0
- data/lib/pago/v2026_04/services/oauth2.rb +175 -0
- data/lib/pago/v2026_04/services/orders.rb +238 -0
- data/lib/pago/v2026_04/services/organizations.rb +113 -0
- data/lib/pago/v2026_04/services/payments.rb +72 -0
- data/lib/pago/v2026_04/services/products.rb +142 -0
- data/lib/pago/v2026_04/services/refunds.rb +73 -0
- data/lib/pago/v2026_04/services/subscriptions.rb +171 -0
- data/lib/pago/v2026_04/services/webhooks.rb +212 -0
- data/lib/pago/v2026_04/unions.rb +739 -0
- data/lib/pago/v2026_04/webhooks.rb +86 -0
- data/lib/pago/version.rb +5 -0
- data/lib/pago/webhooks.rb +159 -0
- data/lib/pago.rb +39 -0
- data/sig/pago/v2026_04/generated.rbs +12401 -0
- data/sig/pago.rbs +204 -0
- metadata +91 -0
data/sig/pago.rbs
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
module Pago
|
|
2
|
+
VERSION: String
|
|
3
|
+
LATEST_API_VERSION: String
|
|
4
|
+
|
|
5
|
+
class Client = V2026_04::Client
|
|
6
|
+
module Models = V2026_04::Models
|
|
7
|
+
module Enums = V2026_04::Enums
|
|
8
|
+
module Unions = V2026_04::Unions
|
|
9
|
+
module Errors = V2026_04::Errors
|
|
10
|
+
module Webhooks = V2026_04::Webhooks
|
|
11
|
+
module Services = V2026_04::Services
|
|
12
|
+
|
|
13
|
+
UNSET: Object
|
|
14
|
+
|
|
15
|
+
STATUS_ERROR_CLASSES: Hash[Integer, Class]
|
|
16
|
+
|
|
17
|
+
def self.error_class_for: (Integer status_code) -> Class
|
|
18
|
+
|
|
19
|
+
class Error < StandardError
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class NetworkError < Error
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
class TimeoutError < NetworkError
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class SerializationError < Error
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
class APIError < Error
|
|
32
|
+
attr_reader status_code: Integer?
|
|
33
|
+
attr_reader data: untyped
|
|
34
|
+
attr_reader body: untyped
|
|
35
|
+
attr_reader response: untyped
|
|
36
|
+
|
|
37
|
+
def initialize: (?String? message, ?status_code: Integer?, ?data: untyped, ?body: untyped, ?response: untyped) -> void
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
class ClientError < APIError
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
class BadRequestError < ClientError
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class AuthenticationError < ClientError
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
class PaymentRequiredError < ClientError
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
class PermissionDeniedError < ClientError
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
class NotFoundError < ClientError
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class ConflictError < ClientError
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
class GoneError < ClientError
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
class PreconditionFailedError < ClientError
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
class UnprocessableEntityError < ClientError
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
class RateLimitError < ClientError
|
|
71
|
+
attr_reader retry_after: Integer?
|
|
72
|
+
|
|
73
|
+
def initialize: (?String? message, ?retry_after: Integer?, **untyped options) -> void
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
class ServerError < APIError
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
class WebhookError < Error
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
class WebhookVerificationError < WebhookError
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class WebhookSecretError < WebhookVerificationError
|
|
86
|
+
def initialize: (?String? reason) -> void
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
class WebhookUnknownTypeError < WebhookError
|
|
90
|
+
attr_reader event_type: String?
|
|
91
|
+
|
|
92
|
+
def initialize: (String? event_type) -> void
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
module Serde
|
|
96
|
+
def self.object: (untyped data) -> Hash[String, untyped]?
|
|
97
|
+
def self.array: (untyped value) { (untyped item) -> untyped } -> Array[untyped]?
|
|
98
|
+
def self.map: (untyped value) { (untyped item) -> untyped } -> Hash[untyped, untyped]?
|
|
99
|
+
def self.dump: (untyped value) -> untyped
|
|
100
|
+
def self.union: (untyped data, ?discriminator: String?, ?mapping: Hash[untyped, untyped]?, ?variants: Array[untyped]) -> untyped
|
|
101
|
+
def self.candidates: (Hash[untyped, untyped] data, Array[untyped] variants, ?Array[untyped] seen) -> Array[untyped]
|
|
102
|
+
def self.best_variant: (Hash[untyped, untyped] data, Array[untyped] variants) -> Class?
|
|
103
|
+
def self.union_module?: (untyped variant) -> bool
|
|
104
|
+
def self.tagged?: (Hash[untyped, untyped] data, Module union_module) -> bool
|
|
105
|
+
def self.dispatch_variant: (Hash[untyped, untyped] data, Module union_module) -> untyped
|
|
106
|
+
def self.path: (String template, ?Hash[String, untyped] params) -> String
|
|
107
|
+
def self.query: (?Hash[untyped, untyped] params) -> Array[[String, String]]
|
|
108
|
+
def self.scalar: (untyped value) -> String
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
class Model
|
|
112
|
+
JSON_KEYS: Hash[Symbol, String]
|
|
113
|
+
REQUIRED_KEYS: Array[String]
|
|
114
|
+
|
|
115
|
+
def self.json_keys: () -> Hash[Symbol, String]
|
|
116
|
+
def self.required_json_keys: () -> Array[String]
|
|
117
|
+
def self.from_json: (untyped data) -> Model?
|
|
118
|
+
def self.wrap_raw: (Model instance, Hash[String, untyped] data) -> Model
|
|
119
|
+
|
|
120
|
+
def initialize: () -> void
|
|
121
|
+
def field_set?: ((Symbol | String) name) -> bool
|
|
122
|
+
def to_json_hash: () -> Hash[String, untyped]
|
|
123
|
+
def to_h: () -> Hash[String, untyped]
|
|
124
|
+
def to_json: (*untyped) -> String
|
|
125
|
+
def []: ((Symbol | String) key) -> untyped
|
|
126
|
+
def ==: (untyped other) -> bool
|
|
127
|
+
def eql?: (untyped other) -> bool
|
|
128
|
+
def hash: () -> Integer
|
|
129
|
+
def inspect: () -> String
|
|
130
|
+
def assign: (Symbol name, untyped value) -> void
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
module HTTP
|
|
134
|
+
NET_HTTP_CLASSES: Hash[String, Class]
|
|
135
|
+
|
|
136
|
+
class Request
|
|
137
|
+
attr_accessor http_method: String
|
|
138
|
+
attr_accessor url: String
|
|
139
|
+
attr_accessor headers: Hash[String, String]
|
|
140
|
+
attr_accessor body: String?
|
|
141
|
+
|
|
142
|
+
def initialize: (?http_method: String, ?url: String, ?headers: Hash[String, String], ?body: String?) -> void
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
class Response
|
|
146
|
+
attr_accessor status: Integer
|
|
147
|
+
attr_accessor headers: Hash[String, String]
|
|
148
|
+
attr_accessor body: String
|
|
149
|
+
|
|
150
|
+
def initialize: (?status: Integer, ?headers: Hash[String, String], ?body: String) -> void
|
|
151
|
+
def success?: () -> bool
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
class NetHTTPAdapter
|
|
155
|
+
def initialize: (?open_timeout: Integer, ?read_timeout: Integer) -> void
|
|
156
|
+
def call: (Request request) -> Response
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
class BaseClient
|
|
161
|
+
DEFAULT_BASE_URL: String
|
|
162
|
+
SANDBOX_BASE_URL: String
|
|
163
|
+
API_VERSION: String?
|
|
164
|
+
|
|
165
|
+
attr_reader base_url: String
|
|
166
|
+
attr_reader adapter: untyped
|
|
167
|
+
|
|
168
|
+
def initialize: (?access_token: String?, ?base_url: String?, ?adapter: untyped, ?headers: Hash[String, String]) -> void
|
|
169
|
+
def api_version: () -> String?
|
|
170
|
+
def request: (http_method: String, path: String, ?path_params: Hash[String, untyped], ?query: Hash[String, untyped], ?body: untyped, ?response_type: Symbol, ?errors: Hash[Integer, Class]) -> untyped
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
class Service
|
|
174
|
+
attr_reader client: BaseClient
|
|
175
|
+
|
|
176
|
+
def initialize: (BaseClient client) -> void
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
class Paginator
|
|
180
|
+
include Enumerable[untyped]
|
|
181
|
+
|
|
182
|
+
def initialize: () { (Integer page) -> untyped } -> void
|
|
183
|
+
def each: () ?{ (untyped item) -> void } -> untyped
|
|
184
|
+
def pages: () ?{ (untyped page) -> void } -> untyped
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
module WebhookVerifier
|
|
188
|
+
TOLERANCE_SECONDS: Integer
|
|
189
|
+
SIGNATURE_VERSION: String
|
|
190
|
+
SECRET_PREFIX: String
|
|
191
|
+
|
|
192
|
+
def self.verify: (body: String, headers: Hash[untyped, untyped], secret: String) -> Hash[String, untyped]
|
|
193
|
+
def self.normalize_body: (untyped body) -> String
|
|
194
|
+
def self.parse: (String payload) -> Hash[String, untyped]
|
|
195
|
+
def self.verify_signature: (String body, Hash[untyped, untyped] headers, String secret) -> void
|
|
196
|
+
def self.derive_key: (untyped secret) -> String
|
|
197
|
+
def self.parse_timestamp: (untyped value) -> Integer
|
|
198
|
+
def self.check_tolerance: (Integer seconds) -> void
|
|
199
|
+
def self.match?: (String candidate, String expected) -> bool
|
|
200
|
+
def self.secure_compare: (String left, String right) -> bool
|
|
201
|
+
def self.decode_base64: (untyped value) -> String?
|
|
202
|
+
def self.blank?: (untyped value) -> bool
|
|
203
|
+
end
|
|
204
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: pago-sdk
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Pago
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: Ruby SDK for the Pago API, generated from its OpenAPI specification.
|
|
13
|
+
email:
|
|
14
|
+
- contact@pago.sh
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- LICENSE
|
|
20
|
+
- README.md
|
|
21
|
+
- lib/pago.rb
|
|
22
|
+
- lib/pago/base_client.rb
|
|
23
|
+
- lib/pago/errors.rb
|
|
24
|
+
- lib/pago/http.rb
|
|
25
|
+
- lib/pago/model.rb
|
|
26
|
+
- lib/pago/paginator.rb
|
|
27
|
+
- lib/pago/serde.rb
|
|
28
|
+
- lib/pago/service.rb
|
|
29
|
+
- lib/pago/v2026_04/client.rb
|
|
30
|
+
- lib/pago/v2026_04/enums.rb
|
|
31
|
+
- lib/pago/v2026_04/errors.rb
|
|
32
|
+
- lib/pago/v2026_04/models.rb
|
|
33
|
+
- lib/pago/v2026_04/services/benefit_grants.rb
|
|
34
|
+
- lib/pago/v2026_04/services/benefits.rb
|
|
35
|
+
- lib/pago/v2026_04/services/checkout_links.rb
|
|
36
|
+
- lib/pago/v2026_04/services/checkouts.rb
|
|
37
|
+
- lib/pago/v2026_04/services/custom_fields.rb
|
|
38
|
+
- lib/pago/v2026_04/services/customer_meters.rb
|
|
39
|
+
- lib/pago/v2026_04/services/customer_portal.rb
|
|
40
|
+
- lib/pago/v2026_04/services/customer_seats.rb
|
|
41
|
+
- lib/pago/v2026_04/services/customer_sessions.rb
|
|
42
|
+
- lib/pago/v2026_04/services/customers.rb
|
|
43
|
+
- lib/pago/v2026_04/services/discounts.rb
|
|
44
|
+
- lib/pago/v2026_04/services/disputes.rb
|
|
45
|
+
- lib/pago/v2026_04/services/event_types.rb
|
|
46
|
+
- lib/pago/v2026_04/services/events.rb
|
|
47
|
+
- lib/pago/v2026_04/services/files.rb
|
|
48
|
+
- lib/pago/v2026_04/services/license_keys.rb
|
|
49
|
+
- lib/pago/v2026_04/services/members.rb
|
|
50
|
+
- lib/pago/v2026_04/services/meters.rb
|
|
51
|
+
- lib/pago/v2026_04/services/metrics.rb
|
|
52
|
+
- lib/pago/v2026_04/services/oauth2.rb
|
|
53
|
+
- lib/pago/v2026_04/services/orders.rb
|
|
54
|
+
- lib/pago/v2026_04/services/organizations.rb
|
|
55
|
+
- lib/pago/v2026_04/services/payments.rb
|
|
56
|
+
- lib/pago/v2026_04/services/products.rb
|
|
57
|
+
- lib/pago/v2026_04/services/refunds.rb
|
|
58
|
+
- lib/pago/v2026_04/services/subscriptions.rb
|
|
59
|
+
- lib/pago/v2026_04/services/webhooks.rb
|
|
60
|
+
- lib/pago/v2026_04/unions.rb
|
|
61
|
+
- lib/pago/v2026_04/webhooks.rb
|
|
62
|
+
- lib/pago/version.rb
|
|
63
|
+
- lib/pago/webhooks.rb
|
|
64
|
+
- sig/pago.rbs
|
|
65
|
+
- sig/pago/v2026_04/generated.rbs
|
|
66
|
+
homepage: https://pago.sh
|
|
67
|
+
licenses:
|
|
68
|
+
- MIT
|
|
69
|
+
metadata:
|
|
70
|
+
homepage_uri: https://pago.sh
|
|
71
|
+
source_code_uri: https://github.com/pago-sh/pago/tree/main/sdk/ruby
|
|
72
|
+
documentation_uri: https://docs.pago.sh
|
|
73
|
+
rubygems_mfa_required: 'true'
|
|
74
|
+
rdoc_options: []
|
|
75
|
+
require_paths:
|
|
76
|
+
- lib
|
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: 3.1.0
|
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: '0'
|
|
87
|
+
requirements: []
|
|
88
|
+
rubygems_version: 4.0.16
|
|
89
|
+
specification_version: 4
|
|
90
|
+
summary: Pago SDK — A billing platform for the intelligence era
|
|
91
|
+
test_files: []
|