dodopayments 1.17.0 → 1.18.1

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.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/file_part.rb +55 -0
  5. data/lib/dodopayments/internal/transport/base_client.rb +3 -3
  6. data/lib/dodopayments/internal/transport/pooled_net_requester.rb +1 -1
  7. data/lib/dodopayments/internal/type/converter.rb +1 -1
  8. data/lib/dodopayments/internal/type/{io_like.rb → file_input.rb} +8 -4
  9. data/lib/dodopayments/internal/util.rb +69 -61
  10. data/lib/dodopayments/models/billing_address.rb +9 -5
  11. data/lib/dodopayments/models/create_new_customer.rb +8 -1
  12. data/lib/dodopayments/models/customer_limited_details.rb +5 -3
  13. data/lib/dodopayments/models/customer_list_params.rb +4 -2
  14. data/lib/dodopayments/models/customers/customer_portal_create_params.rb +2 -1
  15. data/lib/dodopayments/models/discount.rb +23 -10
  16. data/lib/dodopayments/models/discount_create_params.rb +15 -5
  17. data/lib/dodopayments/models/discount_list_params.rb +4 -2
  18. data/lib/dodopayments/models/discount_update_params.rb +13 -3
  19. data/lib/dodopayments/models/dispute.rb +17 -6
  20. data/lib/dodopayments/models/dispute_list_params.rb +14 -7
  21. data/lib/dodopayments/models/license_key.rb +26 -11
  22. data/lib/dodopayments/models/license_key_instance_list_params.rb +6 -3
  23. data/lib/dodopayments/models/license_key_list_params.rb +10 -5
  24. data/lib/dodopayments/models/license_key_update_params.rb +9 -3
  25. data/lib/dodopayments/models/one_time_product_cart_item.rb +7 -1
  26. data/lib/dodopayments/models/payment.rb +41 -16
  27. data/lib/dodopayments/models/payment_create_params.rb +22 -7
  28. data/lib/dodopayments/models/payment_create_response.rb +16 -6
  29. data/lib/dodopayments/models/payment_list_params.rb +14 -7
  30. data/lib/dodopayments/models/payout_list_params.rb +4 -2
  31. data/lib/dodopayments/models/payout_list_response.rb +27 -13
  32. data/lib/dodopayments/models/price.rb +38 -13
  33. data/lib/dodopayments/models/product.rb +31 -13
  34. data/lib/dodopayments/models/product_create_params.rb +20 -7
  35. data/lib/dodopayments/models/product_list_params.rb +11 -4
  36. data/lib/dodopayments/models/product_list_response.rb +27 -11
  37. data/lib/dodopayments/models/product_update_params.rb +22 -8
  38. data/lib/dodopayments/models/refund.rb +13 -6
  39. data/lib/dodopayments/models/refund_create_params.rb +4 -2
  40. data/lib/dodopayments/models/refund_list_params.rb +12 -6
  41. data/lib/dodopayments/models/subscription.rb +46 -14
  42. data/lib/dodopayments/models/subscription_change_plan_params.rb +47 -0
  43. data/lib/dodopayments/models/subscription_charge_params.rb +6 -1
  44. data/lib/dodopayments/models/subscription_create_params.rb +34 -11
  45. data/lib/dodopayments/models/subscription_create_response.rb +15 -5
  46. data/lib/dodopayments/models/subscription_list_params.rb +12 -6
  47. data/lib/dodopayments/models/webhook_event_list_params.rb +16 -6
  48. data/lib/dodopayments/resources/customers/customer_portal.rb +4 -2
  49. data/lib/dodopayments/resources/customers.rb +10 -4
  50. data/lib/dodopayments/resources/discounts.rb +38 -13
  51. data/lib/dodopayments/resources/disputes.rb +16 -8
  52. data/lib/dodopayments/resources/license_key_instances.rb +11 -5
  53. data/lib/dodopayments/resources/license_keys.rb +23 -10
  54. data/lib/dodopayments/resources/payments.rb +38 -15
  55. data/lib/dodopayments/resources/payouts.rb +4 -2
  56. data/lib/dodopayments/resources/products/images.rb +3 -1
  57. data/lib/dodopayments/resources/products.rb +56 -20
  58. data/lib/dodopayments/resources/refunds.rb +18 -9
  59. data/lib/dodopayments/resources/subscriptions.rb +81 -19
  60. data/lib/dodopayments/resources/webhook_events.rb +16 -6
  61. data/lib/dodopayments/version.rb +1 -1
  62. data/lib/dodopayments.rb +3 -1
  63. data/rbi/lib/dodopayments/file_part.rbi +34 -0
  64. data/rbi/lib/dodopayments/internal/transport/base_client.rbi +17 -3
  65. data/rbi/lib/dodopayments/internal/type/{io_like.rbi → file_input.rbi} +6 -2
  66. data/rbi/lib/dodopayments/internal/util.rbi +24 -19
  67. data/rbi/lib/dodopayments/models/billing_address.rbi +12 -2
  68. data/rbi/lib/dodopayments/models/create_new_customer.rbi +9 -2
  69. data/rbi/lib/dodopayments/models/customer_limited_details.rbi +8 -2
  70. data/rbi/lib/dodopayments/models/customer_list_params.rbi +7 -2
  71. data/rbi/lib/dodopayments/models/customers/customer_portal_create_params.rbi +5 -2
  72. data/rbi/lib/dodopayments/models/discount.rbi +14 -0
  73. data/rbi/lib/dodopayments/models/discount_create_params.rbi +15 -0
  74. data/rbi/lib/dodopayments/models/discount_list_params.rbi +7 -2
  75. data/rbi/lib/dodopayments/models/discount_update_params.rbi +10 -0
  76. data/rbi/lib/dodopayments/models/dispute.rbi +8 -3
  77. data/rbi/lib/dodopayments/models/dispute_list_params.rbi +7 -0
  78. data/rbi/lib/dodopayments/models/license_key.rbi +12 -0
  79. data/rbi/lib/dodopayments/models/license_key_instance_list_params.rbi +9 -2
  80. data/rbi/lib/dodopayments/models/license_key_list_params.rbi +6 -3
  81. data/rbi/lib/dodopayments/models/license_key_update_params.rbi +12 -2
  82. data/rbi/lib/dodopayments/models/one_time_product_cart_item.rbi +8 -2
  83. data/rbi/lib/dodopayments/models/payment.rbi +19 -0
  84. data/rbi/lib/dodopayments/models/payment_create_params.rbi +14 -0
  85. data/rbi/lib/dodopayments/models/payment_create_response.rbi +7 -0
  86. data/rbi/lib/dodopayments/models/payment_list_params.rbi +7 -0
  87. data/rbi/lib/dodopayments/models/payout_list_params.rbi +7 -2
  88. data/rbi/lib/dodopayments/models/payout_list_response.rbi +13 -0
  89. data/rbi/lib/dodopayments/models/price.rbi +25 -0
  90. data/rbi/lib/dodopayments/models/product.rbi +14 -0
  91. data/rbi/lib/dodopayments/models/product_create_params.rbi +8 -0
  92. data/rbi/lib/dodopayments/models/product_list_params.rbi +15 -2
  93. data/rbi/lib/dodopayments/models/product_list_response.rbi +21 -0
  94. data/rbi/lib/dodopayments/models/product_update_params.rbi +18 -0
  95. data/rbi/lib/dodopayments/models/refund.rbi +7 -3
  96. data/rbi/lib/dodopayments/models/refund_create_params.rbi +7 -2
  97. data/rbi/lib/dodopayments/models/refund_list_params.rbi +6 -0
  98. data/rbi/lib/dodopayments/models/subscription.rbi +24 -1
  99. data/rbi/lib/dodopayments/models/subscription_change_plan_params.rbi +71 -0
  100. data/rbi/lib/dodopayments/models/subscription_charge_params.rbi +6 -2
  101. data/rbi/lib/dodopayments/models/subscription_create_params.rbi +25 -2
  102. data/rbi/lib/dodopayments/models/subscription_create_response.rbi +7 -0
  103. data/rbi/lib/dodopayments/models/subscription_list_params.rbi +6 -0
  104. data/rbi/lib/dodopayments/models/webhook_event_list_params.rbi +6 -0
  105. data/rbi/lib/dodopayments/resources/subscriptions.rbi +20 -0
  106. data/sig/dodopayments/file_part.rbs +21 -0
  107. data/sig/dodopayments/internal/transport/base_client.rbs +9 -3
  108. data/sig/dodopayments/internal/type/{io_like.rbs → file_input.rbs} +1 -1
  109. data/sig/dodopayments/internal/util.rbs +14 -12
  110. data/sig/dodopayments/models/subscription.rbs +4 -0
  111. data/sig/dodopayments/models/subscription_change_plan_params.rbs +41 -0
  112. data/sig/dodopayments/resources/subscriptions.rbs +8 -0
  113. metadata +11 -5
