@deliverart/sdk-js-subscription 2.14.0 → 2.14.2
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 +43 -0
- package/dist/index.cjs +309 -130
- package/dist/index.d.cts +975 -119
- package/dist/index.d.ts +975 -119
- package/dist/index.js +292 -130
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ Subscription management package for the Deliverart JavaScript SDK.
|
|
|
10
10
|
- subscription CRUD for `infinite`, `consumption` and `time_based`
|
|
11
11
|
- renewal CRUD for `consumption` and `time_based`
|
|
12
12
|
- subscription overview from point of sale
|
|
13
|
+
- admin billing queue and billing overview
|
|
13
14
|
- credit adjustments for consumption subscriptions
|
|
14
15
|
- renewal payment initialization for `stripe` and `bank_transfer`
|
|
15
16
|
- manual renewal payment resolution for offline payment methods
|
|
@@ -102,6 +103,10 @@ await sdk.call(
|
|
|
102
103
|
)
|
|
103
104
|
```
|
|
104
105
|
|
|
106
|
+
For `bank_transfer`, the purchase or renewal moves to `pending_verification` until a
|
|
107
|
+
`ROLE_SUBSCRIPTION_BILLING_ADMIN`, `ROLE_SUBSCRIPTION_ADMIN` or `ROLE_SUPER_ADMIN`
|
|
108
|
+
approves or rejects it.
|
|
109
|
+
|
|
105
110
|
Cancel a non-completed purchase:
|
|
106
111
|
|
|
107
112
|
```ts
|
|
@@ -124,6 +129,8 @@ const payment = await sdk.call(
|
|
|
124
129
|
)
|
|
125
130
|
```
|
|
126
131
|
|
|
132
|
+
If the retry method is `bank_transfer`, the returned purchase status becomes `pending_verification`.
|
|
133
|
+
|
|
127
134
|
Refund a completed offline purchase:
|
|
128
135
|
|
|
129
136
|
```ts
|
|
@@ -190,6 +197,42 @@ await sdk.call(
|
|
|
190
197
|
|
|
191
198
|
Allowed statuses are `paid`, `failed` and `canceled`.
|
|
192
199
|
|
|
200
|
+
The renewal must typically be in `pending_verification` before manual approval.
|
|
201
|
+
|
|
202
|
+
## Admin Billing Read Models
|
|
203
|
+
|
|
204
|
+
Pending verification queue:
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
import { GetSubscriptionBillingPendingVerification } from '@deliverart/sdk-js-subscription'
|
|
208
|
+
|
|
209
|
+
const queue = await sdk.call(
|
|
210
|
+
new GetSubscriptionBillingPendingVerification({
|
|
211
|
+
query: {
|
|
212
|
+
kind: 'purchase',
|
|
213
|
+
olderThanHours: 24,
|
|
214
|
+
limit: 20,
|
|
215
|
+
},
|
|
216
|
+
}),
|
|
217
|
+
)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Billing overview counters:
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
import { GetSubscriptionBillingOverview } from '@deliverart/sdk-js-subscription'
|
|
224
|
+
|
|
225
|
+
const overview = await sdk.call(new GetSubscriptionBillingOverview())
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
The overview payload exposes:
|
|
229
|
+
|
|
230
|
+
- pending verification counts for purchases and renewals
|
|
231
|
+
- failed payment counts
|
|
232
|
+
- open purchase counts
|
|
233
|
+
- pending renewal counts
|
|
234
|
+
- a `queuePreview` array with the same item shape returned by the pending verification queue
|
|
235
|
+
|
|
193
236
|
## Renewal Lifecycle Actions
|
|
194
237
|
|
|
195
238
|
Consumption renewal:
|