dodopayments 1.19.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.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -0
  3. data/README.md +5 -5
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/internal/default_page_number_pagination.rb +2 -2
  6. data/lib/dodopayments/internal/transport/base_client.rb +3 -3
  7. data/lib/dodopayments/internal/type/base_model.rb +1 -9
  8. data/lib/dodopayments/internal/type/request_parameters.rb +2 -8
  9. data/lib/dodopayments/internal/util.rb +20 -4
  10. data/lib/dodopayments/models/addon_cart_response_item.rb +23 -0
  11. data/lib/dodopayments/models/addon_create_params.rb +58 -0
  12. data/lib/dodopayments/models/addon_list_params.rb +30 -0
  13. data/lib/dodopayments/models/addon_response.rb +93 -0
  14. data/lib/dodopayments/models/addon_retrieve_params.rb +14 -0
  15. data/lib/dodopayments/models/addon_update_images_params.rb +14 -0
  16. data/lib/dodopayments/models/addon_update_images_response.rb +22 -0
  17. data/lib/dodopayments/models/addon_update_params.rb +66 -0
  18. data/lib/dodopayments/models/currency.rb +158 -0
  19. data/lib/dodopayments/models/dispute.rb +9 -2
  20. data/lib/dodopayments/models/dispute_list_response.rb +76 -0
  21. data/lib/dodopayments/models/dispute_retrieve_response.rb +99 -0
  22. data/lib/dodopayments/models/payment.rb +46 -315
  23. data/lib/dodopayments/models/payment_create_params.rb +3 -158
  24. data/lib/dodopayments/models/payment_list_response.rb +3 -157
  25. data/lib/dodopayments/models/payout_list_response.rb +3 -157
  26. data/lib/dodopayments/models/price.rb +6 -314
  27. data/lib/dodopayments/models/product.rb +3 -19
  28. data/lib/dodopayments/models/product_create_params.rb +3 -17
  29. data/lib/dodopayments/models/product_list_response.rb +6 -176
  30. data/lib/dodopayments/models/product_update_params.rb +3 -17
  31. data/lib/dodopayments/models/refund.rb +3 -157
  32. data/lib/dodopayments/models/subscription.rb +21 -158
  33. data/lib/dodopayments/models/subscription_change_plan_params.rb +31 -1
  34. data/lib/dodopayments/models/subscription_create_params.rb +30 -159
  35. data/lib/dodopayments/models/subscription_create_response.rb +10 -1
  36. data/lib/dodopayments/models/subscription_list_response.rb +179 -0
  37. data/lib/dodopayments/models/subscription_update_params.rb +19 -1
  38. data/lib/dodopayments/models/tax_category.rb +19 -0
  39. data/lib/dodopayments/models.rb +167 -0
  40. data/lib/dodopayments/resources/addons.rb +141 -0
  41. data/lib/dodopayments/resources/disputes.rb +4 -4
  42. data/lib/dodopayments/resources/invoices/payments.rb +3 -2
  43. data/lib/dodopayments/resources/payments.rb +1 -1
  44. data/lib/dodopayments/resources/products.rb +2 -2
  45. data/lib/dodopayments/resources/subscriptions.rb +15 -6
  46. data/lib/dodopayments/version.rb +1 -1
  47. data/lib/dodopayments.rb +14 -0
  48. data/rbi/dodopayments/client.rbi +3 -0
  49. data/rbi/dodopayments/errors.rbi +1 -1
  50. data/rbi/dodopayments/internal/util.rbi +5 -1
  51. data/rbi/dodopayments/models/addon_cart_response_item.rbi +20 -0
  52. data/rbi/dodopayments/models/addon_create_params.rbi +69 -0
  53. data/rbi/dodopayments/models/addon_list_params.rbi +45 -0
  54. data/rbi/dodopayments/models/addon_response.rbi +103 -0
  55. data/rbi/dodopayments/models/addon_retrieve_params.rbi +19 -0
  56. data/rbi/dodopayments/models/addon_update_images_params.rbi +19 -0
  57. data/rbi/dodopayments/models/addon_update_images_response.rbi +19 -0
  58. data/rbi/dodopayments/models/addon_update_params.rbi +77 -0
  59. data/rbi/dodopayments/models/currency.rbi +161 -0
  60. data/rbi/dodopayments/models/dispute.rbi +11 -3
  61. data/rbi/dodopayments/models/dispute_list_response.rbi +85 -0
  62. data/rbi/dodopayments/models/dispute_retrieve_response.rbi +112 -0
  63. data/rbi/dodopayments/models/payment.rbi +47 -318
  64. data/rbi/dodopayments/models/payment_create_params.rbi +3 -159
  65. data/rbi/dodopayments/models/payment_list_response.rbi +3 -159
  66. data/rbi/dodopayments/models/payout_list_response.rbi +3 -159
  67. data/rbi/dodopayments/models/price.rbi +6 -318
  68. data/rbi/dodopayments/models/product.rbi +3 -20
  69. data/rbi/dodopayments/models/product_create_params.rbi +3 -21
  70. data/rbi/dodopayments/models/product_list_response.rbi +6 -180
  71. data/rbi/dodopayments/models/product_update_params.rbi +3 -21
  72. data/rbi/dodopayments/models/refund.rbi +3 -159
  73. data/rbi/dodopayments/models/subscription.rbi +19 -159
  74. data/rbi/dodopayments/models/subscription_change_plan_params.rbi +26 -0
  75. data/rbi/dodopayments/models/subscription_create_params.rbi +27 -160
  76. data/rbi/dodopayments/models/subscription_create_response.rbi +8 -0
  77. data/rbi/dodopayments/models/subscription_list_response.rbi +190 -0
  78. data/rbi/dodopayments/models/subscription_update_params.rbi +37 -1
  79. data/rbi/dodopayments/models/tax_category.rbi +22 -0
  80. data/rbi/dodopayments/models.rbi +167 -0
  81. data/rbi/dodopayments/resources/addons.rbi +97 -0
  82. data/rbi/dodopayments/resources/disputes.rbi +2 -2
  83. data/rbi/dodopayments/resources/invoices/payments.rbi +1 -1
  84. data/rbi/dodopayments/resources/payments.rbi +1 -1
  85. data/rbi/dodopayments/resources/products.rbi +2 -2
  86. data/rbi/dodopayments/resources/subscriptions.rbi +19 -2
  87. data/sig/dodopayments/client.rbs +2 -0
  88. data/sig/dodopayments/internal/util.rbs +2 -0
  89. data/sig/dodopayments/models/addon_cart_response_item.rbs +15 -0
  90. data/sig/dodopayments/models/addon_create_params.rbs +39 -0
  91. data/sig/dodopayments/models/addon_list_params.rbs +24 -0
  92. data/sig/dodopayments/models/addon_response.rbs +54 -0
  93. data/sig/dodopayments/models/addon_retrieve_params.rbs +15 -0
  94. data/sig/dodopayments/models/addon_update_images_params.rbs +15 -0
  95. data/sig/dodopayments/models/addon_update_images_response.rbs +15 -0
  96. data/sig/dodopayments/models/addon_update_params.rbs +43 -0
  97. data/sig/dodopayments/models/currency.rbs +302 -0
  98. data/sig/dodopayments/models/dispute.rbs +6 -2
  99. data/sig/dodopayments/models/dispute_list_response.rbs +46 -0
  100. data/sig/dodopayments/models/dispute_retrieve_response.rbs +58 -0
  101. data/sig/dodopayments/models/payment.rbs +26 -604
  102. data/sig/dodopayments/models/payment_create_params.rbs +3 -302
  103. data/sig/dodopayments/models/payment_list_response.rbs +3 -302
  104. data/sig/dodopayments/models/payout_list_response.rbs +3 -302
  105. data/sig/dodopayments/models/price.rbs +6 -604
  106. data/sig/dodopayments/models/product.rbs +3 -16
  107. data/sig/dodopayments/models/product_create_params.rbs +3 -16
  108. data/sig/dodopayments/models/product_list_response.rbs +6 -318
  109. data/sig/dodopayments/models/product_update_params.rbs +3 -16
  110. data/sig/dodopayments/models/refund.rbs +3 -302
  111. data/sig/dodopayments/models/subscription.rbs +11 -302
  112. data/sig/dodopayments/models/subscription_change_plan_params.rbs +17 -1
  113. data/sig/dodopayments/models/subscription_create_params.rbs +19 -302
  114. data/sig/dodopayments/models/subscription_create_response.rbs +4 -0
  115. data/sig/dodopayments/models/subscription_list_response.rbs +98 -0
  116. data/sig/dodopayments/models/subscription_update_params.rbs +14 -0
  117. data/sig/dodopayments/models/tax_category.rbs +16 -0
  118. data/sig/dodopayments/models.rbs +165 -0
  119. data/sig/dodopayments/resources/addons.rbs +43 -0
  120. data/sig/dodopayments/resources/disputes.rbs +2 -2
  121. data/sig/dodopayments/resources/invoices/payments.rbs +1 -1
  122. data/sig/dodopayments/resources/payments.rbs +1 -1
  123. data/sig/dodopayments/resources/products.rbs +2 -2
  124. data/sig/dodopayments/resources/subscriptions.rbs +5 -2
  125. metadata +49 -4
