dodopayments 2.34.0 → 2.36.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 +17 -0
- data/README.md +21 -1
- data/lib/dodopayments/client.rb +133 -4
- data/lib/dodopayments/models/addon_delete_params.rb +20 -0
- data/lib/dodopayments/models/addon_list_params.rb +25 -1
- data/lib/dodopayments/models/addon_retrieve_params.rb +18 -1
- data/lib/dodopayments/models/addon_unarchive_params.rb +20 -0
- data/lib/dodopayments/models/addons/translation_delete_params.rb +36 -0
- data/lib/dodopayments/models/addons/translation_list_params.rb +35 -0
- data/lib/dodopayments/models/addons/translation_update_params.rb +52 -0
- data/lib/dodopayments/models/balance_ledger_entry.rb +1 -0
- data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +1 -0
- data/lib/dodopayments/models/checkout_session_preview_params.rb +17 -1
- data/lib/dodopayments/models/create_new_customer.rb +12 -1
- data/lib/dodopayments/models/credit_entitlement_list_params.rb +17 -1
- data/lib/dodopayments/models/credit_entitlement_retrieve_params.rb +18 -1
- data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translation.rb +47 -0
- data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rb +23 -0
- data/lib/dodopayments/models/credit_entitlements/translation_delete_params.rb +37 -0
- data/lib/dodopayments/models/credit_entitlements/translation_list_params.rb +36 -0
- data/lib/dodopayments/models/credit_entitlements/translation_update_params.rb +53 -0
- data/lib/dodopayments/models/customer.rb +9 -1
- data/lib/dodopayments/models/customer_create_params.rb +14 -1
- data/lib/dodopayments/models/customer_update_params.rb +14 -1
- data/lib/dodopayments/models/entitlement_list_params.rb +17 -1
- data/lib/dodopayments/models/entitlement_retrieve_params.rb +18 -1
- data/lib/dodopayments/models/entitlements/entitlement_translation.rb +67 -0
- data/lib/dodopayments/models/entitlements/entitlement_translations_list_response.rb +23 -0
- data/lib/dodopayments/models/entitlements/translation_delete_params.rb +36 -0
- data/lib/dodopayments/models/entitlements/translation_list_params.rb +35 -0
- data/lib/dodopayments/models/entitlements/translation_update_params.rb +69 -0
- data/lib/dodopayments/models/locale.rb +38 -0
- data/lib/dodopayments/models/locale_info.rb +34 -0
- data/lib/dodopayments/models/meter_list_params.rb +17 -1
- data/lib/dodopayments/models/meter_retrieve_params.rb +18 -1
- data/lib/dodopayments/models/meter_update_params.rb +49 -0
- data/lib/dodopayments/models/meters/translation_delete_params.rb +36 -0
- data/lib/dodopayments/models/meters/translation_list_params.rb +35 -0
- data/lib/dodopayments/models/meters/translation_update_params.rb +52 -0
- data/lib/dodopayments/models/misc_list_locales_params.rb +14 -0
- data/lib/dodopayments/models/misc_list_locales_response.rb +8 -0
- data/lib/dodopayments/models/payment.rb +29 -1
- data/lib/dodopayments/models/payment_list_response.rb +29 -1
- data/lib/dodopayments/models/payment_retrieve_line_items_params.rb +14 -1
- data/lib/dodopayments/models/payment_retrieve_line_items_response.rb +10 -1
- data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +3 -1
- data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +2 -1
- data/lib/dodopayments/models/product_collection_list_params.rb +17 -1
- data/lib/dodopayments/models/product_collection_retrieve_params.rb +18 -1
- data/lib/dodopayments/models/product_collections/translation_delete_params.rb +37 -0
- data/lib/dodopayments/models/product_collections/translation_list_params.rb +36 -0
- data/lib/dodopayments/models/product_collections/translation_update_params.rb +53 -0
- data/lib/dodopayments/models/product_list_params.rb +14 -1
- data/lib/dodopayments/models/product_retrieve_params.rb +18 -1
- data/lib/dodopayments/models/products/translation.rb +50 -0
- data/lib/dodopayments/models/products/translation_delete_params.rb +36 -0
- data/lib/dodopayments/models/products/translation_list_params.rb +35 -0
- data/lib/dodopayments/models/products/translation_update_params.rb +52 -0
- data/lib/dodopayments/models/products/translations_list_response.rb +20 -0
- data/lib/dodopayments/models/refund_create_params.rb +13 -1
- data/lib/dodopayments/models/subscription_list_params.rb +14 -1
- data/lib/dodopayments/models/subscription_retrieve_params.rb +18 -1
- data/lib/dodopayments/models/three_ds_flow.rb +16 -0
- data/lib/dodopayments/models/three_ds_status.rb +21 -0
- data/lib/dodopayments/models/update_subscription_plan_req.rb +10 -0
- data/lib/dodopayments/models.rb +20 -0
- data/lib/dodopayments/resources/addons/translations.rb +110 -0
- data/lib/dodopayments/resources/addons.rb +58 -3
- data/lib/dodopayments/resources/checkout_sessions.rb +31 -26
- data/lib/dodopayments/resources/credit_entitlements/translations.rb +113 -0
- data/lib/dodopayments/resources/credit_entitlements.rb +20 -3
- data/lib/dodopayments/resources/customers.rb +12 -2
- data/lib/dodopayments/resources/entitlements/translations.rb +114 -0
- data/lib/dodopayments/resources/entitlements.rb +20 -3
- data/lib/dodopayments/resources/meters/translations.rb +110 -0
- data/lib/dodopayments/resources/meters.rb +49 -3
- data/lib/dodopayments/resources/misc.rb +18 -0
- data/lib/dodopayments/resources/payments.rb +10 -2
- data/lib/dodopayments/resources/payouts/breakup/details.rb +5 -2
- data/lib/dodopayments/resources/payouts/breakup.rb +4 -1
- data/lib/dodopayments/resources/product_collections/translations.rb +113 -0
- data/lib/dodopayments/resources/product_collections.rb +20 -3
- data/lib/dodopayments/resources/products/translations.rb +110 -0
- data/lib/dodopayments/resources/products.rb +17 -3
- data/lib/dodopayments/resources/refunds.rb +6 -1
- data/lib/dodopayments/resources/subscriptions.rb +13 -3
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments/workload_identity.rb +351 -0
- data/lib/dodopayments.rb +40 -0
- data/rbi/dodopayments/client.rbi +15 -2
- data/rbi/dodopayments/models/addon_delete_params.rbi +38 -0
- data/rbi/dodopayments/models/addon_list_params.rbi +32 -0
- data/rbi/dodopayments/models/addon_retrieve_params.rbi +29 -2
- data/rbi/dodopayments/models/addon_unarchive_params.rbi +38 -0
- data/rbi/dodopayments/models/addons/translation_delete_params.rbi +58 -0
- data/rbi/dodopayments/models/addons/translation_list_params.rbi +59 -0
- data/rbi/dodopayments/models/addons/translation_update_params.rbi +74 -0
- data/rbi/dodopayments/models/balance_ledger_entry.rbi +5 -0
- data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +5 -0
- data/rbi/dodopayments/models/checkout_session_preview_params.rbi +29 -5
- data/rbi/dodopayments/models/create_new_customer.rbi +17 -3
- data/rbi/dodopayments/models/credit_entitlement_list_params.rbi +21 -0
- data/rbi/dodopayments/models/credit_entitlement_retrieve_params.rbi +29 -2
- data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbi +70 -0
- data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbi +54 -0
- data/rbi/dodopayments/models/credit_entitlements/translation_delete_params.rbi +58 -0
- data/rbi/dodopayments/models/credit_entitlements/translation_list_params.rbi +59 -0
- data/rbi/dodopayments/models/credit_entitlements/translation_update_params.rbi +74 -0
- data/rbi/dodopayments/models/customer.rbi +11 -3
- data/rbi/dodopayments/models/customer_create_params.rbi +12 -0
- data/rbi/dodopayments/models/customer_update_params.rbi +12 -0
- data/rbi/dodopayments/models/entitlement_list_params.rbi +21 -0
- data/rbi/dodopayments/models/entitlement_retrieve_params.rbi +29 -2
- data/rbi/dodopayments/models/entitlements/entitlement_translation.rbi +87 -0
- data/rbi/dodopayments/models/entitlements/entitlement_translations_list_response.rbi +48 -0
- data/rbi/dodopayments/models/entitlements/translation_delete_params.rbi +58 -0
- data/rbi/dodopayments/models/entitlements/translation_list_params.rbi +59 -0
- data/rbi/dodopayments/models/entitlements/translation_update_params.rbi +92 -0
- data/rbi/dodopayments/models/locale.rbi +42 -0
- data/rbi/dodopayments/models/locale_info.rbi +54 -0
- data/rbi/dodopayments/models/meter_list_params.rbi +21 -0
- data/rbi/dodopayments/models/meter_retrieve_params.rbi +29 -2
- data/rbi/dodopayments/models/meter_update_params.rbi +70 -0
- data/rbi/dodopayments/models/meters/translation_delete_params.rbi +58 -0
- data/rbi/dodopayments/models/meters/translation_list_params.rbi +59 -0
- data/rbi/dodopayments/models/meters/translation_update_params.rbi +74 -0
- data/rbi/dodopayments/models/misc_list_locales_params.rbi +32 -0
- data/rbi/dodopayments/models/misc_list_locales_response.rbi +11 -0
- data/rbi/dodopayments/models/payment.rbi +33 -0
- data/rbi/dodopayments/models/payment_list_response.rbi +36 -3
- data/rbi/dodopayments/models/payment_retrieve_line_items_params.rbi +21 -2
- data/rbi/dodopayments/models/payment_retrieve_line_items_response.rbi +14 -3
- data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +6 -2
- data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +4 -2
- data/rbi/dodopayments/models/product_collection_list_params.rbi +21 -0
- data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +29 -2
- data/rbi/dodopayments/models/product_collections/translation_delete_params.rbi +58 -0
- data/rbi/dodopayments/models/product_collections/translation_list_params.rbi +59 -0
- data/rbi/dodopayments/models/product_collections/translation_update_params.rbi +74 -0
- data/rbi/dodopayments/models/product_list_params.rbi +21 -0
- data/rbi/dodopayments/models/product_retrieve_params.rbi +29 -2
- data/rbi/dodopayments/models/products/translation.rbi +70 -0
- data/rbi/dodopayments/models/products/translation_delete_params.rbi +58 -0
- data/rbi/dodopayments/models/products/translation_list_params.rbi +59 -0
- data/rbi/dodopayments/models/products/translation_update_params.rbi +74 -0
- data/rbi/dodopayments/models/products/translations_list_response.rbi +37 -0
- data/rbi/dodopayments/models/refund_create_params.rbi +10 -0
- data/rbi/dodopayments/models/subscription_list_params.rbi +21 -0
- data/rbi/dodopayments/models/subscription_retrieve_params.rbi +25 -1
- data/rbi/dodopayments/models/three_ds_flow.rbi +23 -0
- data/rbi/dodopayments/models/three_ds_status.rbi +31 -0
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +15 -0
- data/rbi/dodopayments/models.rbi +20 -0
- data/rbi/dodopayments/resources/addons/translations.rbi +77 -0
- data/rbi/dodopayments/resources/addons.rbi +48 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +55 -39
- data/rbi/dodopayments/resources/credit_entitlements/translations.rbi +81 -0
- data/rbi/dodopayments/resources/credit_entitlements.rbi +19 -0
- data/rbi/dodopayments/resources/customers.rbi +10 -0
- data/rbi/dodopayments/resources/entitlements/translations.rbi +87 -0
- data/rbi/dodopayments/resources/entitlements.rbi +19 -0
- data/rbi/dodopayments/resources/meters/translations.rbi +77 -0
- data/rbi/dodopayments/resources/meters.rbi +42 -0
- data/rbi/dodopayments/resources/misc.rbi +9 -0
- data/rbi/dodopayments/resources/payments.rbi +4 -0
- data/rbi/dodopayments/resources/payouts/breakup/details.rbi +5 -2
- data/rbi/dodopayments/resources/payouts/breakup.rbi +4 -1
- data/rbi/dodopayments/resources/product_collections/translations.rbi +77 -0
- data/rbi/dodopayments/resources/product_collections.rbi +19 -0
- data/rbi/dodopayments/resources/products/translations.rbi +77 -0
- data/rbi/dodopayments/resources/products.rbi +19 -0
- data/rbi/dodopayments/resources/refunds.rbi +4 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +26 -0
- data/rbi/dodopayments/workload_identity.rbi +219 -0
- data/sig/dodopayments/client.rbs +6 -1
- data/sig/dodopayments/models/addon_delete_params.rbs +23 -0
- data/sig/dodopayments/models/addon_list_params.rbs +18 -1
- data/sig/dodopayments/models/addon_retrieve_params.rbs +8 -1
- data/sig/dodopayments/models/addon_unarchive_params.rbs +23 -0
- data/sig/dodopayments/models/addons/translation_delete_params.rbs +30 -0
- data/sig/dodopayments/models/addons/translation_list_params.rbs +32 -0
- data/sig/dodopayments/models/addons/translation_update_params.rbs +43 -0
- data/sig/dodopayments/models/balance_ledger_entry.rbs +2 -0
- data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +2 -0
- data/sig/dodopayments/models/checkout_session_preview_params.rbs +13 -3
- data/sig/dodopayments/models/create_new_customer.rbs +8 -3
- data/sig/dodopayments/models/credit_entitlement_list_params.rbs +12 -1
- data/sig/dodopayments/models/credit_entitlement_retrieve_params.rbs +8 -1
- data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbs +39 -0
- data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbs +24 -0
- data/sig/dodopayments/models/credit_entitlements/translation_delete_params.rbs +30 -0
- data/sig/dodopayments/models/credit_entitlements/translation_list_params.rbs +32 -0
- data/sig/dodopayments/models/credit_entitlements/translation_update_params.rbs +43 -0
- data/sig/dodopayments/models/customer.rbs +8 -3
- data/sig/dodopayments/models/customer_create_params.rbs +6 -1
- data/sig/dodopayments/models/customer_update_params.rbs +6 -1
- data/sig/dodopayments/models/entitlement_list_params.rbs +7 -0
- data/sig/dodopayments/models/entitlement_retrieve_params.rbs +8 -1
- data/sig/dodopayments/models/entitlements/entitlement_translation.rbs +49 -0
- data/sig/dodopayments/models/entitlements/entitlement_translations_list_response.rbs +22 -0
- data/sig/dodopayments/models/entitlements/translation_delete_params.rbs +30 -0
- data/sig/dodopayments/models/entitlements/translation_list_params.rbs +32 -0
- data/sig/dodopayments/models/entitlements/translation_update_params.rbs +53 -0
- data/sig/dodopayments/models/locale.rbs +56 -0
- data/sig/dodopayments/models/locale_info.rbs +26 -0
- data/sig/dodopayments/models/meter_list_params.rbs +12 -1
- data/sig/dodopayments/models/meter_retrieve_params.rbs +8 -1
- data/sig/dodopayments/models/meter_update_params.rbs +41 -0
- data/sig/dodopayments/models/meters/translation_delete_params.rbs +30 -0
- data/sig/dodopayments/models/meters/translation_list_params.rbs +32 -0
- data/sig/dodopayments/models/meters/translation_update_params.rbs +43 -0
- data/sig/dodopayments/models/misc_list_locales_params.rbs +15 -0
- data/sig/dodopayments/models/misc_list_locales_response.rbs +7 -0
- data/sig/dodopayments/models/payment.rbs +15 -0
- data/sig/dodopayments/models/payment_list_response.rbs +18 -3
- data/sig/dodopayments/models/payment_retrieve_line_items_params.rbs +10 -1
- data/sig/dodopayments/models/payment_retrieve_line_items_response.rbs +8 -3
- data/sig/dodopayments/models/product_collection_list_params.rbs +7 -0
- data/sig/dodopayments/models/product_collection_retrieve_params.rbs +8 -1
- data/sig/dodopayments/models/product_collections/translation_delete_params.rbs +30 -0
- data/sig/dodopayments/models/product_collections/translation_list_params.rbs +32 -0
- data/sig/dodopayments/models/product_collections/translation_update_params.rbs +43 -0
- data/sig/dodopayments/models/product_list_params.rbs +7 -0
- data/sig/dodopayments/models/product_retrieve_params.rbs +8 -1
- data/sig/dodopayments/models/products/translation.rbs +37 -0
- data/sig/dodopayments/models/products/translation_delete_params.rbs +30 -0
- data/sig/dodopayments/models/products/translation_list_params.rbs +32 -0
- data/sig/dodopayments/models/products/translation_update_params.rbs +43 -0
- data/sig/dodopayments/models/products/translations_list_response.rbs +18 -0
- data/sig/dodopayments/models/refund_create_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_list_params.rbs +7 -0
- data/sig/dodopayments/models/subscription_retrieve_params.rbs +7 -1
- data/sig/dodopayments/models/three_ds_flow.rbs +14 -0
- data/sig/dodopayments/models/three_ds_status.rbs +24 -0
- data/sig/dodopayments/models.rbs +20 -0
- data/sig/dodopayments/resources/addons/translations.rbs +29 -0
- data/sig/dodopayments/resources/addons.rbs +15 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +1 -0
- data/sig/dodopayments/resources/credit_entitlements/translations.rbs +29 -0
- data/sig/dodopayments/resources/credit_entitlements.rbs +4 -0
- data/sig/dodopayments/resources/customers.rbs +2 -0
- data/sig/dodopayments/resources/entitlements/translations.rbs +31 -0
- data/sig/dodopayments/resources/entitlements.rbs +4 -0
- data/sig/dodopayments/resources/meters/translations.rbs +29 -0
- data/sig/dodopayments/resources/meters.rbs +12 -0
- data/sig/dodopayments/resources/misc.rbs +4 -0
- data/sig/dodopayments/resources/payments.rbs +1 -0
- data/sig/dodopayments/resources/product_collections/translations.rbs +29 -0
- data/sig/dodopayments/resources/product_collections.rbs +4 -0
- data/sig/dodopayments/resources/products/translations.rbs +29 -0
- data/sig/dodopayments/resources/products.rbs +4 -0
- data/sig/dodopayments/resources/refunds.rbs +1 -0
- data/sig/dodopayments/resources/subscriptions.rbs +2 -0
- data/sig/dodopayments/workload_identity.rbs +89 -0
- metadata +122 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 92bc6483e15b2acb4336b40dc7b0506cfcf6459c1df9534b5f2298f5c914578f
|
|
4
|
+
data.tar.gz: 031e012d15a53b9e54b167ecd3c294c82eec15c36f6553791b9831e53cdb5355
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9a58eba2a64ac73d40c74e345aca8a06e15ecea1bbaa9e64e4812431ade3778748fe4fcdf543bba82fe8031fba96f9b25ab3cfd7059fc375dd27de5d348a28a5
|
|
7
|
+
data.tar.gz: 365c61a379aab7d5500c558a76d7153dda3486a4fabdd4af7e90185752aeeb18f2fa45f38116e714e58d5394315decff720996ed7c8ff31c6c111e6e9b35510a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.36.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.35.0...v2.36.0) (2026-10-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **api:** regenerate SDK from latest OpenAPI spec ([8f4451c](https://github.com/dodopayments/dodopayments-ruby/commit/8f4451cf4bee3e5ed70f7d83b0e59ca1ca822a1e))
|
|
9
|
+
* **api:** regenerate SDK from latest OpenAPI spec ([3089c6d](https://github.com/dodopayments/dodopayments-ruby/commit/3089c6df767756323fc412e46b4c78100727dd0b))
|
|
10
|
+
* **api:** regenerate SDK from latest OpenAPI spec ([075d355](https://github.com/dodopayments/dodopayments-ruby/commit/075d35555b354afd7d6b3a4d16d1924805c28b4a))
|
|
11
|
+
|
|
12
|
+
## [2.35.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.34.0...v2.35.0) (2026-10-24)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** translations and locales, addon delete/unarchive, meter update, 3DS payment details ([3f470a9](https://github.com/dodopayments/dodopayments-ruby/commit/3f470a9af2e2651c9f8189cca0371a77fb1e6ff2))
|
|
18
|
+
* **api:** translations and locales, addon delete/unarchive, meter update, 3DS payment details ([2c095ae](https://github.com/dodopayments/dodopayments-ruby/commit/2c095aef1dd7031dfd35a4165dd40b376e745db3))
|
|
19
|
+
|
|
3
20
|
## [2.34.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.33.0...v2.34.0) (2026-10-21)
|
|
4
21
|
|
|
5
22
|
|
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.
|
|
26
|
+
gem "dodopayments", "~> 2.36.0"
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
<!-- x-release-please-end -->
|
|
@@ -72,6 +72,26 @@ if page.next_page?
|
|
|
72
72
|
end
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
### Workload identity
|
|
76
|
+
|
|
77
|
+
Instead of an API key, the client can exchange an OIDC token (JWT) from your platform for a short-lived access token. The client caches the access token and gets a new one when 5 minutes or less remain.
|
|
78
|
+
|
|
79
|
+
```ruby
|
|
80
|
+
dodo_payments = Dodopayments::Client.new(
|
|
81
|
+
workload_identity: Dodopayments::WorkloadIdentity::Config.new(
|
|
82
|
+
identity_provider_id: "wip_...", # defaults to ENV["DODO_PAYMENTS_IDENTITY_PROVIDER_ID"]
|
|
83
|
+
provider: Dodopayments::WorkloadIdentity.github_actions
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# Revoke the cached access token, for example at the end of a job.
|
|
88
|
+
dodo_payments.workload_identity.revoke
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The `Dodopayments::WorkloadIdentity` module has these token sources: `github_actions`, `gitlab`, `terraform_cloud`, `gcp`, `vercel`, `kubernetes`, `file`, `aws` (wraps your function), `static`, and `auto`. A `provider` can also be any object that responds to `call` and returns the JWT.
|
|
92
|
+
|
|
93
|
+
Do not set `bearer_token` together with `workload_identity`. If you set neither, and `ENV["DODO_PAYMENTS_API_KEY"]` is not set, the client reads `ENV["DODO_PAYMENTS_IDENTITY_PROVIDER_ID"]` and uses the token source that `auto` finds.
|
|
94
|
+
|
|
75
95
|
### Handling errors
|
|
76
96
|
|
|
77
97
|
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Dodopayments::Errors::APIError` will be thrown:
|
data/lib/dodopayments/client.rb
CHANGED
|
@@ -21,12 +21,17 @@ module Dodopayments
|
|
|
21
21
|
# rubocop:enable Style/MutableConstant
|
|
22
22
|
|
|
23
23
|
# Bearer Token for API authentication
|
|
24
|
-
# @return [String]
|
|
24
|
+
# @return [String, nil]
|
|
25
25
|
attr_reader :bearer_token
|
|
26
26
|
|
|
27
27
|
# @return [String, nil]
|
|
28
28
|
attr_reader :webhook_key
|
|
29
29
|
|
|
30
|
+
# Workload identity session, or `nil` if the client uses a bearer token.
|
|
31
|
+
#
|
|
32
|
+
# @return [Dodopayments::WorkloadIdentity::Session, nil]
|
|
33
|
+
attr_reader :workload_identity
|
|
34
|
+
|
|
30
35
|
# @return [Dodopayments::Resources::CheckoutSessions]
|
|
31
36
|
attr_reader :checkout_sessions
|
|
32
37
|
|
|
@@ -114,12 +119,114 @@ module Dodopayments
|
|
|
114
119
|
{"authorization" => "Bearer #{@bearer_token}"}
|
|
115
120
|
end
|
|
116
121
|
|
|
122
|
+
# @api private
|
|
123
|
+
#
|
|
124
|
+
# With workload identity, a 401 response clears the cached access token. The
|
|
125
|
+
# client then gets a new access token and sends the request one more time.
|
|
126
|
+
#
|
|
127
|
+
# @param req [Hash{Symbol=>Object}]
|
|
128
|
+
#
|
|
129
|
+
# @raise [Dodopayments::Errors::APIError]
|
|
130
|
+
# @return [Object]
|
|
131
|
+
def request(req)
|
|
132
|
+
return super if @workload_identity.nil?
|
|
133
|
+
|
|
134
|
+
token = @workload_identity.access_token
|
|
135
|
+
begin
|
|
136
|
+
super(workload_identity_authorize(req, token))
|
|
137
|
+
rescue Dodopayments::Errors::AuthenticationError
|
|
138
|
+
@workload_identity.invalidate(token)
|
|
139
|
+
super(workload_identity_authorize(req, @workload_identity.access_token))
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# @api private
|
|
144
|
+
#
|
|
145
|
+
# @param req [Hash{Symbol=>Object}]
|
|
146
|
+
# @param token [String]
|
|
147
|
+
#
|
|
148
|
+
# @return [Hash{Symbol=>Object}]
|
|
149
|
+
private def workload_identity_authorize(req, token)
|
|
150
|
+
{**req, headers: {**req[:headers].to_h, "authorization" => "Bearer #{token}"}}
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# @api private
|
|
154
|
+
#
|
|
155
|
+
# Sends a workload identity request without the client credentials. It retries
|
|
156
|
+
# connection errors and 5xx responses, but not 4xx responses.
|
|
157
|
+
#
|
|
158
|
+
# @param method [Symbol]
|
|
159
|
+
# @param path [String]
|
|
160
|
+
# @param headers [Hash{String=>String}]
|
|
161
|
+
# @param body [Object, nil]
|
|
162
|
+
#
|
|
163
|
+
# @raise [Dodopayments::Errors::APIError]
|
|
164
|
+
# @return [Object]
|
|
165
|
+
private def workload_identity_request(method:, path:, headers:, body:)
|
|
166
|
+
url = Dodopayments::Internal::Util.join_parsed_uri(@base_url_components, {path: path})
|
|
167
|
+
headers = Dodopayments::Internal::Util.normalized_headers(@headers.except("authorization"), headers)
|
|
168
|
+
encoded = nil
|
|
169
|
+
if body.nil?
|
|
170
|
+
headers.delete("content-type")
|
|
171
|
+
else
|
|
172
|
+
headers, encoded = Dodopayments::Internal::Util.encode_content(headers, body)
|
|
173
|
+
end
|
|
174
|
+
request = {method: method, url: url, headers: headers, body: encoded, max_retries: 0, timeout: @timeout}
|
|
175
|
+
|
|
176
|
+
retry_count = 0
|
|
177
|
+
begin
|
|
178
|
+
_, response, stream = send_request(
|
|
179
|
+
request,
|
|
180
|
+
redirect_count: 0,
|
|
181
|
+
retry_count: retry_count,
|
|
182
|
+
send_retry_header: true
|
|
183
|
+
)
|
|
184
|
+
rescue Dodopayments::Errors::APIConnectionError, Dodopayments::Errors::InternalServerError => e
|
|
185
|
+
if retry_count < @max_retries
|
|
186
|
+
sleep(retry_delay(e.headers.to_h, retry_count: retry_count))
|
|
187
|
+
retry_count += 1
|
|
188
|
+
retry
|
|
189
|
+
end
|
|
190
|
+
raise workload_identity_error(e)
|
|
191
|
+
rescue Dodopayments::Errors::APIStatusError => e
|
|
192
|
+
raise workload_identity_error(e)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
response_headers = Dodopayments::Internal::Util.normalized_headers(response.each_header.to_h)
|
|
196
|
+
Dodopayments::Internal::Util.decode_content(response_headers, stream: stream, suppress_error: true)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# @api private
|
|
200
|
+
#
|
|
201
|
+
# @param error [Dodopayments::Errors::APIError]
|
|
202
|
+
#
|
|
203
|
+
# @return [Dodopayments::Errors::APIError]
|
|
204
|
+
private def workload_identity_error(error)
|
|
205
|
+
return error unless error.is_a?(Dodopayments::Errors::APIStatusError)
|
|
206
|
+
|
|
207
|
+
body = error.body
|
|
208
|
+
details = body.is_a?(Hash) ? [body[:error], body[:error_description]].compact : []
|
|
209
|
+
message = ["Workload identity request failed with status #{error.status}", *details].join(": ")
|
|
210
|
+
Dodopayments::Errors::APIStatusError.for(
|
|
211
|
+
url: error.url,
|
|
212
|
+
status: error.status.to_i,
|
|
213
|
+
headers: error.headers,
|
|
214
|
+
body: body,
|
|
215
|
+
request: nil,
|
|
216
|
+
response: nil,
|
|
217
|
+
message: message
|
|
218
|
+
)
|
|
219
|
+
end
|
|
220
|
+
|
|
117
221
|
# Creates and returns a new client for interacting with the API.
|
|
118
222
|
#
|
|
119
223
|
# @param bearer_token [String, nil] Bearer Token for API authentication Defaults to `ENV["DODO_PAYMENTS_API_KEY"]`
|
|
120
224
|
#
|
|
121
225
|
# @param webhook_key [String, nil] Defaults to `ENV["DODO_PAYMENTS_WEBHOOK_KEY"]`
|
|
122
226
|
#
|
|
227
|
+
# @param workload_identity [Dodopayments::WorkloadIdentity::Config, Hash{Symbol=>Object}, nil] Exchange an OIDC token for an access token, instead of a bearer token. See
|
|
228
|
+
# {Dodopayments::WorkloadIdentity}.
|
|
229
|
+
#
|
|
123
230
|
# @param environment [:live_mode, :test_mode, nil] Specifies the environment to use for the API.
|
|
124
231
|
#
|
|
125
232
|
# Each environment maps to a different base URL:
|
|
@@ -138,8 +245,9 @@ module Dodopayments
|
|
|
138
245
|
#
|
|
139
246
|
# @param max_retry_delay [Float]
|
|
140
247
|
def initialize(
|
|
141
|
-
bearer_token:
|
|
248
|
+
bearer_token: nil,
|
|
142
249
|
webhook_key: ENV["DODO_PAYMENTS_WEBHOOK_KEY"],
|
|
250
|
+
workload_identity: nil,
|
|
143
251
|
environment: nil,
|
|
144
252
|
base_url: ENV["DODO_PAYMENTS_BASE_URL"],
|
|
145
253
|
max_retries: self.class::DEFAULT_MAX_RETRIES,
|
|
@@ -152,7 +260,17 @@ module Dodopayments
|
|
|
152
260
|
raise ArgumentError.new(message)
|
|
153
261
|
end
|
|
154
262
|
|
|
155
|
-
|
|
263
|
+
unless bearer_token.nil? || workload_identity.nil?
|
|
264
|
+
raise ArgumentError.new("bearer_token and workload_identity cannot be used together")
|
|
265
|
+
end
|
|
266
|
+
bearer_token = ENV["DODO_PAYMENTS_API_KEY"] if bearer_token.nil? && workload_identity.nil?
|
|
267
|
+
if bearer_token.nil? && workload_identity.nil? && !ENV["DODO_PAYMENTS_IDENTITY_PROVIDER_ID"].to_s.empty?
|
|
268
|
+
provider = Dodopayments::WorkloadIdentity.auto
|
|
269
|
+
workload_identity = {provider: provider} unless provider.nil?
|
|
270
|
+
end
|
|
271
|
+
workload_identity = Dodopayments::WorkloadIdentity::Config.coerce(workload_identity) unless workload_identity.nil?
|
|
272
|
+
|
|
273
|
+
if bearer_token.nil? && workload_identity.nil?
|
|
156
274
|
raise ArgumentError.new("bearer_token is required, and can be set via environ: \"DODO_PAYMENTS_API_KEY\"")
|
|
157
275
|
end
|
|
158
276
|
|
|
@@ -169,7 +287,7 @@ module Dodopayments
|
|
|
169
287
|
headers = parsed.merge(headers)
|
|
170
288
|
end
|
|
171
289
|
|
|
172
|
-
@bearer_token = bearer_token
|
|
290
|
+
@bearer_token = bearer_token&.to_s
|
|
173
291
|
@webhook_key = webhook_key&.to_s
|
|
174
292
|
|
|
175
293
|
super(
|
|
@@ -207,6 +325,17 @@ module Dodopayments
|
|
|
207
325
|
@entitlements = Dodopayments::Resources::Entitlements.new(client: self)
|
|
208
326
|
@product_collections = Dodopayments::Resources::ProductCollections.new(client: self)
|
|
209
327
|
@moderation = Dodopayments::Resources::Moderation.new(client: self)
|
|
328
|
+
|
|
329
|
+
@workload_identity = nil
|
|
330
|
+
return if workload_identity.nil?
|
|
331
|
+
@workload_identity = Dodopayments::WorkloadIdentity::Session.new(
|
|
332
|
+
config: workload_identity,
|
|
333
|
+
context: Dodopayments::WorkloadIdentity::Context.new(
|
|
334
|
+
base_url: @base_url,
|
|
335
|
+
audience: Dodopayments::Internal::Util.uri_origin(@base_url)
|
|
336
|
+
),
|
|
337
|
+
transport: method(:workload_identity_request)
|
|
338
|
+
)
|
|
210
339
|
end
|
|
211
340
|
end
|
|
212
341
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# @see Dodopayments::Resources::Addons#delete
|
|
6
|
+
class AddonDeleteParams < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(id:, request_options: {})
|
|
16
|
+
# @param id [String]
|
|
17
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -7,6 +7,23 @@ module Dodopayments
|
|
|
7
7
|
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Dodopayments::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
+
# @!attribute archived
|
|
11
|
+
# List archived addons. The default is false.
|
|
12
|
+
#
|
|
13
|
+
# @return [Boolean, nil]
|
|
14
|
+
optional :archived, Dodopayments::Internal::Type::Boolean
|
|
15
|
+
|
|
16
|
+
# @!attribute locale
|
|
17
|
+
# Shows the translated name, description and unit of the catalog entities in this
|
|
18
|
+
# locale. The value must be a code from `GET /locales`, for example `fr`. A field
|
|
19
|
+
# with no translation, an unknown code, or no code shows the base text.
|
|
20
|
+
#
|
|
21
|
+
# Do not send a text from a localized response back in a create or update request.
|
|
22
|
+
# The base text then changes to the translated text.
|
|
23
|
+
#
|
|
24
|
+
# @return [String, nil]
|
|
25
|
+
optional :locale, String
|
|
26
|
+
|
|
10
27
|
# @!attribute page_number
|
|
11
28
|
# Page number default is 0
|
|
12
29
|
#
|
|
@@ -19,7 +36,14 @@ module Dodopayments
|
|
|
19
36
|
# @return [Integer, nil]
|
|
20
37
|
optional :page_size, Integer
|
|
21
38
|
|
|
22
|
-
# @!method initialize(page_number: nil, page_size: nil, request_options: {})
|
|
39
|
+
# @!method initialize(archived: nil, locale: nil, page_number: nil, page_size: nil, request_options: {})
|
|
40
|
+
# Some parameter documentations has been truncated, see
|
|
41
|
+
# {Dodopayments::Models::AddonListParams} for more details.
|
|
42
|
+
#
|
|
43
|
+
# @param archived [Boolean] List archived addons. The default is false.
|
|
44
|
+
#
|
|
45
|
+
# @param locale [String] Shows the translated name, description and unit of the catalog entities in this
|
|
46
|
+
#
|
|
23
47
|
# @param page_number [Integer] Page number default is 0
|
|
24
48
|
#
|
|
25
49
|
# @param page_size [Integer] Page size default is 10 max is 100
|
|
@@ -12,8 +12,25 @@ module Dodopayments
|
|
|
12
12
|
# @return [String]
|
|
13
13
|
required :id, String
|
|
14
14
|
|
|
15
|
-
# @!
|
|
15
|
+
# @!attribute locale
|
|
16
|
+
# Shows the translated name, description and unit of the catalog entities in this
|
|
17
|
+
# locale. The value must be a code from `GET /locales`, for example `fr`. A field
|
|
18
|
+
# with no translation, an unknown code, or no code shows the base text.
|
|
19
|
+
#
|
|
20
|
+
# Do not send a text from a localized response back in a create or update request.
|
|
21
|
+
# The base text then changes to the translated text.
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :locale, String
|
|
25
|
+
|
|
26
|
+
# @!method initialize(id:, locale: nil, request_options: {})
|
|
27
|
+
# Some parameter documentations has been truncated, see
|
|
28
|
+
# {Dodopayments::Models::AddonRetrieveParams} for more details.
|
|
29
|
+
#
|
|
16
30
|
# @param id [String]
|
|
31
|
+
#
|
|
32
|
+
# @param locale [String] Shows the translated name, description and unit of the catalog entities in this
|
|
33
|
+
#
|
|
17
34
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
18
35
|
end
|
|
19
36
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# @see Dodopayments::Resources::Addons#unarchive
|
|
6
|
+
class AddonUnarchiveParams < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(id:, request_options: {})
|
|
16
|
+
# @param id [String]
|
|
17
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Addons
|
|
6
|
+
# @see Dodopayments::Resources::Addons::Translations#delete
|
|
7
|
+
class TranslationDeleteParams < Dodopayments::Internal::Type::BaseModel
|
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute locale
|
|
17
|
+
# A locale that the checkout and the customer portal can show.
|
|
18
|
+
#
|
|
19
|
+
# The codes are a copy of the checkout locales. `GET /locales` lists them.
|
|
20
|
+
#
|
|
21
|
+
# @return [Symbol, Dodopayments::Models::Locale]
|
|
22
|
+
required :locale, enum: -> { Dodopayments::Locale }
|
|
23
|
+
|
|
24
|
+
# @!method initialize(id:, locale:, request_options: {})
|
|
25
|
+
# Some parameter documentations has been truncated, see
|
|
26
|
+
# {Dodopayments::Models::Addons::TranslationDeleteParams} for more details.
|
|
27
|
+
#
|
|
28
|
+
# @param id [String]
|
|
29
|
+
#
|
|
30
|
+
# @param locale [Symbol, Dodopayments::Models::Locale] A locale that the checkout and the customer portal can show.
|
|
31
|
+
#
|
|
32
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Addons
|
|
6
|
+
# @see Dodopayments::Resources::Addons::Translations#list
|
|
7
|
+
class TranslationListParams < Dodopayments::Internal::Type::BaseModel
|
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute locale
|
|
17
|
+
# Returns only these locales, for example `?locale=fr&locale=de`. With no value,
|
|
18
|
+
# the response has all the locales.
|
|
19
|
+
#
|
|
20
|
+
# @return [Array<String>, nil]
|
|
21
|
+
optional :locale, Dodopayments::Internal::Type::ArrayOf[String]
|
|
22
|
+
|
|
23
|
+
# @!method initialize(id:, locale: nil, request_options: {})
|
|
24
|
+
# Some parameter documentations has been truncated, see
|
|
25
|
+
# {Dodopayments::Models::Addons::TranslationListParams} for more details.
|
|
26
|
+
#
|
|
27
|
+
# @param id [String]
|
|
28
|
+
#
|
|
29
|
+
# @param locale [Array<String>] Returns only these locales, for example `?locale=fr&locale=de`. With no value, t
|
|
30
|
+
#
|
|
31
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Addons
|
|
6
|
+
# @see Dodopayments::Resources::Addons::Translations#update
|
|
7
|
+
class TranslationUpdateParams < Dodopayments::Internal::Type::BaseModel
|
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute locale
|
|
17
|
+
# A locale that the checkout and the customer portal can show.
|
|
18
|
+
#
|
|
19
|
+
# The codes are a copy of the checkout locales. `GET /locales` lists them.
|
|
20
|
+
#
|
|
21
|
+
# @return [Symbol, Dodopayments::Models::Locale]
|
|
22
|
+
required :locale, enum: -> { Dodopayments::Locale }
|
|
23
|
+
|
|
24
|
+
# @!attribute description
|
|
25
|
+
# The translated description.
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :description, String, nil?: true
|
|
29
|
+
|
|
30
|
+
# @!attribute name
|
|
31
|
+
# The translated name.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :name, String, nil?: true
|
|
35
|
+
|
|
36
|
+
# @!method initialize(id:, locale:, description: nil, name: nil, request_options: {})
|
|
37
|
+
# Some parameter documentations has been truncated, see
|
|
38
|
+
# {Dodopayments::Models::Addons::TranslationUpdateParams} for more details.
|
|
39
|
+
#
|
|
40
|
+
# @param id [String]
|
|
41
|
+
#
|
|
42
|
+
# @param locale [Symbol, Dodopayments::Models::Locale] A locale that the checkout and the customer portal can show.
|
|
43
|
+
#
|
|
44
|
+
# @param description [String, nil] The translated description.
|
|
45
|
+
#
|
|
46
|
+
# @param name [String, nil] The translated name.
|
|
47
|
+
#
|
|
48
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -7,7 +7,23 @@ module Dodopayments
|
|
|
7
7
|
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Dodopayments::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!
|
|
10
|
+
# @!attribute locale
|
|
11
|
+
# Shows the translated name, description and unit of the catalog entities in this
|
|
12
|
+
# locale. The value must be a code from `GET /locales`, for example `fr`. A field
|
|
13
|
+
# with no translation, an unknown code, or no code shows the base text.
|
|
14
|
+
#
|
|
15
|
+
# Do not send a text from a localized response back in a create or update request.
|
|
16
|
+
# The base text then changes to the translated text.
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :locale, String
|
|
20
|
+
|
|
21
|
+
# @!method initialize(locale: nil, request_options: {})
|
|
22
|
+
# Some parameter documentations has been truncated, see
|
|
23
|
+
# {Dodopayments::Models::CheckoutSessionPreviewParams} for more details.
|
|
24
|
+
#
|
|
25
|
+
# @param locale [String] Shows the translated name, description and unit of the catalog entities in this
|
|
26
|
+
#
|
|
11
27
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
12
28
|
end
|
|
13
29
|
end
|
|
@@ -26,7 +26,16 @@ module Dodopayments
|
|
|
26
26
|
# @return [String, nil]
|
|
27
27
|
optional :phone_number, String, nil?: true
|
|
28
28
|
|
|
29
|
-
# @!
|
|
29
|
+
# @!attribute preferred_locale
|
|
30
|
+
# The language of the customer emails, a code from `GET /locales`. A value
|
|
31
|
+
# replaces the stored language of the customer, also for an existing customer.
|
|
32
|
+
# Send a value only to change that language on purpose. With no value, the stored
|
|
33
|
+
# language stays.
|
|
34
|
+
#
|
|
35
|
+
# @return [Symbol, Dodopayments::Models::Locale, nil]
|
|
36
|
+
optional :preferred_locale, enum: -> { Dodopayments::Locale }, nil?: true
|
|
37
|
+
|
|
38
|
+
# @!method initialize(email:, name:, create_new_customer: nil, phone_number: nil, preferred_locale: nil)
|
|
30
39
|
# Some parameter documentations has been truncated, see
|
|
31
40
|
# {Dodopayments::Models::CreateNewCustomer} for more details.
|
|
32
41
|
#
|
|
@@ -37,6 +46,8 @@ module Dodopayments
|
|
|
37
46
|
# @param create_new_customer [Boolean] When false, the most recently created customer object with the given email is us
|
|
38
47
|
#
|
|
39
48
|
# @param phone_number [String, nil]
|
|
49
|
+
#
|
|
50
|
+
# @param preferred_locale [Symbol, Dodopayments::Models::Locale, nil] The language of the customer emails, a code from `GET /locales`. A value replace
|
|
40
51
|
end
|
|
41
52
|
end
|
|
42
53
|
end
|
|
@@ -13,6 +13,17 @@ module Dodopayments
|
|
|
13
13
|
# @return [Boolean, nil]
|
|
14
14
|
optional :deleted, Dodopayments::Internal::Type::Boolean
|
|
15
15
|
|
|
16
|
+
# @!attribute locale
|
|
17
|
+
# Shows the translated name, description and unit of the catalog entities in this
|
|
18
|
+
# locale. The value must be a code from `GET /locales`, for example `fr`. A field
|
|
19
|
+
# with no translation, an unknown code, or no code shows the base text.
|
|
20
|
+
#
|
|
21
|
+
# Do not send a text from a localized response back in a create or update request.
|
|
22
|
+
# The base text then changes to the translated text.
|
|
23
|
+
#
|
|
24
|
+
# @return [String, nil]
|
|
25
|
+
optional :locale, String
|
|
26
|
+
|
|
16
27
|
# @!attribute page_number
|
|
17
28
|
# Page number default is 0
|
|
18
29
|
#
|
|
@@ -25,9 +36,14 @@ module Dodopayments
|
|
|
25
36
|
# @return [Integer, nil]
|
|
26
37
|
optional :page_size, Integer
|
|
27
38
|
|
|
28
|
-
# @!method initialize(deleted: nil, page_number: nil, page_size: nil, request_options: {})
|
|
39
|
+
# @!method initialize(deleted: nil, locale: nil, page_number: nil, page_size: nil, request_options: {})
|
|
40
|
+
# Some parameter documentations has been truncated, see
|
|
41
|
+
# {Dodopayments::Models::CreditEntitlementListParams} for more details.
|
|
42
|
+
#
|
|
29
43
|
# @param deleted [Boolean] List deleted credit entitlements
|
|
30
44
|
#
|
|
45
|
+
# @param locale [String] Shows the translated name, description and unit of the catalog entities in this
|
|
46
|
+
#
|
|
31
47
|
# @param page_number [Integer] Page number default is 0
|
|
32
48
|
#
|
|
33
49
|
# @param page_size [Integer] Page size default is 10 max is 100
|
|
@@ -12,8 +12,25 @@ module Dodopayments
|
|
|
12
12
|
# @return [String]
|
|
13
13
|
required :id, String
|
|
14
14
|
|
|
15
|
-
# @!
|
|
15
|
+
# @!attribute locale
|
|
16
|
+
# Shows the translated name, description and unit of the catalog entities in this
|
|
17
|
+
# locale. The value must be a code from `GET /locales`, for example `fr`. A field
|
|
18
|
+
# with no translation, an unknown code, or no code shows the base text.
|
|
19
|
+
#
|
|
20
|
+
# Do not send a text from a localized response back in a create or update request.
|
|
21
|
+
# The base text then changes to the translated text.
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :locale, String
|
|
25
|
+
|
|
26
|
+
# @!method initialize(id:, locale: nil, request_options: {})
|
|
27
|
+
# Some parameter documentations has been truncated, see
|
|
28
|
+
# {Dodopayments::Models::CreditEntitlementRetrieveParams} for more details.
|
|
29
|
+
#
|
|
16
30
|
# @param id [String]
|
|
31
|
+
#
|
|
32
|
+
# @param locale [String] Shows the translated name, description and unit of the catalog entities in this
|
|
33
|
+
#
|
|
17
34
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
18
35
|
end
|
|
19
36
|
end
|