dodopayments 2.4.5 → 2.5.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 (61) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/client.d.mts +4 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/checkout-sessions.d.mts +14 -0
  10. package/resources/checkout-sessions.d.mts.map +1 -1
  11. package/resources/checkout-sessions.d.ts +14 -0
  12. package/resources/checkout-sessions.d.ts.map +1 -1
  13. package/resources/customers/customers.d.mts +64 -1
  14. package/resources/customers/customers.d.mts.map +1 -1
  15. package/resources/customers/customers.d.ts +64 -1
  16. package/resources/customers/customers.d.ts.map +1 -1
  17. package/resources/customers/customers.js +3 -0
  18. package/resources/customers/customers.js.map +1 -1
  19. package/resources/customers/customers.mjs +3 -0
  20. package/resources/customers/customers.mjs.map +1 -1
  21. package/resources/customers/index.d.mts +1 -1
  22. package/resources/customers/index.d.mts.map +1 -1
  23. package/resources/customers/index.d.ts +1 -1
  24. package/resources/customers/index.d.ts.map +1 -1
  25. package/resources/customers/index.js.map +1 -1
  26. package/resources/customers/index.mjs.map +1 -1
  27. package/resources/index.d.mts +2 -2
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +2 -2
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js.map +1 -1
  32. package/resources/index.mjs.map +1 -1
  33. package/resources/payments.d.mts +6 -0
  34. package/resources/payments.d.mts.map +1 -1
  35. package/resources/payments.d.ts +6 -0
  36. package/resources/payments.d.ts.map +1 -1
  37. package/resources/products/products.d.mts +4 -4
  38. package/resources/products/products.d.mts.map +1 -1
  39. package/resources/products/products.d.ts +4 -4
  40. package/resources/products/products.d.ts.map +1 -1
  41. package/resources/subscriptions.d.mts +27 -1
  42. package/resources/subscriptions.d.mts.map +1 -1
  43. package/resources/subscriptions.d.ts +27 -1
  44. package/resources/subscriptions.d.ts.map +1 -1
  45. package/resources/subscriptions.js +6 -0
  46. package/resources/subscriptions.js.map +1 -1
  47. package/resources/subscriptions.mjs +6 -0
  48. package/resources/subscriptions.mjs.map +1 -1
  49. package/src/client.ts +6 -0
  50. package/src/resources/checkout-sessions.ts +28 -0
  51. package/src/resources/customers/customers.ts +96 -0
  52. package/src/resources/customers/index.ts +1 -0
  53. package/src/resources/index.ts +3 -0
  54. package/src/resources/payments.ts +5 -0
  55. package/src/resources/products/products.ts +5 -5
  56. package/src/resources/subscriptions.ts +51 -0
  57. package/src/version.ts +1 -1
  58. package/version.d.mts +1 -1
  59. package/version.d.ts +1 -1
  60. package/version.js +1 -1
  61. package/version.mjs +1 -1
@@ -118,6 +118,17 @@ export class Subscriptions extends APIResource {
118
118
  { query, ...options },
119
119
  );
120
120
  }
121
+
122
+ updatePaymentMethod(
123
+ subscriptionID: string,
124
+ body: SubscriptionUpdatePaymentMethodParams,
125
+ options?: RequestOptions,
126
+ ): APIPromise<SubscriptionUpdatePaymentMethodResponse> {
127
+ return this._client.post(path`/subscriptions/${subscriptionID}/update-payment-method`, {
128
+ body,
129
+ ...options,
130
+ });
131
+ }
121
132
  }
122
133
 
123
134
  export type SubscriptionListResponsesDefaultPageNumberPagination =
@@ -311,6 +322,11 @@ export interface Subscription {
311
322
  */
312
323
  expires_at?: string | null;
313
324
 
325
+ /**
326
+ * Saved payment method id used for recurring charges
327
+ */
328
+ payment_method_id?: string | null;
329
+
314
330
  /**
315
331
  * Tax identifier provided for this subscription (if applicable)
316
332
  */
@@ -517,6 +533,11 @@ export interface SubscriptionListResponse {
517
533
  */
518
534
  discount_id?: string | null;
519
535
 
536
+ /**
537
+ * Saved payment method id used for recurring charges
538
+ */
539
+ payment_method_id?: string | null;
540
+
520
541
  /**
521
542
  * Tax identifier provided for this subscription (if applicable)
522
543
  */
@@ -588,6 +609,16 @@ export namespace SubscriptionRetrieveUsageHistoryResponse {
588
609
  }
589
610
  }
590
611
 
612
+ export interface SubscriptionUpdatePaymentMethodResponse {
613
+ client_secret?: string | null;
614
+
615
+ expires_on?: string | null;
616
+
617
+ payment_id?: string | null;
618
+
619
+ payment_link?: string | null;
620
+ }
621
+
591
622
  export interface SubscriptionCreateParams {
592
623
  /**
593
624
  * Billing address information for the subscription
@@ -824,6 +855,24 @@ export interface SubscriptionRetrieveUsageHistoryParams extends DefaultPageNumbe
824
855
  start_date?: string | null;
825
856
  }
826
857
 
858
+ export type SubscriptionUpdatePaymentMethodParams =
859
+ | SubscriptionUpdatePaymentMethodParams.Variant0
860
+ | SubscriptionUpdatePaymentMethodParams.Variant1;
861
+
862
+ export declare namespace SubscriptionUpdatePaymentMethodParams {
863
+ export interface Variant0 {
864
+ type: 'new';
865
+
866
+ return_url?: string | null;
867
+ }
868
+
869
+ export interface Variant1 {
870
+ payment_method_id: string;
871
+
872
+ type: 'existing';
873
+ }
874
+ }
875
+
827
876
  export declare namespace Subscriptions {
828
877
  export {
829
878
  type AddonCartResponseItem as AddonCartResponseItem,
@@ -836,6 +885,7 @@ export declare namespace Subscriptions {
836
885
  type SubscriptionListResponse as SubscriptionListResponse,
837
886
  type SubscriptionChargeResponse as SubscriptionChargeResponse,
838
887
  type SubscriptionRetrieveUsageHistoryResponse as SubscriptionRetrieveUsageHistoryResponse,
888
+ type SubscriptionUpdatePaymentMethodResponse as SubscriptionUpdatePaymentMethodResponse,
839
889
  type SubscriptionListResponsesDefaultPageNumberPagination as SubscriptionListResponsesDefaultPageNumberPagination,
840
890
  type SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination as SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination,
841
891
  type SubscriptionCreateParams as SubscriptionCreateParams,
@@ -844,5 +894,6 @@ export declare namespace Subscriptions {
844
894
  type SubscriptionChangePlanParams as SubscriptionChangePlanParams,
845
895
  type SubscriptionChargeParams as SubscriptionChargeParams,
846
896
  type SubscriptionRetrieveUsageHistoryParams as SubscriptionRetrieveUsageHistoryParams,
897
+ type SubscriptionUpdatePaymentMethodParams as SubscriptionUpdatePaymentMethodParams,
847
898
  };
848
899
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.4.5'; // x-release-please-version
1
+ export const VERSION = '2.5.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.4.5";
1
+ export declare const VERSION = "2.5.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.4.5";
1
+ export declare const VERSION = "2.5.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.4.5'; // x-release-please-version
4
+ exports.VERSION = '2.5.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.4.5'; // x-release-please-version
1
+ export const VERSION = '2.5.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map