@@ -0,0 +1,158 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Currency
6
+ extend Dodopayments::Internal::Type::Enum
7
+
8
+ AED = :AED
9
+ ALL = :ALL
10
+ AMD = :AMD
11
+ ANG = :ANG
12
+ AOA = :AOA
13
+ ARS = :ARS
14
+ AUD = :AUD
15
+ AWG = :AWG
16
+ AZN = :AZN
17
+ BAM = :BAM
18
+ BBD = :BBD
19
+ BDT = :BDT
20
+ BGN = :BGN
21
+ BHD = :BHD
22
+ BIF = :BIF
23
+ BMD = :BMD
24
+ BND = :BND
25
+ BOB = :BOB
26
+ BRL = :BRL
27
+ BSD = :BSD
28
+ BWP = :BWP
29
+ BYN = :BYN
30
+ BZD = :BZD
31
+ CAD = :CAD
32
+ CHF = :CHF
33
+ CLP = :CLP
34
+ CNY = :CNY
35
+ COP = :COP
36
+ CRC = :CRC
37
+ CUP = :CUP
38
+ CVE = :CVE
39
+ CZK = :CZK
40
+ DJF = :DJF
41
+ DKK = :DKK
42
+ DOP = :DOP
43
+ DZD = :DZD
44
+ EGP = :EGP
45
+ ETB = :ETB
46
+ EUR = :EUR
47
+ FJD = :FJD
48
+ FKP = :FKP
49
+ GBP = :GBP
50
+ GEL = :GEL
51
+ GHS = :GHS
52
+ GIP = :GIP
53
+ GMD = :GMD
54
+ GNF = :GNF
55
+ GTQ = :GTQ
56
+ GYD = :GYD
57
+ HKD = :HKD
58
+ HNL = :HNL
59
+ HRK = :HRK
60
+ HTG = :HTG
61
+ HUF = :HUF
62
+ IDR = :IDR
63
+ ILS = :ILS
64
+ INR = :INR
65
+ IQD = :IQD
66
+ JMD = :JMD
67
+ JOD = :JOD
68
+ JPY = :JPY
69
+ KES = :KES
70
+ KGS = :KGS
71
+ KHR = :KHR
72
+ KMF = :KMF
73
+ KRW = :KRW
74
+ KWD = :KWD
75
+ KYD = :KYD
76
+ KZT = :KZT
77
+ LAK = :LAK
78
+ LBP = :LBP
79
+ LKR = :LKR
80
+ LRD = :LRD
81
+ LSL = :LSL
82
+ LYD = :LYD
83
+ MAD = :MAD
84
+ MDL = :MDL
85
+ MGA = :MGA
86
+ MKD = :MKD
87
+ MMK = :MMK
88
+ MNT = :MNT
89
+ MOP = :MOP
90
+ MRU = :MRU
91
+ MUR = :MUR
92
+ MVR = :MVR
93
+ MWK = :MWK
94
+ MXN = :MXN
95
+ MYR = :MYR
96
+ MZN = :MZN
97
+ NAD = :NAD
98
+ NGN = :NGN
99
+ NIO = :NIO
100
+ NOK = :NOK
101
+ NPR = :NPR
102
+ NZD = :NZD
103
+ OMR = :OMR
104
+ PAB = :PAB
105
+ PEN = :PEN
106
+ PGK = :PGK
107
+ PHP = :PHP
108
+ PKR = :PKR
109
+ PLN = :PLN
110
+ PYG = :PYG
111
+ QAR = :QAR
112
+ RON = :RON
113
+ RSD = :RSD
114
+ RUB = :RUB
115
+ RWF = :RWF
116
+ SAR = :SAR
117
+ SBD = :SBD
118
+ SCR = :SCR
119
+ SEK = :SEK
120
+ SGD = :SGD
121
+ SHP = :SHP
122
+ SLE = :SLE
123
+ SLL = :SLL
124
+ SOS = :SOS
125
+ SRD = :SRD
126
+ SSP = :SSP
127
+ STN = :STN
128
+ SVC = :SVC
129
+ SZL = :SZL
130
+ THB = :THB
131
+ TND = :TND
132
+ TOP = :TOP
133
+ TRY = :TRY
134
+ TTD = :TTD
135
+ TWD = :TWD
136
+ TZS = :TZS
137
+ UAH = :UAH
138
+ UGX = :UGX
139
+ USD = :USD
140
+ UYU = :UYU
141
+ UZS = :UZS
142
+ VES = :VES
143
+ VND = :VND
144
+ VUV = :VUV
145
+ WST = :WST
146
+ XAF = :XAF
147
+ XCD = :XCD
148
+ XOF = :XOF
149
+ XPF = :XPF
150
+ YER = :YER
151
+ ZAR = :ZAR
152
+ ZMW = :ZMW
153
+
154
+ # @!method self.values
155
+ # @return [Array<Symbol>]
156
+ end
157
+ end
158
+ end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Dodopayments
4
4
  module Models