@@ -68,13 +68,19 @@ module Dodopayments
68
68
  sig do
69
69
  params(
70
70
  data: T.any(Dodopayments::Internal::AnyHash, T::Array[T.anything], T.anything),
71
- pick: T.nilable(T.any(Symbol, Integer, T::Array[T.any(Symbol, Integer)])),
72
- sentinel: T.nilable(T.anything),
71
+ pick: T.nilable(
72
+ T.any(
73
+ Symbol,
74
+ Integer,
75
+ T::Array[T.any(Symbol, Integer)],
76
+ T.proc.params(arg0: T.anything).returns(T.anything)
77
+ )
78
+ ),
73
79
  blk: T.nilable(T.proc.returns(T.anything))
74
80
  )
75
81
  .returns(T.nilable(T.anything))
76
82
  end
77
- def dig(data, pick, sentinel = nil, &blk); end
83
+ def dig(data, pick, &blk); end
78
84
  end
79
85
 
80
86
  class << self
@@ -143,22 +149,6 @@ module Dodopayments
143
149
  def normalized_headers(*headers); end
144
150
  end
145
151
 
146
- # @api private
147
- class SerializationAdapter
148
- sig { returns(T.any(Pathname, IO)) }
149
- attr_reader :inner
150
-
151
- sig { params(a: T.anything).returns(String) }
152
- def to_json(*a); end
153
-
154
- sig { params(a: T.anything).returns(String) }
155
- def to_yaml(*a); end
156
-
157
- # @api private
158
- sig { params(inner: T.any(Pathname, IO)).returns(T.attached_class) }
159
- def self.new(inner); end
160
- end
161
-
162
152
  # @api private
