@deliverart/sdk-js-subscription 2.13.7 → 2.14.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.
- package/README.md +10 -4
- package/dist/index.cjs +9 -13
- package/dist/index.d.cts +14 -849
- package/dist/index.d.ts +14 -849
- package/dist/index.js +7 -14
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Subscription management package for the Deliverart JavaScript SDK.
|
|
|
11
11
|
- renewal CRUD for `consumption` and `time_based`
|
|
12
12
|
- subscription overview from point of sale
|
|
13
13
|
- credit adjustments for consumption subscriptions
|
|
14
|
-
- renewal payment initialization for `stripe
|
|
14
|
+
- renewal payment initialization for `stripe` and `bank_transfer`
|
|
15
15
|
- manual renewal payment resolution for offline payment methods
|
|
16
16
|
- purchase lifecycle actions: `cancel`, `retry_payment`, `refund`
|
|
17
17
|
- renewal lifecycle actions: `cancel`, `retry_payment`, `refund`
|
|
@@ -79,10 +79,16 @@ Start payment for the purchase:
|
|
|
79
79
|
import { PaySubscriptionPurchase } from '@deliverart/sdk-js-subscription'
|
|
80
80
|
|
|
81
81
|
const payment = await sdk.call(
|
|
82
|
-
new PaySubscriptionPurchase('purchase-id', '
|
|
82
|
+
new PaySubscriptionPurchase('purchase-id', 'bank_transfer'),
|
|
83
83
|
)
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
Subscription billing is platform-level:
|
|
87
|
+
|
|
88
|
+
- order and ecommerce payments still use each POS payment configuration
|
|
89
|
+
- subscription purchases and renewals use the central platform billing account
|
|
90
|
+
- the SDK therefore accepts only `stripe` and `bank_transfer` for subscription payment start and retry
|
|
91
|
+
|
|
86
92
|
Resolve offline payment:
|
|
87
93
|
|
|
88
94
|
```ts
|
|
@@ -114,7 +120,7 @@ Retry a failed purchase payment:
|
|
|
114
120
|
import { RetrySubscriptionPurchasePayment } from '@deliverart/sdk-js-subscription'
|
|
115
121
|
|
|
116
122
|
const payment = await sdk.call(
|
|
117
|
-
new RetrySubscriptionPurchasePayment('purchase-id', '
|
|
123
|
+
new RetrySubscriptionPurchasePayment('purchase-id', 'bank_transfer'),
|
|
118
124
|
)
|
|
119
125
|
```
|
|
120
126
|
|
|
@@ -228,7 +234,7 @@ await sdk.call(
|
|
|
228
234
|
)
|
|
229
235
|
|
|
230
236
|
const payment = await sdk.call(
|
|
231
|
-
new RetrySubscriptionTimeBasedRenewalPayment('renewal-id', '
|
|
237
|
+
new RetrySubscriptionTimeBasedRenewalPayment('renewal-id', 'bank_transfer'),
|
|
232
238
|
)
|
|
233
239
|
|
|
234
240
|
await sdk.call(
|
package/dist/index.cjs
CHANGED
|
@@ -205,8 +205,6 @@ __export(index_exports, {
|
|
|
205
205
|
paySubscriptionTimeBasedRenewalInputSchema: () => paySubscriptionTimeBasedRenewalInputSchema,
|
|
206
206
|
paySubscriptionTimeBasedRenewalResponseSchema: () => paySubscriptionTimeBasedRenewalResponseSchema,
|
|
207
207
|
paymentIriSchema: () => paymentIriSchema,
|
|
208
|
-
paymentMethodSchema: () => import_sdk_js_global_types2.paymentMethodSchema,
|
|
209
|
-
paymentMethods: () => import_sdk_js_global_types2.paymentMethods,
|
|
210
208
|
paymentNullableIriSchema: () => paymentNullableIriSchema,
|
|
211
209
|
paymentStatusSchema: () => import_sdk_js_global_types2.paymentStatusSchema,
|
|
212
210
|
paymentStatuses: () => import_sdk_js_global_types2.paymentStatuses,
|
|
@@ -256,6 +254,8 @@ __export(index_exports, {
|
|
|
256
254
|
subscriptionOverviewPlanSchema: () => subscriptionOverviewPlanSchema,
|
|
257
255
|
subscriptionOverviewResponseSchema: () => subscriptionOverviewResponseSchema,
|
|
258
256
|
subscriptionOverviewSubscriptionSchema: () => subscriptionOverviewSubscriptionSchema,
|
|
257
|
+
subscriptionPaymentMethodSchema: () => subscriptionPaymentMethodSchema,
|
|
258
|
+
subscriptionPaymentMethods: () => subscriptionPaymentMethods,
|
|
259
259
|
subscriptionPlanIriSchema: () => subscriptionPlanIriSchema,
|
|
260
260
|
subscriptionPlanNullableIriSchema: () => subscriptionPlanNullableIriSchema,
|
|
261
261
|
subscriptionPlanPriceOptionSchema: () => subscriptionPlanPriceOptionSchema,
|
|
@@ -14092,6 +14092,8 @@ config(en_default());
|
|
|
14092
14092
|
// src/types.ts
|
|
14093
14093
|
var import_sdk_js_global_types = require("@deliverart/sdk-js-global-types");
|
|
14094
14094
|
var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
|
|
14095
|
+
var subscriptionPaymentMethods = ["stripe", "bank_transfer"];
|
|
14096
|
+
var subscriptionPaymentMethodSchema = external_exports.enum(subscriptionPaymentMethods);
|
|
14095
14097
|
var adjustableCreditTransactionTypes = [
|
|
14096
14098
|
"gift",
|
|
14097
14099
|
"bonus",
|
|
@@ -14294,7 +14296,7 @@ var subscriptionPurchaseSchema = external_exports.object({
|
|
|
14294
14296
|
startsAt: subscriptionDateSchema,
|
|
14295
14297
|
threshold: external_exports.coerce.number().int().nonnegative(),
|
|
14296
14298
|
amount: external_exports.string(),
|
|
14297
|
-
paymentMethod:
|
|
14299
|
+
paymentMethod: subscriptionPaymentMethodSchema.nullable(),
|
|
14298
14300
|
paymentStatus: import_sdk_js_global_types3.paymentStatusSchema.nullable(),
|
|
14299
14301
|
createdAt: import_sdk_js_global_types3.datetimeSchema,
|
|
14300
14302
|
updatedAt: import_sdk_js_global_types3.datetimeSchema
|
|
@@ -14343,11 +14345,11 @@ var adjustSubscriptionConsumptionCreditsInputSchema = external_exports.object({
|
|
|
14343
14345
|
}
|
|
14344
14346
|
});
|
|
14345
14347
|
var paySubscriptionRenewalInputSchema = external_exports.object({
|
|
14346
|
-
method:
|
|
14348
|
+
method: subscriptionPaymentMethodSchema
|
|
14347
14349
|
});
|
|
14348
14350
|
var paymentInfoBaseSchema = external_exports.object({
|
|
14349
14351
|
id: external_exports.string(),
|
|
14350
|
-
method:
|
|
14352
|
+
method: subscriptionPaymentMethodSchema,
|
|
14351
14353
|
status: import_sdk_js_global_types3.paymentStatusSchema,
|
|
14352
14354
|
amount: external_exports.string()
|
|
14353
14355
|
});
|
|
@@ -14366,12 +14368,6 @@ var subscriptionRenewalPaymentInfoSchema = external_exports.discriminatedUnion("
|
|
|
14366
14368
|
bankAddress: external_exports.string().nullable(),
|
|
14367
14369
|
currency: external_exports.string(),
|
|
14368
14370
|
description: external_exports.string()
|
|
14369
|
-
}),
|
|
14370
|
-
paymentInfoBaseSchema.extend({
|
|
14371
|
-
method: external_exports.literal("cash")
|
|
14372
|
-
}),
|
|
14373
|
-
paymentInfoBaseSchema.extend({
|
|
14374
|
-
method: external_exports.literal("credit_card")
|
|
14375
14371
|
})
|
|
14376
14372
|
]);
|
|
14377
14373
|
var resolveSubscriptionRenewalPaymentInputSchema = external_exports.object({
|
|
@@ -16311,8 +16307,6 @@ var UpdateSubscription = class extends import_sdk_js_core68.AbstractApiRequest {
|
|
|
16311
16307
|
paySubscriptionTimeBasedRenewalInputSchema,
|
|
16312
16308
|
paySubscriptionTimeBasedRenewalResponseSchema,
|
|
16313
16309
|
paymentIriSchema,
|
|
16314
|
-
paymentMethodSchema,
|
|
16315
|
-
paymentMethods,
|
|
16316
16310
|
paymentNullableIriSchema,
|
|
16317
16311
|
paymentStatusSchema,
|
|
16318
16312
|
paymentStatuses,
|
|
@@ -16362,6 +16356,8 @@ var UpdateSubscription = class extends import_sdk_js_core68.AbstractApiRequest {
|
|
|
16362
16356
|
subscriptionOverviewPlanSchema,
|
|
16363
16357
|
subscriptionOverviewResponseSchema,
|
|
16364
16358
|
subscriptionOverviewSubscriptionSchema,
|
|
16359
|
+
subscriptionPaymentMethodSchema,
|
|
16360
|
+
subscriptionPaymentMethods,
|
|
16365
16361
|
subscriptionPlanIriSchema,
|
|
16366
16362
|
subscriptionPlanNullableIriSchema,
|
|
16367
16363
|
subscriptionPlanPriceOptionSchema,
|