5
- # @see Dodopayments::Resources::Disputes#retrieve
6
5
  class Dispute < Dodopayments::Internal::Type::BaseModel
7
6
  # @!attribute amount
8
7
  # The amount involved in the dispute, represented as a string to accommodate
@@ -51,7 +50,13 @@ module Dodopayments
51
50
  # @return [String]
52
51
  required :payment_id, String
53
52
 
54
- # @!method initialize(amount:, business_id:, created_at:, currency:, dispute_id:, dispute_stage:, dispute_status:, payment_id:)
53
+ # @!attribute remarks
54
+ # Remarks
55
+ #
56
+ # @return [String, nil]
57
+ optional :remarks, String, nil?: true
58
+
59
+ # @!method initialize(amount:, business_id:, created_at:, currency:, dispute_id:, dispute_stage:, dispute_status:, payment_id:, remarks: nil)
55
60
  # Some parameter documentations has been truncated, see
56
61
  # {Dodopayments::Models::Dispute} for more details.
57
62
  #
@@ -71,6 +76,8 @@ module Dodopayments
71
76
  # @param dispute_status [Symbol, Dodopayments::Models::DisputeStatus]
72
77
  #
73
78
  # @param payment_id [String] The unique identifier of the payment associated with the dispute.
79
+ #
80
+ # @param remarks [String, nil] Remarks
74
81
  end