163
153
  #
164
154
  # An adapter that satisfies the IO interface required by `::IO.copy_stream`
@@ -195,7 +185,22 @@ module Dodopayments
195
185
  def writable_enum(&blk); end
196
186
  end
197
187
 
188
+ JSON_CONTENT = T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp)
189
+ JSONL_CONTENT = T.let(%r{^application/(?:x-)?jsonl}, Regexp)
190
+
198
191
  class << self
192
+ # @api private
193
+ sig do
194
+ params(
195
+ y: Enumerator::Yielder,
196
+ val: T.anything,
197
+ closing: T::Array[T.proc.void],
198
+ content_type: T.nilable(String)
199
+ )
200
+ .void
201
+ end
202
+ private def write_multipart_content(y, val:, closing:, content_type: nil); end
203
+
199
204
  # @api private
200
205
  sig do
201
206
  params(
@@ -33,8 +33,18 @@ module Dodopayments
33
33
  )
34
34
  .returns(T.attached_class)
35
35
  end
36
- def self.new(city:, country:, state:, street:, zipcode:); end
37
-
36
+ def self.new(
37
+ # City name
38
+ city:,
39
+ # ISO country code alpha2 variant
40
+ country:,
41
+ # State or province name
42
+ state:,
43
+ # Street address including house number and unit/apartment if applicable
44
+ street:,
45
+ # Postal code or ZIP code
46
+ zipcode:
47
+ ); end
38
48
  sig do
39
49
  override
