dodopayments 2.32.2 → 2.34.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.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/internal/type/enum.rb +11 -11
  5. data/lib/dodopayments/models/balance_ledger_entry.rb +3 -0
  6. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +3 -0
  7. data/lib/dodopayments/models/charge_type.rb +33 -0
  8. data/lib/dodopayments/models/checkout_session_flags.rb +3 -0
  9. data/lib/dodopayments/models/checkout_session_preview_response.rb +12 -1
  10. data/lib/dodopayments/models/invoices/payment_retrieve_params.rb +14 -1
  11. data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +14 -1
  12. data/lib/dodopayments/models/invoices/payment_retrieve_refund_params.rb +14 -1
  13. data/lib/dodopayments/models/manual_retry_state.rb +27 -1
  14. data/lib/dodopayments/models/payment.rb +69 -7
  15. data/lib/dodopayments/models/payment_list_response.rb +94 -5
  16. data/lib/dodopayments/models/price.rb +56 -20
  17. data/lib/dodopayments/models/product_collection.rb +2 -0
  18. data/lib/dodopayments/models/product_collection_create_params.rb +2 -0
  19. data/lib/dodopayments/models/product_collection_update_params.rb +2 -0
  20. data/lib/dodopayments/models/product_collections/group_update_params.rb +2 -1
  21. data/lib/dodopayments/models/refund.rb +11 -1
  22. data/lib/dodopayments/models/refund_list_item.rb +11 -1
  23. data/lib/dodopayments/models/subscription_active_webhook_event.rb +10 -1
  24. data/lib/dodopayments/models/subscription_cancelled_webhook_event.rb +10 -1
  25. data/lib/dodopayments/models/subscription_expired_webhook_event.rb +10 -1
  26. data/lib/dodopayments/models/subscription_failed_webhook_event.rb +10 -1
  27. data/lib/dodopayments/models/subscription_on_hold_webhook_event.rb +10 -1
  28. data/lib/dodopayments/models/subscription_past_due_webhook_event.rb +10 -1
  29. data/lib/dodopayments/models/subscription_paused_webhook_event.rb +10 -1
  30. data/lib/dodopayments/models/subscription_plan_changed_webhook_event.rb +10 -1
  31. data/lib/dodopayments/models/subscription_renewed_webhook_event.rb +10 -1
  32. data/lib/dodopayments/models/subscription_service_period.rb +50 -0
  33. data/lib/dodopayments/models/subscription_unpaused_webhook_event.rb +10 -1
  34. data/lib/dodopayments/models/subscription_update_payment_method_webhook_event.rb +10 -1
  35. data/lib/dodopayments/models/subscription_updated_webhook_event.rb +10 -1
  36. data/lib/dodopayments/models/update_subscription_plan_req.rb +1 -0
  37. data/lib/dodopayments/models/webhook_payload.rb +10 -1
  38. data/lib/dodopayments/models.rb +4 -0
  39. data/lib/dodopayments/resources/invoices/payments.rb +30 -6
  40. data/lib/dodopayments/version.rb +1 -1
  41. data/lib/dodopayments.rb +2 -0
  42. data/rbi/dodopayments/models/balance_ledger_entry.rbi +15 -0
  43. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +15 -0
  44. data/rbi/dodopayments/models/charge_type.rbi +37 -0
  45. data/rbi/dodopayments/models/checkout_session_flags.rbi +6 -0
  46. data/rbi/dodopayments/models/checkout_session_preview_response.rbi +14 -0
  47. data/rbi/dodopayments/models/invoices/payment_retrieve_params.rbi +17 -1
  48. data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +21 -2
  49. data/rbi/dodopayments/models/invoices/payment_retrieve_refund_params.rbi +21 -2
  50. data/rbi/dodopayments/models/manual_retry_state.rbi +28 -0
  51. data/rbi/dodopayments/models/payment.rbi +85 -6
  52. data/rbi/dodopayments/models/payment_list_response.rbi +113 -4
  53. data/rbi/dodopayments/models/price.rbi +96 -24
  54. data/rbi/dodopayments/models/product_collection.rbi +10 -0
  55. data/rbi/dodopayments/models/product_collection_create_params.rbi +10 -0
  56. data/rbi/dodopayments/models/product_collection_update_params.rbi +10 -0
  57. data/rbi/dodopayments/models/product_collections/group_update_params.rbi +4 -2
  58. data/rbi/dodopayments/models/refund.rbi +12 -0
  59. data/rbi/dodopayments/models/refund_list_item.rbi +12 -0
  60. data/rbi/dodopayments/models/subscription_active_webhook_event.rbi +18 -3
  61. data/rbi/dodopayments/models/subscription_cancelled_webhook_event.rbi +18 -3
  62. data/rbi/dodopayments/models/subscription_expired_webhook_event.rbi +18 -3
  63. data/rbi/dodopayments/models/subscription_failed_webhook_event.rbi +18 -3
  64. data/rbi/dodopayments/models/subscription_on_hold_webhook_event.rbi +18 -3
  65. data/rbi/dodopayments/models/subscription_past_due_webhook_event.rbi +18 -3
  66. data/rbi/dodopayments/models/subscription_paused_webhook_event.rbi +18 -3
  67. data/rbi/dodopayments/models/subscription_plan_changed_webhook_event.rbi +18 -3
  68. data/rbi/dodopayments/models/subscription_renewed_webhook_event.rbi +18 -3
  69. data/rbi/dodopayments/models/subscription_service_period.rbi +75 -0
  70. data/rbi/dodopayments/models/subscription_unpaused_webhook_event.rbi +18 -3
  71. data/rbi/dodopayments/models/subscription_update_payment_method_webhook_event.rbi +18 -3
  72. data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +18 -3
  73. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +5 -0
  74. data/rbi/dodopayments/models/webhook_payload.rbi +14 -1
  75. data/rbi/dodopayments/models.rbi +4 -0
  76. data/rbi/dodopayments/resources/invoices/payments.rbi +12 -0
  77. data/rbi/dodopayments/resources/product_collections/groups.rbi +2 -1
  78. data/sig/dodopayments/models/balance_ledger_entry.rbs +6 -0
  79. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +6 -0
  80. data/sig/dodopayments/models/charge_type.rbs +16 -0
  81. data/sig/dodopayments/models/checkout_session_preview_response.rbs +5 -0
  82. data/sig/dodopayments/models/invoices/payment_retrieve_params.rbs +7 -1
  83. data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +8 -1
  84. data/sig/dodopayments/models/invoices/payment_retrieve_refund_params.rbs +8 -1
  85. data/sig/dodopayments/models/manual_retry_state.rbs +15 -0
  86. data/sig/dodopayments/models/payment.rbs +25 -0
  87. data/sig/dodopayments/models/payment_list_response.rbs +40 -0
  88. data/sig/dodopayments/models/product_collection.rbs +4 -0
  89. data/sig/dodopayments/models/product_collection_create_params.rbs +4 -0
  90. data/sig/dodopayments/models/product_collection_update_params.rbs +4 -0
  91. data/sig/dodopayments/models/refund.rbs +5 -0
  92. data/sig/dodopayments/models/refund_list_item.rbs +5 -0
  93. data/sig/dodopayments/models/subscription_active_webhook_event.rbs +7 -3
  94. data/sig/dodopayments/models/subscription_cancelled_webhook_event.rbs +7 -3
  95. data/sig/dodopayments/models/subscription_expired_webhook_event.rbs +7 -3
  96. data/sig/dodopayments/models/subscription_failed_webhook_event.rbs +7 -3
  97. data/sig/dodopayments/models/subscription_on_hold_webhook_event.rbs +7 -3
  98. data/sig/dodopayments/models/subscription_past_due_webhook_event.rbs +7 -3
  99. data/sig/dodopayments/models/subscription_paused_webhook_event.rbs +7 -3
  100. data/sig/dodopayments/models/subscription_plan_changed_webhook_event.rbs +7 -3
  101. data/sig/dodopayments/models/subscription_renewed_webhook_event.rbs +7 -3
  102. data/sig/dodopayments/models/subscription_service_period.rbs +35 -0
  103. data/sig/dodopayments/models/subscription_unpaused_webhook_event.rbs +7 -3
  104. data/sig/dodopayments/models/subscription_update_payment_method_webhook_event.rbs +7 -3
  105. data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +7 -3
  106. data/sig/dodopayments/models/update_subscription_plan_req.rbs +2 -0
  107. data/sig/dodopayments/models/webhook_payload.rbs +12 -2
  108. data/sig/dodopayments/models.rbs +4 -0
  109. data/sig/dodopayments/resources/invoices/payments.rbs +3 -0
  110. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31d8dde0b1d372c536b75511c1ce30d24fa8d6ab550d88d00d3d3448d807bec8