75
82
  end
76
83
  end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Disputes#list
6
+ class DisputeListResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute amount
8
+ # The amount involved in the dispute, represented as a string to accommodate
9
+ # precision.
10
+ #
11
+ # @return [String]
12
+ required :amount, String
13
+
14
+ # @!attribute business_id
15
+ # The unique identifier of the business involved in the dispute.
16
+ #
17
+ # @return [String]
18
+ required :business_id, String
19
+
20
+ # @!attribute created_at
21
+ # The timestamp of when the dispute was created, in UTC.
22
+ #
23
+ # @return [Time]
24
+ required :created_at, Time
25
+
26
+ # @!attribute currency
27
+ # The currency of the disputed amount, represented as an ISO 4217 currency code.
28
+ #
29
+ # @return [String]
30
+ required :currency, String
31
+
32
+ # @!attribute dispute_id
33
+ # The unique identifier of the dispute.
34
+ #
35
+ # @return [String]
36
+ required :dispute_id, String
37
+
38
+ # @!attribute dispute_stage
39
+ #
40
+ # @return [Symbol, Dodopayments::Models::DisputeStage]
41
+ required :dispute_stage, enum: -> { Dodopayments::Models::DisputeStage }
42
+
43
+ # @!attribute dispute_status
44
+ #
45
+ # @return [Symbol, Dodopayments::Models::DisputeStatus]
46
+ required :dispute_status, enum: -> { Dodopayments::Models::DisputeStatus }
47
+
48
+ # @!attribute payment_id
49
+ # The unique identifier of the payment associated with the dispute.
50
+ #
51
+ # @return [String]
52
+ required :payment_id, String
53
+
54
+ # @!method initialize(amount:, business_id:, created_at:, currency:, dispute_id:, dispute_stage:, dispute_status:, payment_id:)
55
+ # Some parameter documentations has been truncated, see
56
+ # {Dodopayments::Models::DisputeListResponse} for more details.
57
+ #
58
+ # @param amount [String] The amount involved in the dispute, represented as a string to accommodate preci
59
+ # ...
60
+ #
61
+ # @param business_id [String] The unique identifier of the business involved in the dispute.
62
+ #
63
+ # @param created_at [Time] The timestamp of when the dispute was created, in UTC.
64
+ #
65
+ # @param currency [String] The currency of the disputed amount, represented as an ISO 4217 currency code.
66
+ #
67
+ # @param dispute_id [String] The unique identifier of the dispute.
68
+ #
69
+ # @param dispute_stage [Symbol, Dodopayments::Models::DisputeStage]
70
+ #
71
+ # @param dispute_status [Symbol, Dodopayments::Models::DisputeStatus]
72
+ #
73
+ # @param payment_id [String] The unique identifier of the payment associated with the dispute.
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Disputes#retrieve
6
+ class DisputeRetrieveResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute amount
8
+ # The amount involved in the dispute, represented as a string to accommodate
9
+ # precision.
10
+ #
11
+ # @return [String]
12
+ required :amount, String
13
+
14
+ # @!attribute business_id
15
+ # The unique identifier of the business involved in the dispute.
16
+ #
17
+ # @return [String]
18
+ required :business_id, String
19
+
20
+ # @!attribute created_at
21
+ # The timestamp of when the dispute was created, in UTC.
22
+ #
23
+ # @return [Time]
24
+ required :created_at, Time
25
+
26
+ # @!attribute currency
27
+ # The currency of the disputed amount, represented as an ISO 4217 currency code.
28
+ #
29
+ # @return [String]
30
+ required :currency, String
31
+
32
+ # @!attribute customer
33
+ #
34
+ # @return [Dodopayments::Models::CustomerLimitedDetails]
35
+ required :customer, -> { Dodopayments::Models::CustomerLimitedDetails }
36
+
37
+ # @!attribute dispute_id
38
+ # The unique identifier of the dispute.
39
+ #
40
+ # @return [String]
41
+ required :dispute_id, String
42
+
43
+ # @!attribute dispute_stage
44
+ #
45
+ # @return [Symbol, Dodopayments::Models::DisputeStage]
46
+ required :dispute_stage, enum: -> { Dodopayments::Models::DisputeStage }
47
+
48
+ # @!attribute dispute_status
49
+ #
50
+ # @return [Symbol, Dodopayments::Models::DisputeStatus]
51
+ required :dispute_status, enum: -> { Dodopayments::Models::DisputeStatus }
52
+
53
+ # @!attribute payment_id
54
+ # The unique identifier of the payment associated with the dispute.
55
+ #
56
+ # @return [String]
57
+ required :payment_id, String
58
+
59
+ # @!attribute reason
60
+ # Reason for the dispute
61
+ #
62
+ # @return [String, nil]
63
+ optional :reason, String, nil?: true
64
+
65
+ # @!attribute remarks
66
+ # Remarks
67
+ #
68
+ # @return [String, nil]
69
+ optional :remarks, String, nil?: true
70
+
71
+ # @!method initialize(amount:, business_id:, created_at:, currency:, customer:, dispute_id:, dispute_stage:, dispute_status:, payment_id:, reason: nil, remarks: nil)
72
+ # Some parameter documentations has been truncated, see
73
+ # {Dodopayments::Models::DisputeRetrieveResponse} for more details.
74
+ #
75
+ # @param amount [String] The amount involved in the dispute, represented as a string to accommodate preci
76
+ # ...
77
+ #
78
+ # @param business_id [String] The unique identifier of the business involved in the dispute.
79
+ #
80
+ # @param created_at [Time] The timestamp of when the dispute was created, in UTC.
81
+ #
82
+ # @param currency [String] The currency of the disputed amount, represented as an ISO 4217 currency code.
83
+ #
84
+ # @param customer [Dodopayments::Models::CustomerLimitedDetails]
85
+ #
86
+ # @param dispute_id [String] The unique identifier of the dispute.
87
+ #
88
+ # @param dispute_stage [Symbol, Dodopayments::Models::DisputeStage]
89
+ #
90
+ # @param dispute_status [Symbol, Dodopayments::Models::DisputeStatus]
91
+ #
92
+ # @param payment_id [String] The unique identifier of the payment associated with the dispute.
93
+ #
94
+ # @param reason [String, nil] Reason for the dispute
95
+ #
96
+ # @param remarks [String, nil] Remarks
97
+ end
98
+ end
99
+ end