40
50
  .returns(
@@ -25,8 +25,15 @@ module Dodopayments
25
25
  params(email: String, name: String, create_new_customer: T::Boolean, phone_number: T.nilable(String))
26
26
  .returns(T.attached_class)
27
27
  end
28
- def self.new(email:, name:, create_new_customer: nil, phone_number: nil); end
29
-
28
+ def self.new(
29
+ email:,
30
+ name:,
31
+ # When false, the most recently created customer object with the given email is
32
+ # used if exists. When true, a new customer object is always created False by
33
+ # default
34
+ create_new_customer: nil,
35
+ phone_number: nil
36
+ ); end
30
37
  sig do
31
38
  override
32
39
  .returns({
@@ -16,8 +16,14 @@ module Dodopayments
16
16
  attr_accessor :name
17
17
 
18
18
  sig { params(customer_id: String, email: String, name: String).returns(T.attached_class) }
19
- def self.new(customer_id:, email:, name:); end
20
-
19
+ def self.new(
20
+ # Unique identifier for the customer
21
+ customer_id:,
22
+ # Email address of the customer
23
+ email:,
24
+ # Full name of the customer
25
+ name:
26
+ ); end
21
27
  sig { override.returns({customer_id: String, email: String, name: String}) }
22
28
  def to_hash; end
23
29
  end
@@ -22,8 +22,13 @@ module Dodopayments
22
22
  )
23
23
  .returns(T.attached_class)
24
24
  end
25
- def self.new(page_number: nil, page_size: nil, request_options: {}); end
26
-
25
+ def self.new(
26
+ # Page number default is 0
27
+ page_number: nil,
28
+ # Page size default is 10 max is 100
29
+ page_size: nil,
30
+ request_options: {}
31
+ ); end
27
32
  sig do
28
33
  override
29
34
  .returns(
@@ -18,8 +18,11 @@ module Dodopayments
18
18
  )
19
19
  .returns(T.attached_class)
20
20
  end
21
- def self.new(send_email: nil, request_options: {}); end
22
-
21
+ def self.new(
22
+ # If true, will send link to user.
23
+ send_email: nil,
24
+ request_options: {}
25
+ ); end
23
26
  sig do
24
27
  override.returns({send_email: T.nilable(T::Boolean), request_options: Dodopayments::RequestOptions})
25
28
  end
@@ -67,16 +67,30 @@ module Dodopayments
67
67
  .returns(T.attached_class)
68
68
  end
69
69
  def self.new(
70
+ # The discount amount.
71
+ #
72
+ # - If `discount_type` is `percentage`, this is in **basis points** (e.g., 540 =>
73
+ # 5.4%).
74
+ # - Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).
70
75
  amount:,
76
+ # The business this discount belongs to.
71
77
  business_id:,
78
+ # The discount code (up to 16 chars).
72
79
  code:,
80
+ # Timestamp when the discount is created
73
81
  created_at:,
82
+ # The unique discount ID
74
83
  discount_id:,
84
+ # List of product IDs to which this discount is restricted.
75
85
  restricted_to:,
86
+ # How many times this discount has been used.
76
87
  times_used:,
77
88
  type:,
89
+ # Optional date/time after which discount is expired.
78
90
  expires_at: nil,
91
+ # Name for the Discount
79
92
  name: nil,
93
+ # Usage limit for this discount, if any.
80
94
  usage_limit: nil
81
95
  ); end
82
96
  sig do
@@ -56,12 +56,27 @@ module Dodopayments
56
56
  .returns(T.attached_class)
57
57
  end
58
58
  def self.new(
59
+ # The discount amount.
60
+ #
61
+ # - If `discount_type` is **not** `percentage`, `amount` is in **USD cents**. For
62
+ # example, `100` means `$1.00`. Only USD is allowed.
63
+ # - If `discount_type` **is** `percentage`, `amount` is in **basis points**. For
64
+ # example, `540` means `5.4%`.
65
+ #
66
+ # Must be at least 1.
59
67
  amount:,
60
68
  type:,
69
+ # Optionally supply a code (will be uppercased).
70
+ #
71
+ # - Must be at least 3 characters if provided.
72
+ # - If omitted, a random 16-character code is generated.
61
73
  code: nil,
74
+ # When the discount expires, if ever.
62
75
  expires_at: nil,
63
76
  name: nil,
77
+ # List of product IDs to restrict usage (if any).
64
78
  restricted_to: nil,
79
+ # How many times this discount can be used (if any). Must be >= 1 if provided.
65
80
  usage_limit: nil,
66
81
  request_options: {}
67
82
  ); end
@@ -22,8 +22,13 @@ module Dodopayments
22
22
  )
23
23
  .returns(T.attached_class)
24
24
  end
25
- def self.new(page_number: nil, page_size: nil, request_options: {}); end
26
-
25
+ def self.new(
26
+ # Page number (default = 0).
27
+ page_number: nil,
28
+ # Page size (default = 10, max = 100).
29
+ page_size: nil,
30
+ request_options: {}
31
+ ); end
27
32
  sig do
28
33
  override
29
34
  .returns(
@@ -51,10 +51,20 @@ module Dodopayments
51
51
  .returns(T.attached_class)
52
52
  end
53
53
  def self.new(
54
+ # If present, update the discount amount:
55
+ #
56
+ # - If `discount_type` is `percentage`, this represents **basis points** (e.g.,
57
+ # `540` = `5.4%`).
58
+ # - Otherwise, this represents **USD cents** (e.g., `100` = `$1.00`).
59
+ #
60
+ # Must be at least 1 if provided.
54
61
  amount: nil,
62
+ # If present, update the discount code (uppercase).
55
63
  code: nil,
56
64
  expires_at: nil,
57
65
  name: nil,
66
+ # If present, replaces all restricted product IDs with this new set. To remove all
67
+ # restrictions, send empty array
58
68
  restricted_to: nil,
59
69
  type: nil,
60
70
  usage_limit: nil,
@@ -48,17 +48,22 @@ module Dodopayments
48
48
  .returns(T.attached_class)
49
49
  end
50
50
  def self.new(
51
+ # The amount involved in the dispute, represented as a string to accommodate
52
+ # precision.
51
53
  amount:,
54
+ # The unique identifier of the business involved in the dispute.
52
55
  business_id:,
56
+ # The timestamp of when the dispute was created, in UTC.
53
57
  created_at:,
58
+ # The currency of the disputed amount, represented as an ISO 4217 currency code.
54
59
  currency:,
60
+ # The unique identifier of the dispute.
55
61
  dispute_id:,
56
62
  dispute_stage:,
57
63
  dispute_status:,
64
+ # The unique identifier of the payment associated with the dispute.
58
65
  payment_id:
59
- )
60
- end
61
-
66
+ ); end
62
67
  sig do
63
68
  override
64
69
  .returns(
@@ -48,12 +48,19 @@ module Dodopayments
48
48
  .returns(T.attached_class)
49
49
  end
50
50
  def self.new(
51
+ # Get events after this created time
51
52
  created_at_gte: nil,
53
+ # Get events created before this time
52
54
  created_at_lte: nil,
55
+ # Filter by customer_id
53
56
  customer_id: nil,
57
+ # Filter by dispute stage
54
58
  dispute_stage: nil,
59
+ # Filter by dispute status
55
60
  dispute_status: nil,
61
+ # Page number default is 0
56
62
  page_number: nil,
63
+ # Page size default is 10 max is 100
57
64
  page_size: nil,
58
65
  request_options: {}
59
66
  ); end
@@ -69,17 +69,29 @@ module Dodopayments
69
69
  .returns(T.attached_class)
70
70
  end
71
71
  def self.new(
72
+ # The unique identifier of the license key.
72
73
  id:,
74
+ # The unique identifier of the business associated with the license key.
73
75
  business_id:,
76
+ # The timestamp indicating when the license key was created, in UTC.
74
77
  created_at:,
78
+ # The unique identifier of the customer associated with the license key.
75
79
  customer_id:,
80
+ # The current number of instances activated for this license key.
76
81
  instances_count:,
82
+ # The license key string.
77
83
  key:,
84
+ # The unique identifier of the payment associated with the license key.
78
85
  payment_id:,
86
+ # The unique identifier of the product associated with the license key.
79
87
  product_id:,
80
88
  status:,
89
+ # The maximum number of activations allowed for this license key.
81
90
  activations_limit: nil,
91
+ # The timestamp indicating when the license key expires, in UTC.
82
92
  expires_at: nil,
93
+ # The unique identifier of the subscription associated with the license key, if
94
+ # any.
83
95
  subscription_id: nil
84
96
  ); end
85
97
  sig do
@@ -27,8 +27,15 @@ module Dodopayments
27
27
  )
28
28
  .returns(T.attached_class)
29
29
  end
30
- def self.new(license_key_id: nil, page_number: nil, page_size: nil, request_options: {}); end
31
-
30
+ def self.new(
31
+ # Filter by license key ID
32
+ license_key_id: nil,
33
+ # Page number default is 0
34
+ page_number: nil,
35
+ # Page size default is 10 max is 100
36
+ page_size: nil,
37
+ request_options: {}
38
+ ); end
32
39
  sig do
33
40
  override
34
41
  .returns(
@@ -38,15 +38,18 @@ module Dodopayments
38
38
  .returns(T.attached_class)
39
39
  end
40
40
  def self.new(
41
+ # Filter by customer ID
41
42
  customer_id: nil,
43
+ # Page number default is 0
42
44
  page_number: nil,
45
+ # Page size default is 10 max is 100
43
46
  page_size: nil,
47
+ # Filter by product ID
44
48
  product_id: nil,
49
+ # Filter by license key status
45
50
  status: nil,
46
51
  request_options: {}
47
- )
48
- end
49
-
52
+ ); end
50
53
  sig do
51
54
  override
52
55
  .returns(
@@ -30,8 +30,18 @@ module Dodopayments
30
30
  )
31
31
  .returns(T.attached_class)
32
32
  end
33
- def self.new(activations_limit: nil, disabled: nil, expires_at: nil, request_options: {}); end
34
-
33
+ def self.new(
34
+ # The updated activation limit for the license key. Use `null` to remove the
35
+ # limit, or omit this field to leave it unchanged.
36
+ activations_limit: nil,
37
+ # Indicates whether the license key should be disabled. A value of `true` disables
38
+ # the key, while `false` enables it. Omit this field to leave it unchanged.
39
+ disabled: nil,
40
+ # The updated expiration timestamp for the license key in UTC. Use `null` to
41
+ # remove the expiration date, or omit this field to leave it unchanged.
42
+ expires_at: nil,
43
+ request_options: {}
44
+ ); end
35
45
  sig do
36
46
  override
37
47
  .returns(
@@ -18,8 +18,14 @@ module Dodopayments
18
18
  sig do
19
19
  params(product_id: String, quantity: Integer, amount: T.nilable(Integer)).returns(T.attached_class)
20
20
  end
21
- def self.new(product_id:, quantity:, amount: nil); end
22
-
21
+ def self.new(
22
+ product_id:,
23
+ quantity:,
24
+ # Amount the customer pays if pay_what_you_want is enabled. If disabled then
25
+ # amount will be ignored Represented in the lowest denomination of the currency
26
+ # (e.g., cents for USD). For example, to charge $1.00, pass `100`.
27
+ amount: nil
28
+ ); end
23
29
  sig { override.returns({product_id: String, quantity: Integer, amount: T.nilable(Integer)}) }
24
30
  def to_hash; end
25
31
  end
@@ -117,26 +117,45 @@ module Dodopayments
117
117
  .returns(T.attached_class)
118
118
  end
119
119
  def self.new(
120
+ # Identifier of the business associated with the payment
120
121
  business_id:,
122
+ # Timestamp when the payment was created
121
123
  created_at:,
122
124
  currency:,
123
125
  customer:,
126
+ # List of disputes associated with this payment
124
127
  disputes:,
125
128
  metadata:,
129
+ # Unique identifier for the payment
126
130
  payment_id:,
131
+ # List of refunds issued for this payment
127
132
  refunds:,
133
+ # The amount that will be credited to your Dodo balance after currency conversion
134
+ # and processing. Especially relevant for adaptive pricing where the customer's
135
+ # payment currency differs from your settlement currency.
128
136
  settlement_amount:,
129
137
  settlement_currency:,
138
+ # Total amount charged to the customer including tax, in smallest currency unit
139
+ # (e.g. cents)
130
140
  total_amount:,
141
+ # The discount id if discount is applied
131
142
  discount_id: nil,
143
+ # An error message if the payment failed
132
144
  error_message: nil,
145
+ # Checkout URL
133
146
  payment_link: nil,
147
+ # Payment method used by customer (e.g. "card", "bank_transfer")
134
148
  payment_method: nil,
149
+ # Specific type of payment method (e.g. "visa", "mastercard")
135
150
  payment_method_type: nil,
151
+ # List of products purchased in a one-time payment
136
152
  product_cart: nil,
137
153
  status: nil,
154
+ # Identifier of the subscription if payment is part of a subscription
138
155
  subscription_id: nil,
156
+ # Amount of tax collected in smallest currency unit (e.g. cents)
139
157
  tax: nil,
158
+ # Timestamp when the payment was last updated
140
159
  updated_at: nil
141
160
  ); end
142
161
  sig do
@@ -90,14 +90,28 @@ module Dodopayments
90
90
  def self.new(
91
91
  billing:,
92
92
  customer:,
93
+ # List of products in the cart. Must contain at least 1 and at most 100 items.
93
94
  product_cart:,
95
+ # List of payment methods allowed during checkout.
96
+ #
97
+ # Customers will **never** see payment methods that are **not** in this list.
98
+ # However, adding a method here **does not guarantee** customers will see it.
99
+ # Availability still depends on other factors (e.g., customer location, merchant
100
+ # settings).
94
101
  allowed_payment_method_types: nil,
95
102
  billing_currency: nil,
103
+ # Discount Code to apply to the transaction
96
104
  discount_code: nil,
97
105
  metadata: nil,
106
+ # Whether to generate a payment link. Defaults to false if not specified.
98
107
  payment_link: nil,
108
+ # Optional URL to redirect the customer after payment. Must be a valid URL if
109
+ # provided.
99
110
  return_url: nil,
111
+ # Display saved payment methods of a returning customer False by default
100
112
  show_saved_payment_methods: nil,
113
+ # Tax ID in case the payment is B2B. If tax id validation fails the payment
114
+ # creation will fail
101
115
  tax_id: nil,
102
116
  request_options: {}
103
117
  ); end
@@ -53,13 +53,20 @@ module Dodopayments
53
53
  .returns(T.attached_class)
54
54
  end
55
55
  def self.new(
56
+ # Client secret used to load Dodo checkout SDK NOTE : Dodo checkout SDK will be
57
+ # coming soon
56
58
  client_secret:,
57
59
  customer:,
58
60
  metadata:,
61
+ # Unique identifier for the payment
59
62
  payment_id:,
63
+ # Total amount of the payment in smallest currency unit (e.g. cents)
60
64
  total_amount:,
65
+ # The discount id if discount is applied
61
66
  discount_id: nil,
67
+ # Optional URL to a hosted payment page
62
68
  payment_link: nil,
69
+ # Optional list of products included in the payment
63
70
  product_cart: nil
64
71
  ); end
65
72
  sig do
@@ -48,12 +48,19 @@ module Dodopayments
48
48
  .returns(T.attached_class)
49
49
  end
50
50
  def self.new(
51
+ # Get events after this created time
51
52
  created_at_gte: nil,
53
+ # Get events created before this time
52
54
  created_at_lte: nil,
55
+ # Filter by customer id
53
56
  customer_id: nil,
57
+ # Page number default is 0
54
58
  page_number: nil,
59
+ # Page size default is 10 max is 100
55
60
  page_size: nil,
61
+ # Filter by status
56
62
  status: nil,
63
+ # Filter by subscription id
57
64
  subscription_id: nil,
58
65
  request_options: {}
59
66
  ); end
@@ -22,8 +22,13 @@ module Dodopayments
22
22
  )
23
23
  .returns(T.attached_class)
24
24
  end
25
- def self.new(page_number: nil, page_size: nil, request_options: {}); end
26
-
25
+ def self.new(
26
+ # Page number default is 0
27
+ page_number: nil,
28
+ # Page size default is 10 max is 100
29
+ page_size: nil,
30
+ request_options: {}
31
+ ); end
27
32
  sig do
28
33
  override
29
34
  .returns(
@@ -82,20 +82,33 @@ module Dodopayments
82
82
  .returns(T.attached_class)
83
83
  end
84
84
  def self.new(
85
+ # The total amount of the payout.
85
86
  amount:,
87
+ # The unique identifier of the business associated with the payout.
86
88
  business_id:,
89
+ # The total value of chargebacks associated with the payout.
87
90
  chargebacks:,
91
+ # The timestamp when the payout was created, in UTC.
88
92
  created_at:,
89
93
  currency:,
94
+ # The fee charged for processing the payout.
90
95
  fee:,
96
+ # The payment method used for the payout (e.g., bank transfer, card, etc.).
91
97
  payment_method:,
98
+ # The unique identifier of the payout.
92
99
  payout_id:,
100
+ # The total value of refunds associated with the payout.
93
101
  refunds:,
94
102
  status:,
103
+ # The tax applied to the payout.
95
104
  tax:,
105
+ # The timestamp when the payout was last updated, in UTC.
96
106
  updated_at:,
107
+ # The name of the payout recipient or purpose.
97
108
  name: nil,
109
+ # The URL of the document associated with the payout.
98
110
  payout_document_url: nil,
111
+ # Any additional remarks or notes associated with the payout.
99
112
  remarks: nil
100
113
  ); end
101
114
  sig do
@@ -62,11 +62,25 @@ module Dodopayments
62
62
  end
63
63
  def self.new(
64
64
  currency:,
65
+ # Discount applied to the price, represented as a percentage (0 to 100).
65
66
  discount:,
67
+ # The payment amount, in the smallest denomination of the currency (e.g., cents
68
+ # for USD). For example, to charge $1.00, pass `100`.
69
+ #
70
+ # If [`pay_what_you_want`](Self::pay_what_you_want) is set to `true`, this field
71
+ # represents the **minimum** amount the customer must pay.
66
72
  price:,
73
+ # Indicates if purchasing power parity adjustments are applied to the price.
74
+ # Purchasing power parity feature is not available as of now.
67
75
  purchasing_power_parity:,
76
+ # Indicates whether the customer can pay any amount they choose. If set to `true`,
77
+ # the [`price`](Self::price) field is the minimum amount.
68
78
  pay_what_you_want: nil,
79
+ # A suggested price for the user to pay. This value is only considered if
80
+ # [`pay_what_you_want`](Self::pay_what_you_want) is `true`. Otherwise, it is
81
+ # ignored.
69
82
  suggested_price: nil,
83
+ # Indicates if the price is tax inclusive.
70
84
  tax_inclusive: nil,
71
85
  type: :one_time_price
72
86
  ); end
@@ -310,14 +324,25 @@ module Dodopayments
310
324
  end
311
325
  def self.new(
312
326
  currency:,
327
+ # Discount applied to the price, represented as a percentage (0 to 100).
313
328
  discount:,
329
+ # Number of units for the payment frequency. For example, a value of `1` with a
330
+ # `payment_frequency_interval` of `month` represents monthly payments.
314
331
  payment_frequency_count:,
315
332
  payment_frequency_interval:,
333
+ # The payment amount. Represented in the lowest denomination of the currency
334
+ # (e.g., cents for USD). For example, to charge $1.00, pass `100`.
316
335
  price:,
336
+ # Indicates if purchasing power parity adjustments are applied to the price.
337
+ # Purchasing power parity feature is not available as of now
317
338
  purchasing_power_parity:,
339
+ # Number of units for the subscription period. For example, a value of `12` with a
340
+ # `subscription_period_interval` of `month` represents a one-year subscription.
318
341
  subscription_period_count:,
319
342
  subscription_period_interval:,
343
+ # Indicates if the price is tax inclusive
320
344
  tax_inclusive: nil,
345
+ # Number of days for the trial period. A value of `0` indicates no trial period.
321
346
  trial_period_days: nil,
322
347
  type: :recurring_price
323
348
  ); end