4
- data.tar.gz: 97aadbeb4c6baa9f16dd9b99f16c8b17ef7f09648f1cc022b9f29b1cdf0ae972
3
+ metadata.gz: c11a0d8230c984a0f1edb90a4ec17367c959b1184fb237167022cce1ffabef79
4
+ data.tar.gz: 65a53d9ea3bef5ff6f6ac1246ad5f58bf661299376465bd244cf89dc46518d6b
5
5
  SHA512:
6
- metadata.gz: 44bfb6e065329abd8699a19faf88228f368cb149839ddf19dacaea9865b53f4cb5a5e6c8dbdcfa07a904018781c69de2d7892c27c278d52608789d94b9526e14
7
- data.tar.gz: 866db267e7e2ff575c3d38c8691f0b257b1bb080de4ff4133fad701e98ecfb6cba799a69db9d3efd4580f729ae0477dd4eadcefa55a952004760200f3e5c5661
6
+ metadata.gz: 143d2ca167230b620f7fbce7e95bcb0ab604194841690113dd8c58609643d2faf141935105139492e60aa297ccfa70ac896f6b11b1334dcb934f67f6aaa280fd
7
+ data.tar.gz: b57185159507e699991b8bc47b7a8559260179cc013dadbd48e60bdb17d3d8108a31c689ec8c96bc308a631bac669ad5d09e9f3fab8aecb43718ce42adb95273
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.34.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.33.0...v2.34.0) (2026-10-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** payment charge type, usage flag and card details, signed invoice link tokens ([3b6eb1d](https://github.com/dodopayments/dodopayments-ruby/commit/3b6eb1d46ca7c02d279ab66c62a746e8df1f14d3))
9
+ * **api:** payment charge type, usage flag and card details, signed invoice link tokens ([f3d6720](https://github.com/dodopayments/dodopayments-ruby/commit/f3d67205537089c45bd7643f399bece43a7d56f5))
10
+
11
+ ## [2.33.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.32.2...v2.33.0) (2026-10-14)
12
+
13
+
14
+ ### Features
15
+
16
+ * **api:** payment service periods, retry attempts and subscription renewal payment_id ([4fc54c1](https://github.com/dodopayments/dodopayments-ruby/commit/4fc54c154ba2b49a904249f27d30a7b5b7fb165d))
17
+ * **api:** payment service periods, retry attempts and subscription renewal payment_id ([53b94e3](https://github.com/dodopayments/dodopayments-ruby/commit/53b94e35bbff1d1882582852e58e9cc592ab1772))
18
+
3
19
  ## [2.32.2](https://github.com/dodopayments/dodopayments-ruby/compare/v2.32.1...v2.32.2) (2026-10-09)
4
20
 
5
21
 
data/README.md CHANGED
@@ -23,7 +23,7 @@ To use this gem, install via Bundler by adding the following to your application
23
23
  <!-- x-release-please-start-version -->
24
24
 
25
25
  ```ruby
26
- gem "dodopayments", "~> 2.32.2"
26
+ gem "dodopayments", "~> 2.34.0"
27
27
  ```
28
28
 
29
29
  <!-- x-release-please-end -->
@@ -17,28 +17,28 @@ module Dodopayments
17
17
  # values safely.
18
18
  #
19
19
  # @example
20
- # # `intent_status` is a `Dodopayments::IntentStatus`
21
- # case intent_status
22
- # when Dodopayments::IntentStatus::SUCCEEDED
20
+ # # `charge_type` is a `Dodopayments::ChargeType`
21
+ # case charge_type
22
+ # when Dodopayments::ChargeType::NEW
23
23
  # # ...
24
- # when Dodopayments::IntentStatus::FAILED
24
+ # when Dodopayments::ChargeType::RENEWAL
25
25
  # # ...
26
- # when Dodopayments::IntentStatus::CANCELLED
26
+ # when Dodopayments::ChargeType::PLAN_CHANGE
27
27
  # # ...
28
28
  # else
29
- # puts(intent_status)
29
+ # puts(charge_type)
30
30
  # end
31
31
  #
32
32
  # @example
33
- # case intent_status
34
- # in :succeeded
33
+ # case charge_type
34
+ # in :new
35
35
  # # ...
36
- # in :failed
36
+ # in :renewal
37
37
  # # ...
38
- # in :cancelled
38
+ # in :plan_change
39
39
  # # ...
40
40
  # else
41
- # puts(intent_status)
41
+ # puts(charge_type)
42
42
  # end
43
43
  module Enum
44
44
  include Dodopayments::Internal::Type::Converter
@@ -119,6 +119,9 @@ module Dodopayments
119
119
  RESERVE_HOLD = :reserve_hold
120
120
  RESERVE_RELEASE = :reserve_release
121
121
  MODERATION_FEES = :moderation_fees
122
+ DODO_FIXED_FEE = :dodo_fixed_fee
123
+ INTERCHANGE_FEE = :interchange_fee
124
+ SCHEME_FEE = :scheme_fee
122
125
 
123
126
  # @!method self.values
124
127
  # @return [Array<Symbol>]
@@ -266,6 +266,9 @@ module Dodopayments
266
266
  RESERVE_HOLD = :reserve_hold
267
267
  RESERVE_RELEASE = :reserve_release
268
268
  MODERATION_FEES = :moderation_fees
269
+ DODO_FIXED_FEE = :dodo_fixed_fee
270
+ INTERCHANGE_FEE = :interchange_fee
271
+ SCHEME_FEE = :scheme_fee
269
272
 
270
273
  # @!method self.values
271
274
  # @return [Array<Symbol>]
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # The type of subscription charge that a payment is for.
6
+ #
7
+ # A payment has one invoice, and the invoice has one type. Thus each payment has
8
+ # one charge type. A payment that charges no subscription has no charge type.
9
+ #
10
+ # - `new`: the first payment of one or more subscriptions. A retry of that payment
11
+ # is also `new`. A cart with new subscriptions and one-time products is `new`.
12
+ # Read the one-time products from `product_cart`.
13
+ # - `renewal`: a charge at the billing date. A dunning retry and a manual retry of
14
+ # that charge are also `renewal`. A `renewal` does not always extend the service
15
+ # period. For example, the usage settlement of a paused subscription is a
16
+ # `renewal` with `includes_usage` true and no entry in `service_periods`.
17
+ # Examine `service_periods` before you extend access.
18
+ # - `plan_change`: a charge for a plan change. The change applies now or at the
19
+ # next billing date.
20
+ # - `on_demand`: an on-demand charge of an on-demand subscription.
21
+ module ChargeType
22
+ extend Dodopayments::Internal::Type::Enum
23
+
24
+ NEW = :new
25
+ RENEWAL = :renewal
26
+ PLAN_CHANGE = :plan_change
27
+ ON_DEMAND = :on_demand
28
+
29
+ # @!method self.values
30
+ # @return [Array<Symbol>]
31
+ end
32
+ end
33
+ end
@@ -66,6 +66,9 @@ module Dodopayments
66
66
  # @!attribute allow_discount_code
67
67
  # If the customer is allowed to apply discount code, set it to true.
68
68
  #
69
+ # If this flag is false, the customer cannot change the discount codes. The
70
+ # discount codes that you give when you create the session still apply.
71
+ #
69
72
  # Default is true
70
73
  #
71
74
  # @return [Boolean, nil]
@@ -301,6 +301,15 @@ module Dodopayments
301
301
  # @return [Integer, nil]
302
302
  optional :discount_cycle, Integer, nil?: true
303
303
 
304
+ # @!attribute monthly_equivalent
305
+ # The monthly equivalent of the yearly unit price after discounts, in minor units
306
+ # of `currency`. Only the hosted checkout sets it, when the business shows yearly
307
+ # plans as monthly. The value is only for display. The order summary shows the
308
+ # amounts that we charge.
309
+ #
310
+ # @return [Integer, nil]
311
+ optional :monthly_equivalent, Integer, nil?: true
312
+
304
313
  # @!attribute name
305
314
  # name of the product
306
315
  #
@@ -313,7 +322,7 @@ module Dodopayments
313
322
  # @return [Integer, nil]
314
323
  optional :tax, Integer, nil?: true
315
324
 
316
- # @!method initialize(credit_entitlements:, currency:, discounted_price:, is_subscription:, is_usage_based:, meters:, og_currency:, og_price:, product_id:, quantity:, tax_category:, tax_inclusive:, tax_rate:, addons: nil, description: nil, discount_amount: nil, discount_cycle: nil, name: nil, tax: nil)
325
+ # @!method initialize(credit_entitlements:, currency:, discounted_price:, is_subscription:, is_usage_based:, meters:, og_currency:, og_price:, product_id:, quantity:, tax_category:, tax_inclusive:, tax_rate:, addons: nil, description: nil, discount_amount: nil, discount_cycle: nil, monthly_equivalent: nil, name: nil, tax: nil)
317
326
  # Some parameter documentations has been truncated, see
318
327
  # {Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart} for more
319
328
  # details.
@@ -352,6 +361,8 @@ module Dodopayments
352
361
  #
353
362
  # @param discount_cycle [Integer, nil] number of cycles the discount will apply
354
363
  #
364
+ # @param monthly_equivalent [Integer, nil] The monthly equivalent of the yearly unit price after discounts, in minor units
365
+ #
355
366
  # @param name [String, nil] name of the product
356
367
  #
357
368
  # @param tax [Integer, nil] total tax
@@ -13,8 +13,21 @@ module Dodopayments
13
13
  # @return [String]
14
14
  required :payment_id, String
15
15
 
16
- # @!method initialize(payment_id:, request_options: {})
16
+ # @!attribute token
17
+ # The signed link token. If the business asks for a credential on its invoice
18
+ # links, a valid token for this record replaces the credential.
19
+ #
20
+ # @return [String, nil]
21
+ optional :token, String
22
+
23
+ # @!method initialize(payment_id:, token: nil, request_options: {})
24
+ # Some parameter documentations has been truncated, see
25
+ # {Dodopayments::Models::Invoices::PaymentRetrieveParams} for more details.
26
+ #
17
27
  # @param payment_id [String]
28
+ #
29
+ # @param token [String] The signed link token. If the business asks for a credential on its invoice link
30
+ #
18
31
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
19
32
  end
20
33
  end
@@ -13,8 +13,21 @@ module Dodopayments
13
13
  # @return [String]
14
14
  required :payout_id, String
15
15
 
16
- # @!method initialize(payout_id:, request_options: {})
16
+ # @!attribute token
17
+ # The signed link token. If the business asks for a credential on its invoice
18
+ # links, a valid token for this record replaces the credential.
19
+ #
20
+ # @return [String, nil]
21
+ optional :token, String
22
+
23
+ # @!method initialize(payout_id:, token: nil, request_options: {})
24
+ # Some parameter documentations has been truncated, see
25
+ # {Dodopayments::Models::Invoices::PaymentRetrievePayoutParams} for more details.
26
+ #
17
27
  # @param payout_id [String]
28
+ #
29
+ # @param token [String] The signed link token. If the business asks for a credential on its invoice link
30
+ #
18
31
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
19
32
  end
20
33
  end
@@ -13,8 +13,21 @@ module Dodopayments
13
13
  # @return [String]
14
14
  required :refund_id, String
15
15
 
16
- # @!method initialize(refund_id:, request_options: {})
16
+ # @!attribute token
17
+ # The signed link token. If the business asks for a credential on its invoice
18
+ # links, a valid token for this record replaces the credential.
19
+ #
20
+ # @return [String, nil]
21
+ optional :token, String
22
+
23
+ # @!method initialize(refund_id:, token: nil, request_options: {})
24
+ # Some parameter documentations has been truncated, see
25
+ # {Dodopayments::Models::Invoices::PaymentRetrieveRefundParams} for more details.
26
+ #
17
27
  # @param refund_id [String]
28
+ #
29
+ # @param token [String] The signed link token. If the business asks for a credential on its invoice link
30
+ #
18
31
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
19
32
  end
20
33
  end
@@ -19,6 +19,26 @@ module Dodopayments
19
19
  # @return [Integer]
20
20
  required :sends_used, Integer
21
21
 
22
+ # @!attribute automatic_retry_number
23
+ # The number of the queued automatic retry, starting at 1.
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :automatic_retry_number, Integer, nil?: true
27
+
28
+ # @!attribute automatic_retry_total
29
+ # The number of automatic retries that the current configuration plans for this
30
+ # invoice. It is never less than `automatic_retry_number`.
31
+ #
32
+ # @return [Integer, nil]
33
+ optional :automatic_retry_total, Integer, nil?: true
34
+
35
+ # @!attribute next_automatic_retry_at
36
+ # When the next automatic retry on this invoice is scheduled. Null when no
37
+ # automatic retry is queued or automatic retries are disabled.
38
+ #
39
+ # @return [Time, nil]
40
+ optional :next_automatic_retry_at, Time, nil?: true
41
+
22
42
  # @!attribute reason
23
43
  # The code `POST` would fail with. Null when `can_retry` is true.
24
44
  #
@@ -32,7 +52,7 @@ module Dodopayments
32
52
  # @return [Time, nil]
33
53
  optional :retry_available_at, Time, nil?: true
34
54
 
35
- # @!method initialize(can_retry:, sends_allowed:, sends_used:, reason: nil, retry_available_at: nil)
55
+ # @!method initialize(can_retry:, sends_allowed:, sends_used:, automatic_retry_number: nil, automatic_retry_total: nil, next_automatic_retry_at: nil, reason: nil, retry_available_at: nil)
36
56
  # Some parameter documentations has been truncated, see
37
57
  # {Dodopayments::Models::ManualRetryState} for more details.
38
58
  #
@@ -42,6 +62,12 @@ module Dodopayments
42
62
  #
43
63
  # @param sends_used [Integer]
44
64
  #
65
+ # @param automatic_retry_number [Integer, nil] The number of the queued automatic retry, starting at 1.
66
+ #
67
+ # @param automatic_retry_total [Integer, nil] The number of automatic retries that the current configuration plans for
68
+ #
69
+ # @param next_automatic_retry_at [Time, nil] When the next automatic retry on this invoice is scheduled. Null when no
70
+ #
45
71
  # @param reason [String, nil] The code `POST` would fail with. Null when `can_retry` is true.
46
72
  #
47
73
  # @param retry_available_at [Time, nil] When the next send becomes available. Null when no send is left, or when
@@ -52,6 +52,14 @@ module Dodopayments
52
52
  # @return [Array<Dodopayments::Models::Dispute>]
53
53
  required :disputes, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Dispute] }
54
54
 
55
+ # @!attribute includes_usage
56
+ # True when this payment also bills metered usage or credit overage. The usage is
57
+ # for the billing cycle before the service period, not for the service period. The
58
+ # value is set for each payment status. It is false when `charge_type` is null.
59
+ #
60
+ # @return [Boolean]
61
+ required :includes_usage, Dodopayments::Internal::Type::Boolean
62
+
55
63
  # @!attribute is_multi_subscription
56
64
  # True when one payment starts more than one subscription. Read this field to find
57
65
  # the payment type. Do not read the length of `subscription_ids`. Do not read
@@ -100,6 +108,20 @@ module Dodopayments
100
108
  # @return [Integer]
101
109
  required :retry_attempt, Integer
102
110
 
111
+ # @!attribute service_periods
112
+ # The service period of each subscription that this payment pays for. The order is
113
+ # the same as `subscription_ids`. For a plan change charge, the period starts at
114
+ # the plan change and ends at the next billing date. The list is empty unless the
115
+ # payment status is `succeeded`. The list is also empty for a one-time payment, an
116
+ # on-demand charge, or a payment method update. The list is set for `new`,
117
+ # `renewal` and `plan_change` charges that succeeded. It can be empty for some
118
+ # zero-amount payments. A `renewal` with no entry for its subscription bills usage
119
+ # only. That payment does not extend the service period.
120
+ #
121
+ # @return [Array<Dodopayments::Models::SubscriptionServicePeriod>]
122
+ required :service_periods,
123
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::SubscriptionServicePeriod] }
124
+
103
125
  # @!attribute settlement_amount
104
126
  # The amount that will be credited to your Dodo balance after currency conversion
105
127
  # and processing. Especially relevant for adaptive pricing where the customer's
@@ -132,6 +154,22 @@ module Dodopayments
132
154
  # @return [Integer]
133
155
  required :total_amount, Integer
134
156
 
157
+ # @!attribute card_exp_month
158
+ # Expiry month of the card, as two digits from `01` to `12`. For Apple Pay and
159
+ # Google Pay, this is the expiry of the wallet token, which can differ from the
160
+ # expiry of the physical card.
161
+ #
162
+ # @return [String, nil]
163
+ optional :card_exp_month, String, nil?: true
164
+
165
+ # @!attribute card_exp_year
166
+ # Expiry year of the card, as four digits, for example `2029`. For Apple Pay and
167
+ # Google Pay, this is the expiry of the wallet token, which can differ from the
168
+ # expiry of the physical card.
169
+ #
170
+ # @return [String, nil]
171
+ optional :card_exp_year, String, nil?: true
172
+
135
173
  # @!attribute card_holder_name
136
174
  # Cardholder name
137
175
  #
@@ -151,17 +189,27 @@ module Dodopayments
151
189
  optional :card_last_four, String, nil?: true
152
190
 
153
191
  # @!attribute card_network
154
- # Card network like VISA, MASTERCARD etc.
192
+ # Card network, in lowercase, for example `visa`, `mastercard` or `amex`. Older
193
+ # payments can carry other casing.
155
194
  #
156
195
  # @return [String, nil]
157
196
  optional :card_network, String, nil?: true
158
197
 
159
198
  # @!attribute card_type
160
- # The type of card DEBIT or CREDIT
199
+ # The type of card, in lowercase: `credit`, `debit` or `prepaid`. Older payments
200
+ # can carry other casing.
161
201
  #
162
202
  # @return [String, nil]
163
203
  optional :card_type, String, nil?: true
164
204
 
205
+ # @!attribute charge_type
206
+ # The type of subscription charge that this payment is for. Refer to `ChargeType`.
207
+ # The value is set for each payment status, not only for `succeeded`. The value is
208
+ # null when this payment charges no subscription.
209
+ #
210
+ # @return [Symbol, Dodopayments::Models::ChargeType, nil]
211
+ optional :charge_type, enum: -> { Dodopayments::ChargeType }, nil?: true
212
+
165
213
  # @!attribute checkout_session_id
166
214
  # If payment is made using a checkout session, this field is set to the id of the
167
215
  # session.
@@ -214,7 +262,11 @@ module Dodopayments
214
262
  optional :invoice_id, String, nil?: true
215
263
 
216
264
  # @!attribute invoice_url
217
- # URL to download the invoice PDF for this payment.
265
+ # @deprecated Use `GET /invoices/payments/{payment_id}` with an API key.
266
+ #
267
+ # DEPRECATED: Use `GET /invoices/payments/{payment_id}` with an API key. URL to
268
+ # download the invoice PDF for this payment. The URL has no signed token. If the
269
+ # business asks for a credential on its invoice links, the URL needs an API key.
218
270
  #
219
271
  # @return [String, nil]
220
272
  optional :invoice_url, String, nil?: true
@@ -293,7 +345,7 @@ module Dodopayments
293
345
  # @return [Time, nil]
294
346
  optional :updated_at, Time, nil?: true
295
347
 
296
- # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, is_multi_subscription:, is_update_payment_method:, metadata:, payment_id:, payment_provider:, refunds:, retry_attempt:, settlement_amount:, settlement_currency:, subscription_ids:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, custom_field_responses: nil, discount_id: nil, discounts: nil, error_code: nil, error_message: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_id: nil, payment_method_type: nil, product_cart: nil, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
348
+ # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, includes_usage:, is_multi_subscription:, is_update_payment_method:, metadata:, payment_id:, payment_provider:, refunds:, retry_attempt:, service_periods:, settlement_amount:, settlement_currency:, subscription_ids:, total_amount:, card_exp_month: nil, card_exp_year: nil, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, charge_type: nil, checkout_session_id: nil, custom_field_responses: nil, discount_id: nil, discounts: nil, error_code: nil, error_message: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_id: nil, payment_method_type: nil, product_cart: nil, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
297
349
  # Some parameter documentations has been truncated, see
298
350
  # {Dodopayments::Models::Payment} for more details.
299
351
  #
@@ -313,6 +365,8 @@ module Dodopayments
313
365
  #
314
366
  # @param disputes [Array<Dodopayments::Models::Dispute>] List of disputes associated with this payment
315
367
  #
368
+ # @param includes_usage [Boolean] True when this payment also bills metered usage or credit overage. The usage is
369
+ #
316
370
  # @param is_multi_subscription [Boolean] True when one payment starts more than one subscription. Read this field
317
371
  #
318
372
  # @param is_update_payment_method [Boolean] Whether this payment was created solely to update a subscription's
@@ -327,6 +381,8 @@ module Dodopayments
327
381
  #
328
382
  # @param retry_attempt [Integer] Retry attempt number for subscription renewal payments.
329
383
  #
384
+ # @param service_periods [Array<Dodopayments::Models::SubscriptionServicePeriod>] The service period of each subscription that this payment pays for.
385
+ #
330
386
  # @param settlement_amount [Integer] The amount that will be credited to your Dodo balance after currency conversion
331
387
  #
332
388
  # @param settlement_currency [Symbol, Dodopayments::Models::Currency] The currency in which the settlement_amount will be credited to your Dodo balanc
@@ -335,15 +391,21 @@ module Dodopayments
335
391
  #
336
392
  # @param total_amount [Integer] Total amount charged to the customer including tax, in the currency's smallest u
337
393
  #
394
+ # @param card_exp_month [String, nil] Expiry month of the card, as two digits from `01` to `12`. For Apple Pay and
395
+ #
396
+ # @param card_exp_year [String, nil] Expiry year of the card, as four digits, for example `2029`. For Apple Pay and
397
+ #
338
398
  # @param card_holder_name [String, nil] Cardholder name
339
399
  #
340
400
  # @param card_issuing_country [Symbol, Dodopayments::Models::CountryCode, nil] ISO2 country code of the card
341
401
  #
342
402
  # @param card_last_four [String, nil] The last four digits of the card
343
403
  #
344
- # @param card_network [String, nil] Card network like VISA, MASTERCARD etc.
404
+ # @param card_network [String, nil] Card network, in lowercase, for example `visa`, `mastercard` or `amex`. Older pa
405
+ #
406
+ # @param card_type [String, nil] The type of card, in lowercase: `credit`, `debit` or `prepaid`. Older payments c
345
407
  #
346
- # @param card_type [String, nil] The type of card DEBIT or CREDIT
408
+ # @param charge_type [Symbol, Dodopayments::Models::ChargeType, nil] The type of subscription charge that this payment is for. Refer to `ChargeType`.
347
409
  #
348
410
  # @param checkout_session_id [String, nil] If payment is made using a checkout session,
349
411
  #
@@ -359,7 +421,7 @@ module Dodopayments
359
421
  #
360
422
  # @param invoice_id [String, nil] Invoice ID for this payment. Uses India-specific invoice ID if available.
361
423
  #
362
- # @param invoice_url [String, nil] URL to download the invoice PDF for this payment.
424
+ # @param invoice_url [String, nil] DEPRECATED: Use `GET /invoices/payments/{payment_id}` with an API key.
363
425
  #
364
426
  # @param payment_link [String, nil] Checkout URL
365
427
  #
@@ -34,6 +34,14 @@ module Dodopayments
34
34
  # @return [Boolean]
35
35
  required :has_license_key, Dodopayments::Internal::Type::Boolean
36
36
 
37
+ # @!attribute includes_usage
38
+ # True when this payment also bills metered usage or credit overage. The usage is
39
+ # for the billing cycle before the service period, not for the service period. The
40
+ # value is set for each payment status. It is false when `charge_type` is null.
41
+ #
42
+ # @return [Boolean]
43
+ required :includes_usage, Dodopayments::Internal::Type::Boolean
44
+
37
45
  # @!attribute is_multi_subscription
38
46
  # True when one payment starts more than one subscription. Read this field to find
39
47
  # the payment type. Do not read the length of `subscription_ids`. Do not read
@@ -60,6 +68,28 @@ module Dodopayments
60
68
  # @return [Symbol, Dodopayments::Models::PaymentListResponse::PaymentProvider]
61
69
  required :payment_provider, enum: -> { Dodopayments::Models::PaymentListResponse::PaymentProvider }
62
70
 
71
+ # @!attribute retry_attempt
72
+ # The retry attempt number of this payment. The value is `0` for the original
73
+ # payment. Each retry after a failed subscription renewal adds `1`. The value is
74
+ # always `0` for a payment that is not for a subscription.
75
+ #
76
+ # @return [Integer]
77
+ required :retry_attempt, Integer
78
+
79
+ # @!attribute service_periods
80
+ # The service period of each subscription that this payment pays for. The order is
81
+ # the same as `subscription_ids`. For a plan change charge, the period starts at
82
+ # the plan change and ends at the next billing date. The list is empty unless the
83
+ # payment status is `succeeded`. The list is also empty for a one-time payment, an
84
+ # on-demand charge, or a payment method update. The list is set for `new`,
85
+ # `renewal` and `plan_change` charges that succeeded. It can be empty for some
86
+ # zero-amount payments. A `renewal` with no entry for its subscription bills usage
87
+ # only. That payment does not extend the service period.
88
+ #
89
+ # @return [Array<Dodopayments::Models::SubscriptionServicePeriod>]
90
+ required :service_periods,
91
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::SubscriptionServicePeriod] }
92
+
63
93
  # @!attribute subscription_ids
64
94
  # Every subscription that this payment starts or charges, in a stable order. It is
65
95
  # empty for a one-time payment. It holds the value of `subscription_id` when the
@@ -73,6 +103,22 @@ module Dodopayments
73
103
  # @return [Integer]
74
104
  required :total_amount, Integer
75
105
 
106
+ # @!attribute card_exp_month
107
+ # Expiry month of the card, as two digits from `01` to `12`. For Apple Pay and
108
+ # Google Pay, this is the expiry of the wallet token, which can differ from the
109
+ # expiry of the physical card.
110
+ #
111
+ # @return [String, nil]
112
+ optional :card_exp_month, String, nil?: true
113
+
114
+ # @!attribute card_exp_year
115
+ # Expiry year of the card, as four digits, for example `2029`. For Apple Pay and
116
+ # Google Pay, this is the expiry of the wallet token, which can differ from the
117
+ # expiry of the physical card.
118
+ #
119
+ # @return [String, nil]
120
+ optional :card_exp_year, String, nil?: true
121
+
76
122
  # @!attribute card_last_four
77
123
  # The last four digits of the card
78
124
  #
@@ -80,11 +126,34 @@ module Dodopayments
80
126
  optional :card_last_four, String, nil?: true
81
127
 
82
128
  # @!attribute card_network
83
- # Card network like VISA, MASTERCARD etc.
129
+ # Card network, in lowercase, for example `visa`, `mastercard` or `amex`. Older
130
+ # payments can carry other casing.
84
131
  #
85
132
  # @return [String, nil]
86
133
  optional :card_network, String, nil?: true
87
134
 
135
+ # @!attribute card_type
136
+ # The type of card, in lowercase: `credit`, `debit` or `prepaid`. Older payments
137
+ # can carry other casing.
138
+ #
139
+ # @return [String, nil]
140
+ optional :card_type, String, nil?: true
141
+
142
+ # @!attribute charge_type
143
+ # The type of subscription charge that this payment is for. Refer to `ChargeType`.
144
+ # The value is set for each payment status, not only for `succeeded`. The value is
145
+ # null when this payment charges no subscription.
146
+ #
147
+ # @return [Symbol, Dodopayments::Models::ChargeType, nil]
148
+ optional :charge_type, enum: -> { Dodopayments::ChargeType }, nil?: true
149
+
150
+ # @!attribute checkout_session_id
151
+ # The ID of the checkout session for this payment. The value is null when the
152
+ # payment does not use a checkout session.
153
+ #
154
+ # @return [String, nil]
155
+ optional :checkout_session_id, String, nil?: true
156
+
88
157
  # @!attribute dispute_status
89
158
  # The most recent dispute status for this payment. None if no disputes exist.
90
159
  #
@@ -98,7 +167,11 @@ module Dodopayments
98
167
  optional :invoice_id, String, nil?: true
99
168
 
100
169
  # @!attribute invoice_url
101
- # URL to download the invoice PDF for this payment.
170
+ # @deprecated Use `GET /invoices/payments/{payment_id}` with an API key.
171
+ #
172
+ # DEPRECATED: Use `GET /invoices/payments/{payment_id}` with an API key. URL to
173
+ # download the invoice PDF for this payment. The URL has no signed token. If the
174
+ # business asks for a credential on its invoice links, the URL needs an API key.
102
175
  #
103
176
  # @return [String, nil]
104
177
  optional :invoice_url, String, nil?: true
@@ -130,7 +203,7 @@ module Dodopayments
130
203
  # @return [String, nil]
131
204
  optional :subscription_id, String, nil?: true
132
205
 
133
- # @!method initialize(brand_id:, created_at:, currency:, customer:, digital_products_delivered:, has_license_key:, is_multi_subscription:, metadata:, payment_id:, payment_provider:, subscription_ids:, total_amount:, card_last_four: nil, card_network: nil, dispute_status: nil, invoice_id: nil, invoice_url: nil, payment_method: nil, payment_method_type: nil, refund_status: nil, status: nil, subscription_id: nil)
206
+ # @!method initialize(brand_id:, created_at:, currency:, customer:, digital_products_delivered:, has_license_key:, includes_usage:, is_multi_subscription:, metadata:, payment_id:, payment_provider:, retry_attempt:, service_periods:, subscription_ids:, total_amount:, card_exp_month: nil, card_exp_year: nil, card_last_four: nil, card_network: nil, card_type: nil, charge_type: nil, checkout_session_id: nil, dispute_status: nil, invoice_id: nil, invoice_url: nil, payment_method: nil, payment_method_type: nil, refund_status: nil, status: nil, subscription_id: nil)
134
207
  # Some parameter documentations has been truncated, see
135
208
  # {Dodopayments::Models::PaymentListResponse} for more details.
136
209
  #
@@ -146,6 +219,8 @@ module Dodopayments
146
219
  #
147
220
  # @param has_license_key [Boolean]
148
221
  #
222
+ # @param includes_usage [Boolean] True when this payment also bills metered usage or credit overage. The usage is
223
+ #
149
224
  # @param is_multi_subscription [Boolean] True when one payment starts more than one subscription. Read this field
150
225
  #
151
226
  # @param metadata [Hash{Symbol=>String, Float, Boolean}] Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
@@ -154,19 +229,33 @@ module Dodopayments
154
229
  #
155
230
  # @param payment_provider [Symbol, Dodopayments::Models::PaymentListResponse::PaymentProvider] Which processor handled this payment. `stripe` / `adyen` for BYOP routes
156
231
  #
232
+ # @param retry_attempt [Integer] The retry attempt number of this payment. The value is `0` for the original
233
+ #
234
+ # @param service_periods [Array<Dodopayments::Models::SubscriptionServicePeriod>] The service period of each subscription that this payment pays for.
235
+ #
157
236
  # @param subscription_ids [Array<String>] Every subscription that this payment starts or charges, in a stable order.
158
237
  #
159
238
  # @param total_amount [Integer]
160
239
  #
240
+ # @param card_exp_month [String, nil] Expiry month of the card, as two digits from `01` to `12`. For Apple Pay and
241
+ #
242
+ # @param card_exp_year [String, nil] Expiry year of the card, as four digits, for example `2029`. For Apple Pay and
243
+ #
161
244
  # @param card_last_four [String, nil] The last four digits of the card
162
245
  #
163
- # @param card_network [String, nil] Card network like VISA, MASTERCARD etc.
246
+ # @param card_network [String, nil] Card network, in lowercase, for example `visa`, `mastercard` or `amex`. Older pa
247
+ #
248
+ # @param card_type [String, nil] The type of card, in lowercase: `credit`, `debit` or `prepaid`. Older payments c
249
+ #
250
+ # @param charge_type [Symbol, Dodopayments::Models::ChargeType, nil] The type of subscription charge that this payment is for. Refer to `ChargeType`.
251
+ #
252
+ # @param checkout_session_id [String, nil] The ID of the checkout session for this payment. The value is null when
164
253
  #
165
254
  # @param dispute_status [Symbol, Dodopayments::Models::DisputeStatus, nil] The most recent dispute status for this payment. None if no disputes exist.
166
255
  #
167
256
  # @param invoice_id [String, nil] Invoice ID for this payment. Uses India-specific invoice ID if available.
168
257
  #
169
- # @param invoice_url [String, nil] URL to download the invoice PDF for this payment.
258
+ # @param invoice_url [String, nil] DEPRECATED: Use `GET /invoices/payments/{payment_id}` with an API key.
170
259
  #
171
260
  # @param payment_method [String, nil]
172
261
  #