@blocklet/payment-js 1.13.297 → 1.13.298

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/lib/index.d.ts CHANGED
@@ -91,6 +91,9 @@ declare const _default: {
91
91
  customer_did?: string;
92
92
  }>, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TPaymentIntentExpanded>>;
93
93
  search: (_params: any, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TPaymentIntentExpanded>>;
94
+ refund: (_params: string, data?: Pick<import("sequelize").InferAttributes<import("@blocklet/payment-types").Refund, {
95
+ omit: never;
96
+ }>, "description" | "reason" | "amount">) => Promise<import("@blocklet/payment-types").TRefundExpanded>;
94
97
  };
95
98
  paymentCurrencies: {
96
99
  create: (data: Partial<import("sequelize").InferAttributes<import("@blocklet/payment-types").PaymentCurrency, {
@@ -247,6 +250,18 @@ declare const _default: {
247
250
  getTestMode: () => boolean;
248
251
  setTestMode: (value: boolean) => void;
249
252
  };
253
+ refunds: {
254
+ create: (data: Partial<import("@blocklet/payment-types").TRefundExpanded>, params?: never) => Promise<import("@blocklet/payment-types").TRefundExpanded>;
255
+ retrieve: (_params: string, data?: never) => Promise<import("@blocklet/payment-types").TRefundExpanded>;
256
+ list: (_params: import("@blocklet/payment-types").Pagination<{
257
+ status?: string;
258
+ invoice_id?: string;
259
+ subscription_id?: string;
260
+ currency_id?: string;
261
+ customer_id?: string;
262
+ }>, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TRefundExpanded>>;
263
+ search: (_params: any, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TRefundExpanded>>;
264
+ };
250
265
  };
251
266
  export default _default;
252
267
  export * from '@blocklet/payment-types';
package/lib/index.js CHANGED
@@ -29,6 +29,7 @@ const product_1 = __importDefault(require("./resources/product"));
29
29
  const subscription_1 = __importDefault(require("./resources/subscription"));
30
30
  const subscription_item_1 = __importDefault(require("./resources/subscription-item"));
31
31
  const webhook_endpoint_1 = __importDefault(require("./resources/webhook-endpoint"));
32
+ const refund_1 = __importDefault(require("./resources/refund"));
32
33
  // auto detect livemode
33
34
  if (process.env.PAYMENT_LIVEMODE) {
34
35
  resource_1.environments.setLivemode(process.env.PAYMENT_LIVEMODE === 'true');
@@ -54,5 +55,6 @@ exports.default = {
54
55
  subscriptionItems: subscription_item_1.default,
55
56
  webhookEndpoints: webhook_endpoint_1.default,
56
57
  environments: resource_1.environments,
58
+ refunds: refund_1.default,
57
59
  };
58
60
  __exportStar(require("@blocklet/payment-types"), exports);
@@ -1,4 +1,4 @@
1
- import type { Paginated, Pagination, TPaymentIntentExpanded } from '@blocklet/payment-types';
1
+ import type { Paginated, Pagination, TPaymentIntentExpanded, TRefundExpanded } from '@blocklet/payment-types';
2
2
  declare const _default: {
3
3
  create: (data: Partial<import("sequelize").InferAttributes<import("@blocklet/payment-types").PaymentIntent, {
4
4
  omit: never;
@@ -18,5 +18,8 @@ declare const _default: {
18
18
  customer_did?: string;
19
19
  }>, data?: never) => Promise<Paginated<TPaymentIntentExpanded>>;
20
20
  search: (_params: any, data?: never) => Promise<Paginated<TPaymentIntentExpanded>>;
21
+ refund: (_params: string, data?: Pick<import("sequelize").InferAttributes<import("@blocklet/payment-types").Refund, {
22
+ omit: never;
23
+ }>, "description" | "reason" | "amount">) => Promise<TRefundExpanded>;
21
24
  };
22
25
  export default _default;
@@ -22,4 +22,8 @@ exports.default = {
22
22
  method: 'GET',
23
23
  path: '/api/payment-intents/search',
24
24
  }),
25
+ refund: (0, resource_1.createResourceMethod)({
26
+ method: 'PUT',
27
+ path: '/api/payment-intents/{id}/refund',
28
+ }),
25
29
  };
@@ -0,0 +1,14 @@
1
+ import type { Paginated, Pagination, TRefundExpanded } from '@blocklet/payment-types';
2
+ declare const _default: {
3
+ create: (data: Partial<TRefundExpanded>, params?: never) => Promise<TRefundExpanded>;
4
+ retrieve: (_params: string, data?: never) => Promise<TRefundExpanded>;
5
+ list: (_params: Pagination<{
6
+ status?: string;
7
+ invoice_id?: string;
8
+ subscription_id?: string;
9
+ currency_id?: string;
10
+ customer_id?: string;
11
+ }>, data?: never) => Promise<Paginated<TRefundExpanded>>;
12
+ search: (_params: any, data?: never) => Promise<Paginated<TRefundExpanded>>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const resource_1 = require("../resource");
4
+ exports.default = {
5
+ create: (0, resource_1.createResourceCreateMethod)({
6
+ method: 'POST',
7
+ path: '/api/refunds',
8
+ }),
9
+ retrieve: (0, resource_1.createResourceMethod)({
10
+ method: 'GET',
11
+ path: '/api/refunds/{id}',
12
+ }),
13
+ list: (0, resource_1.createResourceMethod)({
14
+ method: 'GET',
15
+ path: '/api/refunds',
16
+ }),
17
+ search: (0, resource_1.createResourceMethod)({
18
+ method: 'GET',
19
+ path: '/api/refunds/search',
20
+ }),
21
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-js",
3
- "version": "1.13.297",
3
+ "version": "1.13.298",
4
4
  "description": "Node.js client for Payment Kit",
5
5
  "keywords": [
6
6
  "types",
@@ -36,7 +36,7 @@
36
36
  "url": "https://github.com/blocklet/payment-kit/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@blocklet/payment-types": "1.13.297",
39
+ "@blocklet/payment-types": "1.13.298",
40
40
  "@blocklet/sdk": "1.16.28"
41
41
  },
42
42
  "importSort": {
@@ -62,5 +62,5 @@
62
62
  "type-fest": "^4.19.0",
63
63
  "typescript": "^5.4.5"
64
64
  },
65
- "gitHead": "bcdfb08a169f1ec57a5f63b378c6b5ea10a2f40d"
65
+ "gitHead": "85dd6105a19723e06405eebb4bcc6ffddc2cd7aa"
66
66
  }