dodopayments 1.20.0 → 1.22.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 +32 -0
- data/README.md +2 -2
- data/lib/dodopayments/client.rb +9 -8
- data/lib/dodopayments/internal/default_page_number_pagination.rb +2 -2
- data/lib/dodopayments/internal/transport/base_client.rb +2 -2
- data/lib/dodopayments/internal/type/base_model.rb +1 -9
- data/lib/dodopayments/internal/type/request_parameters.rb +2 -8
- data/lib/dodopayments/internal/util.rb +17 -1
- data/lib/dodopayments/models/dispute.rb +9 -2
- data/lib/dodopayments/models/dispute_list_response.rb +76 -0
- data/lib/dodopayments/models/dispute_retrieve_response.rb +99 -0
- data/lib/dodopayments/models/payment.rb +33 -1
- data/lib/dodopayments/models/subscription_change_plan_params.rb +31 -1
- data/lib/dodopayments/models.rb +167 -0
- data/lib/dodopayments/resources/disputes.rb +4 -4
- data/lib/dodopayments/resources/invoices/payments.rb +3 -2
- data/lib/dodopayments/resources/subscriptions.rb +6 -1
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +2 -0
- data/rbi/dodopayments/client.rbi +5 -4
- data/rbi/dodopayments/internal/util.rbi +5 -1
- data/rbi/dodopayments/models/dispute.rbi +11 -3
- data/rbi/dodopayments/models/dispute_list_response.rbi +85 -0
- data/rbi/dodopayments/models/dispute_retrieve_response.rbi +112 -0
- data/rbi/dodopayments/models/payment.rbi +32 -0
- data/rbi/dodopayments/models/subscription_change_plan_params.rbi +26 -0
- data/rbi/dodopayments/models.rbi +167 -0
- data/rbi/dodopayments/resources/disputes.rbi +2 -2
- data/rbi/dodopayments/resources/invoices/payments.rbi +1 -1
- data/rbi/dodopayments/resources/subscriptions.rbi +6 -0
- data/sig/dodopayments/client.rbs +2 -2
- data/sig/dodopayments/internal/util.rbs +2 -0
- data/sig/dodopayments/models/dispute.rbs +6 -2
- data/sig/dodopayments/models/dispute_list_response.rbs +46 -0
- data/sig/dodopayments/models/dispute_retrieve_response.rbs +58 -0
- data/sig/dodopayments/models/payment.rbs +16 -0
- data/sig/dodopayments/models/subscription_change_plan_params.rbs +17 -1
- data/sig/dodopayments/models.rbs +165 -0
- data/sig/dodopayments/resources/disputes.rbs +2 -2
- data/sig/dodopayments/resources/invoices/payments.rbs +1 -1
- data/sig/dodopayments/resources/subscriptions.rbs +1 -0
- metadata +11 -2
@@ -0,0 +1,167 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
AddonCartResponseItem = Dodopayments::Models::AddonCartResponseItem
|
5
|
+
|
6
|
+
AddonCreateParams = Dodopayments::Models::AddonCreateParams
|
7
|
+
|
8
|
+
AddonListParams = Dodopayments::Models::AddonListParams
|
9
|
+
|
10
|
+
AddonResponse = Dodopayments::Models::AddonResponse
|
11
|
+
|
12
|
+
AddonRetrieveParams = Dodopayments::Models::AddonRetrieveParams
|
13
|
+
|
14
|
+
AddonUpdateImagesParams = Dodopayments::Models::AddonUpdateImagesParams
|
15
|
+
|
16
|
+
AddonUpdateParams = Dodopayments::Models::AddonUpdateParams
|
17
|
+
|
18
|
+
AttachExistingCustomer = Dodopayments::Models::AttachExistingCustomer
|
19
|
+
|
20
|
+
BillingAddress = Dodopayments::Models::BillingAddress
|
21
|
+
|
22
|
+
CountryCode = Dodopayments::Models::CountryCode
|
23
|
+
|
24
|
+
CreateNewCustomer = Dodopayments::Models::CreateNewCustomer
|
25
|
+
|
26
|
+
Currency = Dodopayments::Models::Currency
|
27
|
+
|
28
|
+
Customer = Dodopayments::Models::Customer
|
29
|
+
|
30
|
+
CustomerCreateParams = Dodopayments::Models::CustomerCreateParams
|
31
|
+
|
32
|
+
CustomerLimitedDetails = Dodopayments::Models::CustomerLimitedDetails
|
33
|
+
|
34
|
+
CustomerListParams = Dodopayments::Models::CustomerListParams
|
35
|
+
|
36
|
+
CustomerPortalSession = Dodopayments::Models::CustomerPortalSession
|
37
|
+
|
38
|
+
CustomerRequest = Dodopayments::Models::CustomerRequest
|
39
|
+
|
40
|
+
CustomerRetrieveParams = Dodopayments::Models::CustomerRetrieveParams
|
41
|
+
|
42
|
+
Customers = Dodopayments::Models::Customers
|
43
|
+
|
44
|
+
CustomerUpdateParams = Dodopayments::Models::CustomerUpdateParams
|
45
|
+
|
46
|
+
Discount = Dodopayments::Models::Discount
|
47
|
+
|
48
|
+
DiscountCreateParams = Dodopayments::Models::DiscountCreateParams
|
49
|
+
|
50
|
+
DiscountDeleteParams = Dodopayments::Models::DiscountDeleteParams
|
51
|
+
|
52
|
+
DiscountListParams = Dodopayments::Models::DiscountListParams
|
53
|
+
|
54
|
+
DiscountRetrieveParams = Dodopayments::Models::DiscountRetrieveParams
|
55
|
+
|
56
|
+
DiscountType = Dodopayments::Models::DiscountType
|
57
|
+
|
58
|
+
DiscountUpdateParams = Dodopayments::Models::DiscountUpdateParams
|
59
|
+
|
60
|
+
Dispute = Dodopayments::Models::Dispute
|
61
|
+
|
62
|
+
DisputeListParams = Dodopayments::Models::DisputeListParams
|
63
|
+
|
64
|
+
DisputeRetrieveParams = Dodopayments::Models::DisputeRetrieveParams
|
65
|
+
|
66
|
+
DisputeStage = Dodopayments::Models::DisputeStage
|
67
|
+
|
68
|
+
DisputeStatus = Dodopayments::Models::DisputeStatus
|
69
|
+
|
70
|
+
IntentStatus = Dodopayments::Models::IntentStatus
|
71
|
+
|
72
|
+
Invoices = Dodopayments::Models::Invoices
|
73
|
+
|
74
|
+
LicenseActivateParams = Dodopayments::Models::LicenseActivateParams
|
75
|
+
|
76
|
+
LicenseDeactivateParams = Dodopayments::Models::LicenseDeactivateParams
|
77
|
+
|
78
|
+
LicenseKey = Dodopayments::Models::LicenseKey
|
79
|
+
|
80
|
+
LicenseKeyDuration = Dodopayments::Models::LicenseKeyDuration
|
81
|
+
|
82
|
+
LicenseKeyInstance = Dodopayments::Models::LicenseKeyInstance
|
83
|
+
|
84
|
+
LicenseKeyInstanceListParams = Dodopayments::Models::LicenseKeyInstanceListParams
|
85
|
+
|
86
|
+
LicenseKeyInstanceRetrieveParams = Dodopayments::Models::LicenseKeyInstanceRetrieveParams
|
87
|
+
|
88
|
+
LicenseKeyInstanceUpdateParams = Dodopayments::Models::LicenseKeyInstanceUpdateParams
|
89
|
+
|
90
|
+
LicenseKeyListParams = Dodopayments::Models::LicenseKeyListParams
|
91
|
+
|
92
|
+
LicenseKeyRetrieveParams = Dodopayments::Models::LicenseKeyRetrieveParams
|
93
|
+
|
94
|
+
LicenseKeyStatus = Dodopayments::Models::LicenseKeyStatus
|
95
|
+
|
96
|
+
LicenseKeyUpdateParams = Dodopayments::Models::LicenseKeyUpdateParams
|
97
|
+
|
98
|
+
LicenseValidateParams = Dodopayments::Models::LicenseValidateParams
|
99
|
+
|
100
|
+
MiscListSupportedCountriesParams = Dodopayments::Models::MiscListSupportedCountriesParams
|
101
|
+
|
102
|
+
OneTimeProductCartItem = Dodopayments::Models::OneTimeProductCartItem
|
103
|
+
|
104
|
+
Payment = Dodopayments::Models::Payment
|
105
|
+
|
106
|
+
PaymentCreateParams = Dodopayments::Models::PaymentCreateParams
|
107
|
+
|
108
|
+
PaymentListParams = Dodopayments::Models::PaymentListParams
|
109
|
+
|
110
|
+
PaymentRetrieveParams = Dodopayments::Models::PaymentRetrieveParams
|
111
|
+
|
112
|
+
PayoutListParams = Dodopayments::Models::PayoutListParams
|
113
|
+
|
114
|
+
Price = Dodopayments::Models::Price
|
115
|
+
|
116
|
+
Product = Dodopayments::Models::Product
|
117
|
+
|
118
|
+
ProductCreateParams = Dodopayments::Models::ProductCreateParams
|
119
|
+
|
120
|
+
ProductDeleteParams = Dodopayments::Models::ProductDeleteParams
|
121
|
+
|
122
|
+
ProductListParams = Dodopayments::Models::ProductListParams
|
123
|
+
|
124
|
+
ProductRetrieveParams = Dodopayments::Models::ProductRetrieveParams
|
125
|
+
|
126
|
+
Products = Dodopayments::Models::Products
|
127
|
+
|
128
|
+
ProductUnarchiveParams = Dodopayments::Models::ProductUnarchiveParams
|
129
|
+
|
130
|
+
ProductUpdateParams = Dodopayments::Models::ProductUpdateParams
|
131
|
+
|
132
|
+
Refund = Dodopayments::Models::Refund
|
133
|
+
|
134
|
+
RefundCreateParams = Dodopayments::Models::RefundCreateParams
|
135
|
+
|
136
|
+
RefundListParams = Dodopayments::Models::RefundListParams
|
137
|
+
|
138
|
+
RefundRetrieveParams = Dodopayments::Models::RefundRetrieveParams
|
139
|
+
|
140
|
+
RefundStatus = Dodopayments::Models::RefundStatus
|
141
|
+
|
142
|
+
Subscription = Dodopayments::Models::Subscription
|
143
|
+
|
144
|
+
SubscriptionChangePlanParams = Dodopayments::Models::SubscriptionChangePlanParams
|
145
|
+
|
146
|
+
SubscriptionChargeParams = Dodopayments::Models::SubscriptionChargeParams
|
147
|
+
|
148
|
+
SubscriptionCreateParams = Dodopayments::Models::SubscriptionCreateParams
|
149
|
+
|
150
|
+
SubscriptionListParams = Dodopayments::Models::SubscriptionListParams
|
151
|
+
|
152
|
+
SubscriptionRetrieveParams = Dodopayments::Models::SubscriptionRetrieveParams
|
153
|
+
|
154
|
+
SubscriptionStatus = Dodopayments::Models::SubscriptionStatus
|
155
|
+
|
156
|
+
SubscriptionUpdateParams = Dodopayments::Models::SubscriptionUpdateParams
|
157
|
+
|
158
|
+
TaxCategory = Dodopayments::Models::TaxCategory
|
159
|
+
|
160
|
+
TimeInterval = Dodopayments::Models::TimeInterval
|
161
|
+
|
162
|
+
WebhookEvent = Dodopayments::Models::WebhookEvent
|
163
|
+
|
164
|
+
WebhookEventListParams = Dodopayments::Models::WebhookEventListParams
|
165
|
+
|
166
|
+
WebhookEventRetrieveParams = Dodopayments::Models::WebhookEventRetrieveParams
|
167
|
+
end
|
@@ -9,14 +9,14 @@ module Dodopayments
|
|
9
9
|
#
|
10
10
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
11
11
|
#
|
12
|
-
# @return [Dodopayments::Models::
|
12
|
+
# @return [Dodopayments::Models::DisputeRetrieveResponse]
|
13
13
|
#
|
14
14
|
# @see Dodopayments::Models::DisputeRetrieveParams
|
15
15
|
def retrieve(dispute_id, params = {})
|
16
16
|
@client.request(
|
17
17
|
method: :get,
|
18
18
|
path: ["disputes/%1$s", dispute_id],
|
19
|
-
model: Dodopayments::Models::
|
19
|
+
model: Dodopayments::Models::DisputeRetrieveResponse,
|
20
20
|
options: params[:request_options]
|
21
21
|
)
|
22
22
|
end
|
@@ -39,7 +39,7 @@ module Dodopayments
|
|
39
39
|
#
|
40
40
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
41
41
|
#
|
42
|
-
# @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::
|
42
|
+
# @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::DisputeListResponse>]
|
43
43
|
#
|
44
44
|
# @see Dodopayments::Models::DisputeListParams
|
45
45
|
def list(params = {})
|
@@ -49,7 +49,7 @@ module Dodopayments
|
|
49
49
|
path: "disputes",
|
50
50
|
query: parsed,
|
51
51
|
page: Dodopayments::Internal::DefaultPageNumberPagination,
|
52
|
-
model: Dodopayments::Models::
|
52
|
+
model: Dodopayments::Models::DisputeListResponse,
|
53
53
|
options: options
|
54
54
|
)
|
55
55
|
end
|
@@ -9,14 +9,15 @@ module Dodopayments
|
|
9
9
|
# @param payment_id [String]
|
10
10
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
11
11
|
#
|
12
|
-
# @return [
|
12
|
+
# @return [StringIO]
|
13
13
|
#
|
14
14
|
# @see Dodopayments::Models::Invoices::PaymentRetrieveParams
|
15
15
|
def retrieve(payment_id, params = {})
|
16
16
|
@client.request(
|
17
17
|
method: :get,
|
18
18
|
path: ["invoices/payments/%1$s", payment_id],
|
19
|
-
|
19
|
+
headers: {"accept" => "application/pdf"},
|
20
|
+
model: StringIO,
|
20
21
|
options: params[:request_options]
|
21
22
|
)
|
22
23
|
end
|
@@ -134,7 +134,10 @@ module Dodopayments
|
|
134
134
|
)
|
135
135
|
end
|
136
136
|
|
137
|
-
#
|
137
|
+
# Some parameter documentations has been truncated, see
|
138
|
+
# {Dodopayments::Models::SubscriptionChangePlanParams} for more details.
|
139
|
+
#
|
140
|
+
# @overload change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, addons: nil, request_options: {})
|
138
141
|
#
|
139
142
|
# @param subscription_id [String] Subscription Id
|
140
143
|
#
|
@@ -144,6 +147,8 @@ module Dodopayments
|
|
144
147
|
#
|
145
148
|
# @param quantity [Integer] Number of units to subscribe for. Must be at least 1.
|
146
149
|
#
|
150
|
+
# @param addons [Array<Dodopayments::Models::SubscriptionChangePlanParams::Addon>, nil] Addons for the new plan. ...
|
151
|
+
#
|
147
152
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
148
153
|
#
|
149
154
|
# @return [nil]
|
data/lib/dodopayments/version.rb
CHANGED
data/lib/dodopayments.rb
CHANGED
@@ -78,7 +78,9 @@ require_relative "dodopayments/models/discount_type"
|
|
78
78
|
require_relative "dodopayments/models/discount_update_params"
|
79
79
|
require_relative "dodopayments/models/dispute"
|
80
80
|
require_relative "dodopayments/models/dispute_list_params"
|
81
|
+
require_relative "dodopayments/models/dispute_list_response"
|
81
82
|
require_relative "dodopayments/models/dispute_retrieve_params"
|
83
|
+
require_relative "dodopayments/models/dispute_retrieve_response"
|
82
84
|
require_relative "dodopayments/models/dispute_stage"
|
83
85
|
require_relative "dodopayments/models/dispute_status"
|
84
86
|
require_relative "dodopayments/models/intent_status"
|
data/rbi/dodopayments/client.rbi
CHANGED
@@ -16,8 +16,9 @@ module Dodopayments
|
|
16
16
|
T::Hash[Symbol, String]
|
17
17
|
)
|
18
18
|
|
19
|
+
# Bearer Token for API authentication
|
19
20
|
sig { returns(String) }
|
20
|
-
attr_reader :
|
21
|
+
attr_reader :bearer_token
|
21
22
|
|
22
23
|
sig { returns(Dodopayments::Resources::Payments) }
|
23
24
|
attr_reader :payments
|
@@ -71,7 +72,7 @@ module Dodopayments
|
|
71
72
|
# Creates and returns a new client for interacting with the API.
|
72
73
|
sig do
|
73
74
|
params(
|
74
|
-
|
75
|
+
bearer_token: T.nilable(String),
|
75
76
|
environment: NilClass,
|
76
77
|
base_url: T.nilable(String),
|
77
78
|
max_retries: Integer,
|
@@ -82,8 +83,8 @@ module Dodopayments
|
|
82
83
|
.returns(T.attached_class)
|
83
84
|
end
|
84
85
|
def self.new(
|
85
|
-
# Defaults to `ENV["DODO_PAYMENTS_API_KEY"]`
|
86
|
-
|
86
|
+
# Bearer Token for API authentication Defaults to `ENV["DODO_PAYMENTS_API_KEY"]`
|
87
|
+
bearer_token: ENV["DODO_PAYMENTS_API_KEY"],
|
87
88
|
# Specifies the environment to use for the API.
|
88
89
|
#
|
89
90
|
# Each environment maps to a different base URL:
|
@@ -42,6 +42,10 @@ module Dodopayments
|
|
42
42
|
# @api private
|
43
43
|
sig { params(input: T.anything).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) }
|
44
44
|
def coerce_hash(input); end
|
45
|
+
|
46
|
+
# @api private
|
47
|
+
sig { params(input: T.anything).returns(T.nilable(T::Hash[T.anything, T.anything])) }
|
48
|
+
def coerce_hash!(input); end
|
45
49
|
end
|
46
50
|
|
47
51
|
class << self
|
@@ -186,7 +190,7 @@ module Dodopayments
|
|
186
190
|
end
|
187
191
|
|
188
192
|
JSON_CONTENT = T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp)
|
189
|
-
JSONL_CONTENT = T.let(%r{^application/(?:x-)?jsonl}, Regexp)
|
193
|
+
JSONL_CONTENT = T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
|
190
194
|
|
191
195
|
class << self
|
192
196
|
# @api private
|
@@ -34,6 +34,10 @@ module Dodopayments
|
|
34
34
|
sig { returns(String) }
|
35
35
|
attr_accessor :payment_id
|
36
36
|
|
37
|
+
# Remarks
|
38
|
+
sig { returns(T.nilable(String)) }
|
39
|
+
attr_accessor :remarks
|
40
|
+
|
37
41
|
sig do
|
38
42
|
params(
|
39
43
|
amount: String,
|
@@ -43,7 +47,8 @@ module Dodopayments
|
|
43
47
|
dispute_id: String,
|
44
48
|
dispute_stage: Dodopayments::Models::DisputeStage::OrSymbol,
|
45
49
|
dispute_status: Dodopayments::Models::DisputeStatus::OrSymbol,
|
46
|
-
payment_id: String
|
50
|
+
payment_id: String,
|
51
|
+
remarks: T.nilable(String)
|
47
52
|
)
|
48
53
|
.returns(T.attached_class)
|
49
54
|
end
|
@@ -62,7 +67,9 @@ module Dodopayments
|
|
62
67
|
dispute_stage:,
|
63
68
|
dispute_status:,
|
64
69
|
# The unique identifier of the payment associated with the dispute.
|
65
|
-
payment_id
|
70
|
+
payment_id:,
|
71
|
+
# Remarks
|
72
|
+
remarks: nil
|
66
73
|
); end
|
67
74
|
sig do
|
68
75
|
override
|
@@ -75,7 +82,8 @@ module Dodopayments
|
|
75
82
|
dispute_id: String,
|
76
83
|
dispute_stage: Dodopayments::Models::DisputeStage::TaggedSymbol,
|
77
84
|
dispute_status: Dodopayments::Models::DisputeStatus::TaggedSymbol,
|
78
|
-
payment_id: String
|
85
|
+
payment_id: String,
|
86
|
+
remarks: T.nilable(String)
|
79
87
|
}
|
80
88
|
)
|
81
89
|
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class DisputeListResponse < Dodopayments::Internal::Type::BaseModel
|
6
|
+
# The amount involved in the dispute, represented as a string to accommodate
|
7
|
+
# precision.
|
8
|
+
sig { returns(String) }
|
9
|
+
attr_accessor :amount
|
10
|
+
|
11
|
+
# The unique identifier of the business involved in the dispute.
|
12
|
+
sig { returns(String) }
|
13
|
+
attr_accessor :business_id
|
14
|
+
|
15
|
+
# The timestamp of when the dispute was created, in UTC.
|
16
|
+
sig { returns(Time) }
|
17
|
+
attr_accessor :created_at
|
18
|
+
|
19
|
+
# The currency of the disputed amount, represented as an ISO 4217 currency code.
|
20
|
+
sig { returns(String) }
|
21
|
+
attr_accessor :currency
|
22
|
+
|
23
|
+
# The unique identifier of the dispute.
|
24
|
+
sig { returns(String) }
|
25
|
+
attr_accessor :dispute_id
|
26
|
+
|
27
|
+
sig { returns(Dodopayments::Models::DisputeStage::TaggedSymbol) }
|
28
|
+
attr_accessor :dispute_stage
|
29
|
+
|
30
|
+
sig { returns(Dodopayments::Models::DisputeStatus::TaggedSymbol) }
|
31
|
+
attr_accessor :dispute_status
|
32
|
+
|
33
|
+
# The unique identifier of the payment associated with the dispute.
|
34
|
+
sig { returns(String) }
|
35
|
+
attr_accessor :payment_id
|
36
|
+
|
37
|
+
sig do
|
38
|
+
params(
|
39
|
+
amount: String,
|
40
|
+
business_id: String,
|
41
|
+
created_at: Time,
|
42
|
+
currency: String,
|
43
|
+
dispute_id: String,
|
44
|
+
dispute_stage: Dodopayments::Models::DisputeStage::OrSymbol,
|
45
|
+
dispute_status: Dodopayments::Models::DisputeStatus::OrSymbol,
|
46
|
+
payment_id: String
|
47
|
+
)
|
48
|
+
.returns(T.attached_class)
|
49
|
+
end
|
50
|
+
def self.new(
|
51
|
+
# The amount involved in the dispute, represented as a string to accommodate
|
52
|
+
# precision.
|
53
|
+
amount:,
|
54
|
+
# The unique identifier of the business involved in the dispute.
|
55
|
+
business_id:,
|
56
|
+
# The timestamp of when the dispute was created, in UTC.
|
57
|
+
created_at:,
|
58
|
+
# The currency of the disputed amount, represented as an ISO 4217 currency code.
|
59
|
+
currency:,
|
60
|
+
# The unique identifier of the dispute.
|
61
|
+
dispute_id:,
|
62
|
+
dispute_stage:,
|
63
|
+
dispute_status:,
|
64
|
+
# The unique identifier of the payment associated with the dispute.
|
65
|
+
payment_id:
|
66
|
+
); end
|
67
|
+
sig do
|
68
|
+
override
|
69
|
+
.returns(
|
70
|
+
{
|
71
|
+
amount: String,
|
72
|
+
business_id: String,
|
73
|
+
created_at: Time,
|
74
|
+
currency: String,
|
75
|
+
dispute_id: String,
|
76
|
+
dispute_stage: Dodopayments::Models::DisputeStage::TaggedSymbol,
|
77
|
+
dispute_status: Dodopayments::Models::DisputeStatus::TaggedSymbol,
|
78
|
+
payment_id: String
|
79
|
+
}
|
80
|
+
)
|
81
|
+
end
|
82
|
+
def to_hash; end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class DisputeRetrieveResponse < Dodopayments::Internal::Type::BaseModel
|
6
|
+
# The amount involved in the dispute, represented as a string to accommodate
|
7
|
+
# precision.
|
8
|
+
sig { returns(String) }
|
9
|
+
attr_accessor :amount
|
10
|
+
|
11
|
+
# The unique identifier of the business involved in the dispute.
|
12
|
+
sig { returns(String) }
|
13
|
+
attr_accessor :business_id
|
14
|
+
|
15
|
+
# The timestamp of when the dispute was created, in UTC.
|
16
|
+
sig { returns(Time) }
|
17
|
+
attr_accessor :created_at
|
18
|
+
|
19
|
+
# The currency of the disputed amount, represented as an ISO 4217 currency code.
|
20
|
+
sig { returns(String) }
|
21
|
+
attr_accessor :currency
|
22
|
+
|
23
|
+
sig { returns(Dodopayments::Models::CustomerLimitedDetails) }
|
24
|
+
attr_reader :customer
|
25
|
+
|
26
|
+
sig do
|
27
|
+
params(customer: T.any(Dodopayments::Models::CustomerLimitedDetails, Dodopayments::Internal::AnyHash)).void
|
28
|
+
end
|
29
|
+
attr_writer :customer
|
30
|
+
|
31
|
+
# The unique identifier of the dispute.
|
32
|
+
sig { returns(String) }
|
33
|
+
attr_accessor :dispute_id
|
34
|
+
|
35
|
+
sig { returns(Dodopayments::Models::DisputeStage::TaggedSymbol) }
|
36
|
+
attr_accessor :dispute_stage
|
37
|
+
|
38
|
+
sig { returns(Dodopayments::Models::DisputeStatus::TaggedSymbol) }
|
39
|
+
attr_accessor :dispute_status
|
40
|
+
|
41
|
+
# The unique identifier of the payment associated with the dispute.
|
42
|
+
sig { returns(String) }
|
43
|
+
attr_accessor :payment_id
|
44
|
+
|
45
|
+
# Reason for the dispute
|
46
|
+
sig { returns(T.nilable(String)) }
|
47
|
+
attr_accessor :reason
|
48
|
+
|
49
|
+
# Remarks
|
50
|
+
sig { returns(T.nilable(String)) }
|
51
|
+
attr_accessor :remarks
|
52
|
+
|
53
|
+
sig do
|
54
|
+
params(
|
55
|
+
amount: String,
|
56
|
+
business_id: String,
|
57
|
+
created_at: Time,
|
58
|
+
currency: String,
|
59
|
+
customer: T.any(Dodopayments::Models::CustomerLimitedDetails, Dodopayments::Internal::AnyHash),
|
60
|
+
dispute_id: String,
|
61
|
+
dispute_stage: Dodopayments::Models::DisputeStage::OrSymbol,
|
62
|
+
dispute_status: Dodopayments::Models::DisputeStatus::OrSymbol,
|
63
|
+
payment_id: String,
|
64
|
+
reason: T.nilable(String),
|
65
|
+
remarks: T.nilable(String)
|
66
|
+
)
|
67
|
+
.returns(T.attached_class)
|
68
|
+
end
|
69
|
+
def self.new(
|
70
|
+
# The amount involved in the dispute, represented as a string to accommodate
|
71
|
+
# precision.
|
72
|
+
amount:,
|
73
|
+
# The unique identifier of the business involved in the dispute.
|
74
|
+
business_id:,
|
75
|
+
# The timestamp of when the dispute was created, in UTC.
|
76
|
+
created_at:,
|
77
|
+
# The currency of the disputed amount, represented as an ISO 4217 currency code.
|
78
|
+
currency:,
|
79
|
+
customer:,
|
80
|
+
# The unique identifier of the dispute.
|
81
|
+
dispute_id:,
|
82
|
+
dispute_stage:,
|
83
|
+
dispute_status:,
|
84
|
+
# The unique identifier of the payment associated with the dispute.
|
85
|
+
payment_id:,
|
86
|
+
# Reason for the dispute
|
87
|
+
reason: nil,
|
88
|
+
# Remarks
|
89
|
+
remarks: nil
|
90
|
+
); end
|
91
|
+
sig do
|
92
|
+
override
|
93
|
+
.returns(
|
94
|
+
{
|
95
|
+
amount: String,
|
96
|
+
business_id: String,
|
97
|
+
created_at: Time,
|
98
|
+
currency: String,
|
99
|
+
customer: Dodopayments::Models::CustomerLimitedDetails,
|
100
|
+
dispute_id: String,
|
101
|
+
dispute_stage: Dodopayments::Models::DisputeStage::TaggedSymbol,
|
102
|
+
dispute_status: Dodopayments::Models::DisputeStatus::TaggedSymbol,
|
103
|
+
payment_id: String,
|
104
|
+
reason: T.nilable(String),
|
105
|
+
remarks: T.nilable(String)
|
106
|
+
}
|
107
|
+
)
|
108
|
+
end
|
109
|
+
def to_hash; end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -57,6 +57,22 @@ module Dodopayments
|
|
57
57
|
sig { returns(Integer) }
|
58
58
|
attr_accessor :total_amount
|
59
59
|
|
60
|
+
# ISO country code alpha2 variant
|
61
|
+
sig { returns(T.nilable(Dodopayments::Models::CountryCode::TaggedSymbol)) }
|
62
|
+
attr_accessor :card_issuing_country
|
63
|
+
|
64
|
+
# The last four digits of the card
|
65
|
+
sig { returns(T.nilable(String)) }
|
66
|
+
attr_accessor :card_last_four
|
67
|
+
|
68
|
+
# Card network like VISA, MASTERCARD etc.
|
69
|
+
sig { returns(T.nilable(String)) }
|
70
|
+
attr_accessor :card_network
|
71
|
+
|
72
|
+
# The type of card DEBIT or CREDIT
|
73
|
+
sig { returns(T.nilable(String)) }
|
74
|
+
attr_accessor :card_type
|
75
|
+
|
60
76
|
# The discount id if discount is applied
|
61
77
|
sig { returns(T.nilable(String)) }
|
62
78
|
attr_accessor :discount_id
|
@@ -116,6 +132,10 @@ module Dodopayments
|
|
116
132
|
settlement_amount: Integer,
|
117
133
|
settlement_currency: Dodopayments::Models::Currency::OrSymbol,
|
118
134
|
total_amount: Integer,
|
135
|
+
card_issuing_country: T.nilable(Dodopayments::Models::CountryCode::OrSymbol),
|
136
|
+
card_last_four: T.nilable(String),
|
137
|
+
card_network: T.nilable(String),
|
138
|
+
card_type: T.nilable(String),
|
119
139
|
discount_id: T.nilable(String),
|
120
140
|
error_message: T.nilable(String),
|
121
141
|
payment_link: T.nilable(String),
|
@@ -153,6 +173,14 @@ module Dodopayments
|
|
153
173
|
# Total amount charged to the customer including tax, in smallest currency unit
|
154
174
|
# (e.g. cents)
|
155
175
|
total_amount:,
|
176
|
+
# ISO country code alpha2 variant
|
177
|
+
card_issuing_country: nil,
|
178
|
+
# The last four digits of the card
|
179
|
+
card_last_four: nil,
|
180
|
+
# Card network like VISA, MASTERCARD etc.
|
181
|
+
card_network: nil,
|
182
|
+
# The type of card DEBIT or CREDIT
|
183
|
+
card_type: nil,
|
156
184
|
# The discount id if discount is applied
|
157
185
|
discount_id: nil,
|
158
186
|
# An error message if the payment failed
|
@@ -193,6 +221,10 @@ module Dodopayments
|
|
193
221
|
settlement_amount: Integer,
|
194
222
|
settlement_currency: Dodopayments::Models::Currency::TaggedSymbol,
|
195
223
|
total_amount: Integer,
|
224
|
+
card_issuing_country: T.nilable(Dodopayments::Models::CountryCode::TaggedSymbol),
|
225
|
+
card_last_four: T.nilable(String),
|
226
|
+
card_network: T.nilable(String),
|
227
|
+
card_type: T.nilable(String),
|
196
228
|
discount_id: T.nilable(String),
|
197
229
|
error_message: T.nilable(String),
|
198
230
|
payment_link: T.nilable(String),
|
@@ -17,11 +17,19 @@ module Dodopayments
|
|
17
17
|
sig { returns(Integer) }
|
18
18
|
attr_accessor :quantity
|
19
19
|
|
20
|
+
# Addons for the new plan. Note : Leaving this empty would remove any existing
|
21
|
+
# addons
|
22
|
+
sig { returns(T.nilable(T::Array[Dodopayments::Models::SubscriptionChangePlanParams::Addon])) }
|
23
|
+
attr_accessor :addons
|
24
|
+
|
20
25
|
sig do
|
21
26
|
params(
|
22
27
|
product_id: String,
|
23
28
|
proration_billing_mode: Dodopayments::Models::SubscriptionChangePlanParams::ProrationBillingMode::OrSymbol,
|
24
29
|
quantity: Integer,
|
30
|
+
addons: T.nilable(
|
31
|
+
T::Array[T.any(Dodopayments::Models::SubscriptionChangePlanParams::Addon, Dodopayments::Internal::AnyHash)]
|
32
|
+
),
|
25
33
|
request_options: T.any(Dodopayments::RequestOptions, Dodopayments::Internal::AnyHash)
|
26
34
|
)
|
27
35
|
.returns(T.attached_class)
|
@@ -32,6 +40,9 @@ module Dodopayments
|
|
32
40
|
proration_billing_mode:,
|
33
41
|
# Number of units to subscribe for. Must be at least 1.
|
34
42
|
quantity:,
|
43
|
+
# Addons for the new plan. Note : Leaving this empty would remove any existing
|
44
|
+
# addons
|
45
|
+
addons: nil,
|
35
46
|
request_options: {}
|
36
47
|
); end
|
37
48
|
sig do
|
@@ -41,6 +52,7 @@ module Dodopayments
|
|
41
52
|
product_id: String,
|
42
53
|
proration_billing_mode: Dodopayments::Models::SubscriptionChangePlanParams::ProrationBillingMode::OrSymbol,
|
43
54
|
quantity: Integer,
|
55
|
+
addons: T.nilable(T::Array[Dodopayments::Models::SubscriptionChangePlanParams::Addon]),
|
44
56
|
request_options: Dodopayments::RequestOptions
|
45
57
|
}
|
46
58
|
)
|
@@ -66,6 +78,20 @@ module Dodopayments
|
|
66
78
|
end
|
67
79
|
def self.values; end
|
68
80
|
end
|
81
|
+
|
82
|
+
class Addon < Dodopayments::Internal::Type::BaseModel
|
83
|
+
sig { returns(String) }
|
84
|
+
attr_accessor :addon_id
|
85
|
+
|
86
|
+
sig { returns(Integer) }
|
87
|
+
attr_accessor :quantity
|
88
|
+
|
89
|
+
sig { params(addon_id: String, quantity: Integer).returns(T.attached_class) }
|
90
|
+
def self.new(addon_id:, quantity:); end
|
91
|
+
|
92
|
+
sig { override.returns({addon_id: String, quantity: Integer}) }
|
93
|
+
def to_hash; end
|
94
|
+
end
|
69
95
|
end
|
70
96
|
end
|
71
97
|
end
|