@jogolabs/billing-sdk-v2 0.0.1 → 0.0.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.
Files changed (53) hide show
  1. package/dist/billing/src/__generated__/models/CreateMerchantRequest.d.ts +4 -1
  2. package/dist/billing/src/__generated__/models/CreateSubscriptionRequest.d.ts +4 -1
  3. package/dist/billing/src/__generated__/models/Merchant.d.ts +2 -2
  4. package/dist/billing/src/__generated__/models/Package.d.ts +4 -1
  5. package/dist/billing/src/__generated__/models/Payment.d.ts +4 -1
  6. package/dist/billing/src/__generated__/models/SavedCard.d.ts +4 -1
  7. package/dist/billing/src/__generated__/models/Subscription.d.ts +4 -1
  8. package/dist/billing/src/__generated__/models/TokenizeCardRequest.d.ts +4 -1
  9. package/dist/billing/src/__generated__/schemas/$CreateMerchantRequest.d.ts +2 -1
  10. package/dist/billing/src/__generated__/schemas/$CreateMerchantRequest.js +2 -1
  11. package/dist/billing/src/__generated__/schemas/$CreateSubscriptionRequest.d.ts +2 -1
  12. package/dist/billing/src/__generated__/schemas/$CreateSubscriptionRequest.js +2 -1
  13. package/dist/billing/src/__generated__/schemas/$Merchant.d.ts +2 -2
  14. package/dist/billing/src/__generated__/schemas/$Merchant.js +2 -2
  15. package/dist/billing/src/__generated__/schemas/$Package.d.ts +2 -1
  16. package/dist/billing/src/__generated__/schemas/$Package.js +2 -1
  17. package/dist/billing/src/__generated__/schemas/$Payment.d.ts +2 -1
  18. package/dist/billing/src/__generated__/schemas/$Payment.js +2 -1
  19. package/dist/billing/src/__generated__/schemas/$SavedCard.d.ts +2 -1
  20. package/dist/billing/src/__generated__/schemas/$SavedCard.js +2 -1
  21. package/dist/billing/src/__generated__/schemas/$Subscription.d.ts +2 -1
  22. package/dist/billing/src/__generated__/schemas/$Subscription.js +2 -1
  23. package/dist/billing/src/__generated__/schemas/$TokenizeCardRequest.d.ts +2 -1
  24. package/dist/billing/src/__generated__/schemas/$TokenizeCardRequest.js +2 -1
  25. package/dist/billing/src/__generated__/services/CardsService.d.ts +3 -3
  26. package/dist/billing/src/__generated__/services/CardsService.js +3 -3
  27. package/dist/billing/src/__generated__/services/MerchantsService.d.ts +5 -5
  28. package/dist/billing/src/__generated__/services/MerchantsService.js +7 -7
  29. package/dist/billing/src/__generated__/services/PackagesService.d.ts +11 -11
  30. package/dist/billing/src/__generated__/services/PackagesService.js +15 -15
  31. package/dist/billing/src/__generated__/services/PaymentsService.d.ts +4 -4
  32. package/dist/billing/src/__generated__/services/PaymentsService.js +4 -4
  33. package/package.json +1 -1
  34. package/src/billing/src/__generated__/models/CreateMerchantRequest.ts +4 -1
  35. package/src/billing/src/__generated__/models/CreateSubscriptionRequest.ts +4 -1
  36. package/src/billing/src/__generated__/models/Merchant.ts +2 -2
  37. package/src/billing/src/__generated__/models/Package.ts +4 -1
  38. package/src/billing/src/__generated__/models/Payment.ts +4 -1
  39. package/src/billing/src/__generated__/models/SavedCard.ts +4 -1
  40. package/src/billing/src/__generated__/models/Subscription.ts +4 -1
  41. package/src/billing/src/__generated__/models/TokenizeCardRequest.ts +4 -1
  42. package/src/billing/src/__generated__/schemas/$CreateMerchantRequest.ts +2 -1
  43. package/src/billing/src/__generated__/schemas/$CreateSubscriptionRequest.ts +2 -1
  44. package/src/billing/src/__generated__/schemas/$Merchant.ts +2 -2
  45. package/src/billing/src/__generated__/schemas/$Package.ts +2 -1
  46. package/src/billing/src/__generated__/schemas/$Payment.ts +2 -1
  47. package/src/billing/src/__generated__/schemas/$SavedCard.ts +2 -1
  48. package/src/billing/src/__generated__/schemas/$Subscription.ts +2 -1
  49. package/src/billing/src/__generated__/schemas/$TokenizeCardRequest.ts +2 -1
  50. package/src/billing/src/__generated__/services/CardsService.ts +5 -5
  51. package/src/billing/src/__generated__/services/MerchantsService.ts +9 -9
  52. package/src/billing/src/__generated__/services/PackagesService.ts +26 -26
  53. package/src/billing/src/__generated__/services/PaymentsService.ts +6 -6
@@ -1,5 +1,8 @@
1
1
  export type CreateMerchantRequest = {
2
- businessId: string;
2
+ /**
3
+ * Space ID from jogo-backend
4
+ */
5
+ spaceId: string;
3
6
  name: string;
4
7
  email: string;
5
8
  paymentProvider?: CreateMerchantRequest.paymentProvider;
@@ -1,5 +1,8 @@
1
1
  export type CreateSubscriptionRequest = {
2
- merchantId: string;
2
+ /**
3
+ * Space ID from jogo-backend
4
+ */
5
+ spaceId: string;
3
6
  packageId: string;
4
7
  autoRenew?: boolean;
5
8
  customerEmail: string;
@@ -2,9 +2,9 @@ import type { MerchantProviderConfig } from './MerchantProviderConfig';
2
2
  export type Merchant = {
3
3
  _id?: string;
4
4
  /**
5
- * ID del negocio en jogo-backend
5
+ * Space ID from jogo-backend
6
6
  */
7
- businessId?: string;
7
+ spaceId?: string;
8
8
  name?: string;
9
9
  email?: string;
10
10
  paymentProvider?: Merchant.paymentProvider;
@@ -1,6 +1,9 @@
1
1
  export type Package = {
2
2
  _id?: string;
3
- merchantId?: string;
3
+ /**
4
+ * Space ID from jogo-backend
5
+ */
6
+ spaceId?: string;
4
7
  name?: string;
5
8
  description?: string;
6
9
  numberOfClasses?: number;
@@ -1,6 +1,9 @@
1
1
  export type Payment = {
2
2
  _id?: string;
3
- merchantId?: string;
3
+ /**
4
+ * Space ID from jogo-backend
5
+ */
6
+ spaceId?: string;
4
7
  customerId?: string;
5
8
  type?: Payment.type;
6
9
  /**
@@ -1,7 +1,10 @@
1
1
  export type SavedCard = {
2
2
  _id?: string;
3
3
  customerId?: string;
4
- merchantId?: string;
4
+ /**
5
+ * Space ID from jogo-backend
6
+ */
7
+ spaceId?: string;
5
8
  provider?: SavedCard.provider;
6
9
  lastFour?: string;
7
10
  cardBrand?: string | null;
@@ -1,7 +1,10 @@
1
1
  import type { Package } from './Package';
2
2
  export type Subscription = {
3
3
  _id?: string;
4
- merchantId?: string;
4
+ /**
5
+ * Space ID from jogo-backend
6
+ */
7
+ spaceId?: string;
5
8
  /**
6
9
  * ID del cliente en jogo-backend
7
10
  */
@@ -1,5 +1,8 @@
1
1
  export type TokenizeCardRequest = {
2
- merchantId: string;
2
+ /**
3
+ * Space ID from jogo-backend
4
+ */
5
+ spaceId: string;
3
6
  cardNumber: string;
4
7
  cvv: string;
5
8
  expirationMonth: number;
@@ -1,7 +1,8 @@
1
1
  export declare const $CreateMerchantRequest: {
2
2
  readonly properties: {
3
- readonly businessId: {
3
+ readonly spaceId: {
4
4
  readonly type: "string";
5
+ readonly description: "Space ID from jogo-backend";
5
6
  readonly isRequired: true;
6
7
  };
7
8
  readonly name: {
@@ -7,8 +7,9 @@ exports.$CreateMerchantRequest = void 0;
7
7
  /* eslint-disable */
8
8
  exports.$CreateMerchantRequest = {
9
9
  properties: {
10
- businessId: {
10
+ spaceId: {
11
11
  type: 'string',
12
+ description: `Space ID from jogo-backend`,
12
13
  isRequired: true,
13
14
  },
14
15
  name: {
@@ -1,7 +1,8 @@
1
1
  export declare const $CreateSubscriptionRequest: {
2
2
  readonly properties: {
3
- readonly merchantId: {
3
+ readonly spaceId: {
4
4
  readonly type: "string";
5
+ readonly description: "Space ID from jogo-backend";
5
6
  readonly isRequired: true;
6
7
  };
7
8
  readonly packageId: {
@@ -7,8 +7,9 @@ exports.$CreateSubscriptionRequest = void 0;
7
7
  /* eslint-disable */
8
8
  exports.$CreateSubscriptionRequest = {
9
9
  properties: {
10
- merchantId: {
10
+ spaceId: {
11
11
  type: 'string',
12
+ description: `Space ID from jogo-backend`,
12
13
  isRequired: true,
13
14
  },
14
15
  packageId: {
@@ -3,9 +3,9 @@ export declare const $Merchant: {
3
3
  readonly _id: {
4
4
  readonly type: "string";
5
5
  };
6
- readonly businessId: {
6
+ readonly spaceId: {
7
7
  readonly type: "string";
8
- readonly description: "ID del negocio en jogo-backend";
8
+ readonly description: "Space ID from jogo-backend";
9
9
  };
10
10
  readonly name: {
11
11
  readonly type: "string";
@@ -10,9 +10,9 @@ exports.$Merchant = {
10
10
  _id: {
11
11
  type: 'string',
12
12
  },
13
- businessId: {
13
+ spaceId: {
14
14
  type: 'string',
15
- description: `ID del negocio en jogo-backend`,
15
+ description: `Space ID from jogo-backend`,
16
16
  },
17
17
  name: {
18
18
  type: 'string',
@@ -3,8 +3,9 @@ export declare const $Package: {
3
3
  readonly _id: {
4
4
  readonly type: "string";
5
5
  };
6
- readonly merchantId: {
6
+ readonly spaceId: {
7
7
  readonly type: "string";
8
+ readonly description: "Space ID from jogo-backend";
8
9
  };
9
10
  readonly name: {
10
11
  readonly type: "string";
@@ -10,8 +10,9 @@ exports.$Package = {
10
10
  _id: {
11
11
  type: 'string',
12
12
  },
13
- merchantId: {
13
+ spaceId: {
14
14
  type: 'string',
15
+ description: `Space ID from jogo-backend`,
15
16
  },
16
17
  name: {
17
18
  type: 'string',
@@ -3,8 +3,9 @@ export declare const $Payment: {
3
3
  readonly _id: {
4
4
  readonly type: "string";
5
5
  };
6
- readonly merchantId: {
6
+ readonly spaceId: {
7
7
  readonly type: "string";
8
+ readonly description: "Space ID from jogo-backend";
8
9
  };
9
10
  readonly customerId: {
10
11
  readonly type: "string";
@@ -10,8 +10,9 @@ exports.$Payment = {
10
10
  _id: {
11
11
  type: 'string',
12
12
  },
13
- merchantId: {
13
+ spaceId: {
14
14
  type: 'string',
15
+ description: `Space ID from jogo-backend`,
15
16
  },
16
17
  customerId: {
17
18
  type: 'string',
@@ -6,8 +6,9 @@ export declare const $SavedCard: {
6
6
  readonly customerId: {
7
7
  readonly type: "string";
8
8
  };
9
- readonly merchantId: {
9
+ readonly spaceId: {
10
10
  readonly type: "string";
11
+ readonly description: "Space ID from jogo-backend";
11
12
  };
12
13
  readonly provider: {
13
14
  readonly type: "Enum";
@@ -13,8 +13,9 @@ exports.$SavedCard = {
13
13
  customerId: {
14
14
  type: 'string',
15
15
  },
16
- merchantId: {
16
+ spaceId: {
17
17
  type: 'string',
18
+ description: `Space ID from jogo-backend`,
18
19
  },
19
20
  provider: {
20
21
  type: 'Enum',
@@ -3,8 +3,9 @@ export declare const $Subscription: {
3
3
  readonly _id: {
4
4
  readonly type: "string";
5
5
  };
6
- readonly merchantId: {
6
+ readonly spaceId: {
7
7
  readonly type: "string";
8
+ readonly description: "Space ID from jogo-backend";
8
9
  };
9
10
  readonly customerId: {
10
11
  readonly type: "string";
@@ -10,8 +10,9 @@ exports.$Subscription = {
10
10
  _id: {
11
11
  type: 'string',
12
12
  },
13
- merchantId: {
13
+ spaceId: {
14
14
  type: 'string',
15
+ description: `Space ID from jogo-backend`,
15
16
  },
16
17
  customerId: {
17
18
  type: 'string',
@@ -1,7 +1,8 @@
1
1
  export declare const $TokenizeCardRequest: {
2
2
  readonly properties: {
3
- readonly merchantId: {
3
+ readonly spaceId: {
4
4
  readonly type: "string";
5
+ readonly description: "Space ID from jogo-backend";
5
6
  readonly isRequired: true;
6
7
  };
7
8
  readonly cardNumber: {
@@ -7,8 +7,9 @@ exports.$TokenizeCardRequest = void 0;
7
7
  /* eslint-disable */
8
8
  exports.$TokenizeCardRequest = {
9
9
  properties: {
10
- merchantId: {
10
+ spaceId: {
11
11
  type: 'string',
12
+ description: `Space ID from jogo-backend`,
12
13
  isRequired: true,
13
14
  },
14
15
  cardNumber: {
@@ -21,11 +21,11 @@ export declare class CardsService {
21
21
  * @returns SavedCard Lista de tarjetas guardadas
22
22
  * @throws ApiError
23
23
  */
24
- getApiV1Cards({ merchantId, }: {
24
+ getApiV1Cards({ spaceId, }: {
25
25
  /**
26
26
  * ID del merchant para filtrar las tarjetas
27
27
  */
28
- merchantId: string;
28
+ spaceId: string;
29
29
  }): CancelablePromise<Array<SavedCard>>;
30
30
  /**
31
31
  * Establecer tarjeta predeterminada
@@ -37,7 +37,7 @@ export declare class CardsService {
37
37
  patchApiV1CardsDefault({ id, requestBody, }: {
38
38
  id: string;
39
39
  requestBody: {
40
- merchantId: string;
40
+ spaceId: string;
41
41
  };
42
42
  }): CancelablePromise<{
43
43
  message?: string;
@@ -31,15 +31,15 @@ class CardsService {
31
31
  * @returns SavedCard Lista de tarjetas guardadas
32
32
  * @throws ApiError
33
33
  */
34
- getApiV1Cards({ merchantId, }) {
34
+ getApiV1Cards({ spaceId, }) {
35
35
  return this.httpRequest.request({
36
36
  method: 'GET',
37
37
  url: '/api/v1/cards',
38
38
  query: {
39
- 'merchantId': merchantId,
39
+ 'spaceId': spaceId,
40
40
  },
41
41
  errors: {
42
- 400: `merchantId requerido`,
42
+ 400: `spaceId requerido`,
43
43
  401: `Token JWT ausente o inválido`,
44
44
  },
45
45
  });
@@ -17,17 +17,17 @@ export declare class MerchantsService {
17
17
  requestBody: CreateMerchantRequest;
18
18
  }): CancelablePromise<Merchant>;
19
19
  /**
20
- * Obtener negocio por businessId
20
+ * Obtener negocio por spaceId
21
21
  * Retorna la configuración del negocio sin incluir la API Key del proveedor de pago.
22
22
  *
23
23
  * @returns Merchant Configuración del negocio (sin API Key)
24
24
  * @throws ApiError
25
25
  */
26
- getApiV1MerchantsBusiness({ businessId, }: {
26
+ getApiV1MerchantsBusiness({ spaceId, }: {
27
27
  /**
28
28
  * ID del negocio en jogo-backend
29
29
  */
30
- businessId: string;
30
+ spaceId: string;
31
31
  }): CancelablePromise<Merchant>;
32
32
  /**
33
33
  * Actualizar configuración del negocio
@@ -36,8 +36,8 @@ export declare class MerchantsService {
36
36
  * @returns Merchant Negocio actualizado
37
37
  * @throws ApiError
38
38
  */
39
- putApiV1MerchantsBusiness({ businessId, requestBody, }: {
40
- businessId: string;
39
+ putApiV1MerchantsBusiness({ spaceId, requestBody, }: {
40
+ spaceId: string;
41
41
  requestBody: UpdateMerchantRequest;
42
42
  }): CancelablePromise<Merchant>;
43
43
  }
@@ -26,18 +26,18 @@ class MerchantsService {
26
26
  });
27
27
  }
28
28
  /**
29
- * Obtener negocio por businessId
29
+ * Obtener negocio por spaceId
30
30
  * Retorna la configuración del negocio sin incluir la API Key del proveedor de pago.
31
31
  *
32
32
  * @returns Merchant Configuración del negocio (sin API Key)
33
33
  * @throws ApiError
34
34
  */
35
- getApiV1MerchantsBusiness({ businessId, }) {
35
+ getApiV1MerchantsBusiness({ spaceId, }) {
36
36
  return this.httpRequest.request({
37
37
  method: 'GET',
38
- url: '/api/v1/merchants/business/{businessId}',
38
+ url: '/api/v1/merchants/business/{spaceId}',
39
39
  path: {
40
- 'businessId': businessId,
40
+ 'spaceId': spaceId,
41
41
  },
42
42
  errors: {
43
43
  401: `Token JWT ausente o inválido`,
@@ -52,12 +52,12 @@ class MerchantsService {
52
52
  * @returns Merchant Negocio actualizado
53
53
  * @throws ApiError
54
54
  */
55
- putApiV1MerchantsBusiness({ businessId, requestBody, }) {
55
+ putApiV1MerchantsBusiness({ spaceId, requestBody, }) {
56
56
  return this.httpRequest.request({
57
57
  method: 'PUT',
58
- url: '/api/v1/merchants/business/{businessId}',
58
+ url: '/api/v1/merchants/business/{spaceId}',
59
59
  path: {
60
- 'businessId': businessId,
60
+ 'spaceId': spaceId,
61
61
  },
62
62
  body: requestBody,
63
63
  mediaType: 'application/json',
@@ -12,11 +12,11 @@ export declare class PackagesService {
12
12
  * @returns Package Paquete creado
13
13
  * @throws ApiError
14
14
  */
15
- postApiV1MerchantsPackages({ merchantId, requestBody, }: {
15
+ postApiV1SpacesPackages({ spaceId, requestBody, }: {
16
16
  /**
17
- * ID del merchant en este servicio
17
+ * Space ID from jogo-backend
18
18
  */
19
- merchantId: string;
19
+ spaceId: string;
20
20
  requestBody: CreatePackageRequest;
21
21
  }): CancelablePromise<Package>;
22
22
  /**
@@ -26,8 +26,8 @@ export declare class PackagesService {
26
26
  * @returns Package Lista de paquetes
27
27
  * @throws ApiError
28
28
  */
29
- getApiV1MerchantsPackages({ merchantId, all, }: {
30
- merchantId: string;
29
+ getApiV1SpacesPackages({ spaceId, all, }: {
30
+ spaceId: string;
31
31
  /**
32
32
  * Si es `true`, incluye paquetes inactivos
33
33
  */
@@ -38,8 +38,8 @@ export declare class PackagesService {
38
38
  * @returns Package Detalle del paquete
39
39
  * @throws ApiError
40
40
  */
41
- getApiV1MerchantsPackages1({ merchantId, id, }: {
42
- merchantId: string;
41
+ getApiV1SpacesPackages1({ spaceId, id, }: {
42
+ spaceId: string;
43
43
  id: string;
44
44
  }): CancelablePromise<Package>;
45
45
  /**
@@ -47,8 +47,8 @@ export declare class PackagesService {
47
47
  * @returns Package Paquete actualizado
48
48
  * @throws ApiError
49
49
  */
50
- putApiV1MerchantsPackages({ merchantId, id, requestBody, }: {
51
- merchantId: string;
50
+ putApiV1SpacesPackages({ spaceId, id, requestBody, }: {
51
+ spaceId: string;
52
52
  id: string;
53
53
  requestBody: UpdatePackageRequest;
54
54
  }): CancelablePromise<Package>;
@@ -59,8 +59,8 @@ export declare class PackagesService {
59
59
  * @returns Package Paquete desactivado
60
60
  * @throws ApiError
61
61
  */
62
- deleteApiV1MerchantsPackages({ merchantId, id, }: {
63
- merchantId: string;
62
+ deleteApiV1SpacesPackages({ spaceId, id, }: {
63
+ spaceId: string;
64
64
  id: string;
65
65
  }): CancelablePromise<Package>;
66
66
  }
@@ -12,12 +12,12 @@ class PackagesService {
12
12
  * @returns Package Paquete creado
13
13
  * @throws ApiError
14
14
  */
15
- postApiV1MerchantsPackages({ merchantId, requestBody, }) {
15
+ postApiV1SpacesPackages({ spaceId, requestBody, }) {
16
16
  return this.httpRequest.request({
17
17
  method: 'POST',
18
- url: '/api/v1/merchants/{merchantId}/packages',
18
+ url: '/api/v1/spaces/{spaceId}/packages',
19
19
  path: {
20
- 'merchantId': merchantId,
20
+ 'spaceId': spaceId,
21
21
  },
22
22
  body: requestBody,
23
23
  mediaType: 'application/json',
@@ -33,12 +33,12 @@ class PackagesService {
33
33
  * @returns Package Lista de paquetes
34
34
  * @throws ApiError
35
35
  */
36
- getApiV1MerchantsPackages({ merchantId, all, }) {
36
+ getApiV1SpacesPackages({ spaceId, all, }) {
37
37
  return this.httpRequest.request({
38
38
  method: 'GET',
39
- url: '/api/v1/merchants/{merchantId}/packages',
39
+ url: '/api/v1/spaces/{spaceId}/packages',
40
40
  path: {
41
- 'merchantId': merchantId,
41
+ 'spaceId': spaceId,
42
42
  },
43
43
  query: {
44
44
  'all': all,
@@ -50,12 +50,12 @@ class PackagesService {
50
50
  * @returns Package Detalle del paquete
51
51
  * @throws ApiError
52
52
  */
53
- getApiV1MerchantsPackages1({ merchantId, id, }) {
53
+ getApiV1SpacesPackages1({ spaceId, id, }) {
54
54
  return this.httpRequest.request({
55
55
  method: 'GET',
56
- url: '/api/v1/merchants/{merchantId}/packages/{id}',
56
+ url: '/api/v1/spaces/{spaceId}/packages/{id}',
57
57
  path: {
58
- 'merchantId': merchantId,
58
+ 'spaceId': spaceId,
59
59
  'id': id,
60
60
  },
61
61
  errors: {
@@ -68,12 +68,12 @@ class PackagesService {
68
68
  * @returns Package Paquete actualizado
69
69
  * @throws ApiError
70
70
  */
71
- putApiV1MerchantsPackages({ merchantId, id, requestBody, }) {
71
+ putApiV1SpacesPackages({ spaceId, id, requestBody, }) {
72
72
  return this.httpRequest.request({
73
73
  method: 'PUT',
74
- url: '/api/v1/merchants/{merchantId}/packages/{id}',
74
+ url: '/api/v1/spaces/{spaceId}/packages/{id}',
75
75
  path: {
76
- 'merchantId': merchantId,
76
+ 'spaceId': spaceId,
77
77
  'id': id,
78
78
  },
79
79
  body: requestBody,
@@ -92,12 +92,12 @@ class PackagesService {
92
92
  * @returns Package Paquete desactivado
93
93
  * @throws ApiError
94
94
  */
95
- deleteApiV1MerchantsPackages({ merchantId, id, }) {
95
+ deleteApiV1SpacesPackages({ spaceId, id, }) {
96
96
  return this.httpRequest.request({
97
97
  method: 'DELETE',
98
- url: '/api/v1/merchants/{merchantId}/packages/{id}',
98
+ url: '/api/v1/spaces/{spaceId}/packages/{id}',
99
99
  path: {
100
- 'merchantId': merchantId,
100
+ 'spaceId': spaceId,
101
101
  'id': id,
102
102
  },
103
103
  errors: {
@@ -8,16 +8,16 @@ export declare class PaymentsService {
8
8
  * Webhook de notificación de Wompi
9
9
  * Endpoint que Wompi llama para notificar el resultado de una transacción. **No requiere autenticación** — es invocado directamente por Wompi.
10
10
  * Al recibir un pago completado (`APROBADA`), activa automáticamente la suscripción asociada.
11
- * Configurar esta URL en el `webhookUrl` del merchant: `POST https://tu-servidor.com/api/v1/webhooks/{merchantId}`
11
+ * Configurar esta URL en el `webhookUrl` del merchant: `POST https://tu-servidor.com/api/v1/webhooks/{spaceId}`
12
12
  *
13
13
  * @returns any Webhook recibido y procesado
14
14
  * @throws ApiError
15
15
  */
16
- postApiV1Webhooks({ merchantId, requestBody, }: {
16
+ postApiV1Webhooks({ spaceId, requestBody, }: {
17
17
  /**
18
- * ID del merchant en este servicio (no el businessId de jogo-backend)
18
+ * Space ID from jogo-backend
19
19
  */
20
- merchantId: string;
20
+ spaceId: string;
21
21
  requestBody: {
22
22
  /**
23
23
  * ID de la transacción en Wompi
@@ -10,17 +10,17 @@ class PaymentsService {
10
10
  * Webhook de notificación de Wompi
11
11
  * Endpoint que Wompi llama para notificar el resultado de una transacción. **No requiere autenticación** — es invocado directamente por Wompi.
12
12
  * Al recibir un pago completado (`APROBADA`), activa automáticamente la suscripción asociada.
13
- * Configurar esta URL en el `webhookUrl` del merchant: `POST https://tu-servidor.com/api/v1/webhooks/{merchantId}`
13
+ * Configurar esta URL en el `webhookUrl` del merchant: `POST https://tu-servidor.com/api/v1/webhooks/{spaceId}`
14
14
  *
15
15
  * @returns any Webhook recibido y procesado
16
16
  * @throws ApiError
17
17
  */
18
- postApiV1Webhooks({ merchantId, requestBody, }) {
18
+ postApiV1Webhooks({ spaceId, requestBody, }) {
19
19
  return this.httpRequest.request({
20
20
  method: 'POST',
21
- url: '/api/v1/webhooks/{merchantId}',
21
+ url: '/api/v1/webhooks/{spaceId}',
22
22
  path: {
23
- 'merchantId': merchantId,
23
+ 'spaceId': spaceId,
24
24
  },
25
25
  body: requestBody,
26
26
  mediaType: 'application/json',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jogolabs/billing-sdk-v2",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Billing SDK v2 to Jogo Labs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,7 +3,10 @@
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
5
  export type CreateMerchantRequest = {
6
- businessId: string;
6
+ /**
7
+ * Space ID from jogo-backend
8
+ */
9
+ spaceId: string;
7
10
  name: string;
8
11
  email: string;
9
12
  paymentProvider?: CreateMerchantRequest.paymentProvider;
@@ -3,7 +3,10 @@
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
5
  export type CreateSubscriptionRequest = {
6
- merchantId: string;
6
+ /**
7
+ * Space ID from jogo-backend
8
+ */
9
+ spaceId: string;
7
10
  packageId: string;
8
11
  autoRenew?: boolean;
9
12
  customerEmail: string;
@@ -6,9 +6,9 @@ import type { MerchantProviderConfig } from './MerchantProviderConfig';
6
6
  export type Merchant = {
7
7
  _id?: string;
8
8
  /**
9
- * ID del negocio en jogo-backend
9
+ * Space ID from jogo-backend
10
10
  */
11
- businessId?: string;
11
+ spaceId?: string;
12
12
  name?: string;
13
13
  email?: string;
14
14
  paymentProvider?: Merchant.paymentProvider;
@@ -4,7 +4,10 @@
4
4
  /* eslint-disable */
5
5
  export type Package = {
6
6
  _id?: string;
7
- merchantId?: string;
7
+ /**
8
+ * Space ID from jogo-backend
9
+ */
10
+ spaceId?: string;
8
11
  name?: string;
9
12
  description?: string;
10
13
  numberOfClasses?: number;
@@ -4,7 +4,10 @@
4
4
  /* eslint-disable */
5
5
  export type Payment = {
6
6
  _id?: string;
7
- merchantId?: string;
7
+ /**
8
+ * Space ID from jogo-backend
9
+ */
10
+ spaceId?: string;
8
11
  customerId?: string;
9
12
  type?: Payment.type;
10
13
  /**
@@ -5,7 +5,10 @@
5
5
  export type SavedCard = {
6
6
  _id?: string;
7
7
  customerId?: string;
8
- merchantId?: string;
8
+ /**
9
+ * Space ID from jogo-backend
10
+ */
11
+ spaceId?: string;
9
12
  provider?: SavedCard.provider;
10
13
  lastFour?: string;
11
14
  cardBrand?: string | null;
@@ -5,7 +5,10 @@
5
5
  import type { Package } from './Package';
6
6
  export type Subscription = {
7
7
  _id?: string;
8
- merchantId?: string;
8
+ /**
9
+ * Space ID from jogo-backend
10
+ */
11
+ spaceId?: string;
9
12
  /**
10
13
  * ID del cliente en jogo-backend
11
14
  */
@@ -3,7 +3,10 @@
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
5
  export type TokenizeCardRequest = {
6
- merchantId: string;
6
+ /**
7
+ * Space ID from jogo-backend
8
+ */
9
+ spaceId: string;
7
10
  cardNumber: string;
8
11
  cvv: string;
9
12
  expirationMonth: number;
@@ -4,8 +4,9 @@
4
4
  /* eslint-disable */
5
5
  export const $CreateMerchantRequest = {
6
6
  properties: {
7
- businessId: {
7
+ spaceId: {
8
8
  type: 'string',
9
+ description: `Space ID from jogo-backend`,
9
10
  isRequired: true,
10
11
  },
11
12
  name: {
@@ -4,8 +4,9 @@
4
4
  /* eslint-disable */
5
5
  export const $CreateSubscriptionRequest = {
6
6
  properties: {
7
- merchantId: {
7
+ spaceId: {
8
8
  type: 'string',
9
+ description: `Space ID from jogo-backend`,
9
10
  isRequired: true,
10
11
  },
11
12
  packageId: {
@@ -7,9 +7,9 @@ export const $Merchant = {
7
7
  _id: {
8
8
  type: 'string',
9
9
  },
10
- businessId: {
10
+ spaceId: {
11
11
  type: 'string',
12
- description: `ID del negocio en jogo-backend`,
12
+ description: `Space ID from jogo-backend`,
13
13
  },
14
14
  name: {
15
15
  type: 'string',
@@ -7,8 +7,9 @@ export const $Package = {
7
7
  _id: {
8
8
  type: 'string',
9
9
  },
10
- merchantId: {
10
+ spaceId: {
11
11
  type: 'string',
12
+ description: `Space ID from jogo-backend`,
12
13
  },
13
14
  name: {
14
15
  type: 'string',
@@ -7,8 +7,9 @@ export const $Payment = {
7
7
  _id: {
8
8
  type: 'string',
9
9
  },
10
- merchantId: {
10
+ spaceId: {
11
11
  type: 'string',
12
+ description: `Space ID from jogo-backend`,
12
13
  },
13
14
  customerId: {
14
15
  type: 'string',
@@ -10,8 +10,9 @@ export const $SavedCard = {
10
10
  customerId: {
11
11
  type: 'string',
12
12
  },
13
- merchantId: {
13
+ spaceId: {
14
14
  type: 'string',
15
+ description: `Space ID from jogo-backend`,
15
16
  },
16
17
  provider: {
17
18
  type: 'Enum',
@@ -7,8 +7,9 @@ export const $Subscription = {
7
7
  _id: {
8
8
  type: 'string',
9
9
  },
10
- merchantId: {
10
+ spaceId: {
11
11
  type: 'string',
12
+ description: `Space ID from jogo-backend`,
12
13
  },
13
14
  customerId: {
14
15
  type: 'string',
@@ -4,8 +4,9 @@
4
4
  /* eslint-disable */
5
5
  export const $TokenizeCardRequest = {
6
6
  properties: {
7
- merchantId: {
7
+ spaceId: {
8
8
  type: 'string',
9
+ description: `Space ID from jogo-backend`,
9
10
  isRequired: true,
10
11
  },
11
12
  cardNumber: {
@@ -38,21 +38,21 @@ export class CardsService {
38
38
  * @throws ApiError
39
39
  */
40
40
  public getApiV1Cards({
41
- merchantId,
41
+ spaceId,
42
42
  }: {
43
43
  /**
44
44
  * ID del merchant para filtrar las tarjetas
45
45
  */
46
- merchantId: string,
46
+ spaceId: string,
47
47
  }): CancelablePromise<Array<SavedCard>> {
48
48
  return this.httpRequest.request({
49
49
  method: 'GET',
50
50
  url: '/api/v1/cards',
51
51
  query: {
52
- 'merchantId': merchantId,
52
+ 'spaceId': spaceId,
53
53
  },
54
54
  errors: {
55
- 400: `merchantId requerido`,
55
+ 400: `spaceId requerido`,
56
56
  401: `Token JWT ausente o inválido`,
57
57
  },
58
58
  });
@@ -70,7 +70,7 @@ export class CardsService {
70
70
  }: {
71
71
  id: string,
72
72
  requestBody: {
73
- merchantId: string;
73
+ spaceId: string;
74
74
  },
75
75
  }): CancelablePromise<{
76
76
  message?: string;
@@ -33,25 +33,25 @@ export class MerchantsService {
33
33
  });
34
34
  }
35
35
  /**
36
- * Obtener negocio por businessId
36
+ * Obtener negocio por spaceId
37
37
  * Retorna la configuración del negocio sin incluir la API Key del proveedor de pago.
38
38
  *
39
39
  * @returns Merchant Configuración del negocio (sin API Key)
40
40
  * @throws ApiError
41
41
  */
42
42
  public getApiV1MerchantsBusiness({
43
- businessId,
43
+ spaceId,
44
44
  }: {
45
45
  /**
46
46
  * ID del negocio en jogo-backend
47
47
  */
48
- businessId: string,
48
+ spaceId: string,
49
49
  }): CancelablePromise<Merchant> {
50
50
  return this.httpRequest.request({
51
51
  method: 'GET',
52
- url: '/api/v1/merchants/business/{businessId}',
52
+ url: '/api/v1/merchants/business/{spaceId}',
53
53
  path: {
54
- 'businessId': businessId,
54
+ 'spaceId': spaceId,
55
55
  },
56
56
  errors: {
57
57
  401: `Token JWT ausente o inválido`,
@@ -67,17 +67,17 @@ export class MerchantsService {
67
67
  * @throws ApiError
68
68
  */
69
69
  public putApiV1MerchantsBusiness({
70
- businessId,
70
+ spaceId,
71
71
  requestBody,
72
72
  }: {
73
- businessId: string,
73
+ spaceId: string,
74
74
  requestBody: UpdateMerchantRequest,
75
75
  }): CancelablePromise<Merchant> {
76
76
  return this.httpRequest.request({
77
77
  method: 'PUT',
78
- url: '/api/v1/merchants/business/{businessId}',
78
+ url: '/api/v1/merchants/business/{spaceId}',
79
79
  path: {
80
- 'businessId': businessId,
80
+ 'spaceId': spaceId,
81
81
  },
82
82
  body: requestBody,
83
83
  mediaType: 'application/json',
@@ -15,21 +15,21 @@ export class PackagesService {
15
15
  * @returns Package Paquete creado
16
16
  * @throws ApiError
17
17
  */
18
- public postApiV1MerchantsPackages({
19
- merchantId,
18
+ public postApiV1SpacesPackages({
19
+ spaceId,
20
20
  requestBody,
21
21
  }: {
22
22
  /**
23
- * ID del merchant en este servicio
23
+ * Space ID from jogo-backend
24
24
  */
25
- merchantId: string,
25
+ spaceId: string,
26
26
  requestBody: CreatePackageRequest,
27
27
  }): CancelablePromise<Package> {
28
28
  return this.httpRequest.request({
29
29
  method: 'POST',
30
- url: '/api/v1/merchants/{merchantId}/packages',
30
+ url: '/api/v1/spaces/{spaceId}/packages',
31
31
  path: {
32
- 'merchantId': merchantId,
32
+ 'spaceId': spaceId,
33
33
  },
34
34
  body: requestBody,
35
35
  mediaType: 'application/json',
@@ -45,11 +45,11 @@ export class PackagesService {
45
45
  * @returns Package Lista de paquetes
46
46
  * @throws ApiError
47
47
  */
48
- public getApiV1MerchantsPackages({
49
- merchantId,
48
+ public getApiV1SpacesPackages({
49
+ spaceId,
50
50
  all,
51
51
  }: {
52
- merchantId: string,
52
+ spaceId: string,
53
53
  /**
54
54
  * Si es `true`, incluye paquetes inactivos
55
55
  */
@@ -57,9 +57,9 @@ export class PackagesService {
57
57
  }): CancelablePromise<Array<Package>> {
58
58
  return this.httpRequest.request({
59
59
  method: 'GET',
60
- url: '/api/v1/merchants/{merchantId}/packages',
60
+ url: '/api/v1/spaces/{spaceId}/packages',
61
61
  path: {
62
- 'merchantId': merchantId,
62
+ 'spaceId': spaceId,
63
63
  },
64
64
  query: {
65
65
  'all': all,
@@ -71,18 +71,18 @@ export class PackagesService {
71
71
  * @returns Package Detalle del paquete
72
72
  * @throws ApiError
73
73
  */
74
- public getApiV1MerchantsPackages1({
75
- merchantId,
74
+ public getApiV1SpacesPackages1({
75
+ spaceId,
76
76
  id,
77
77
  }: {
78
- merchantId: string,
78
+ spaceId: string,
79
79
  id: string,
80
80
  }): CancelablePromise<Package> {
81
81
  return this.httpRequest.request({
82
82
  method: 'GET',
83
- url: '/api/v1/merchants/{merchantId}/packages/{id}',
83
+ url: '/api/v1/spaces/{spaceId}/packages/{id}',
84
84
  path: {
85
- 'merchantId': merchantId,
85
+ 'spaceId': spaceId,
86
86
  'id': id,
87
87
  },
88
88
  errors: {
@@ -95,20 +95,20 @@ export class PackagesService {
95
95
  * @returns Package Paquete actualizado
96
96
  * @throws ApiError
97
97
  */
98
- public putApiV1MerchantsPackages({
99
- merchantId,
98
+ public putApiV1SpacesPackages({
99
+ spaceId,
100
100
  id,
101
101
  requestBody,
102
102
  }: {
103
- merchantId: string,
103
+ spaceId: string,
104
104
  id: string,
105
105
  requestBody: UpdatePackageRequest,
106
106
  }): CancelablePromise<Package> {
107
107
  return this.httpRequest.request({
108
108
  method: 'PUT',
109
- url: '/api/v1/merchants/{merchantId}/packages/{id}',
109
+ url: '/api/v1/spaces/{spaceId}/packages/{id}',
110
110
  path: {
111
- 'merchantId': merchantId,
111
+ 'spaceId': spaceId,
112
112
  'id': id,
113
113
  },
114
114
  body: requestBody,
@@ -127,18 +127,18 @@ export class PackagesService {
127
127
  * @returns Package Paquete desactivado
128
128
  * @throws ApiError
129
129
  */
130
- public deleteApiV1MerchantsPackages({
131
- merchantId,
130
+ public deleteApiV1SpacesPackages({
131
+ spaceId,
132
132
  id,
133
133
  }: {
134
- merchantId: string,
134
+ spaceId: string,
135
135
  id: string,
136
136
  }): CancelablePromise<Package> {
137
137
  return this.httpRequest.request({
138
138
  method: 'DELETE',
139
- url: '/api/v1/merchants/{merchantId}/packages/{id}',
139
+ url: '/api/v1/spaces/{spaceId}/packages/{id}',
140
140
  path: {
141
- 'merchantId': merchantId,
141
+ 'spaceId': spaceId,
142
142
  'id': id,
143
143
  },
144
144
  errors: {
@@ -11,19 +11,19 @@ export class PaymentsService {
11
11
  * Webhook de notificación de Wompi
12
12
  * Endpoint que Wompi llama para notificar el resultado de una transacción. **No requiere autenticación** — es invocado directamente por Wompi.
13
13
  * Al recibir un pago completado (`APROBADA`), activa automáticamente la suscripción asociada.
14
- * Configurar esta URL en el `webhookUrl` del merchant: `POST https://tu-servidor.com/api/v1/webhooks/{merchantId}`
14
+ * Configurar esta URL en el `webhookUrl` del merchant: `POST https://tu-servidor.com/api/v1/webhooks/{spaceId}`
15
15
  *
16
16
  * @returns any Webhook recibido y procesado
17
17
  * @throws ApiError
18
18
  */
19
19
  public postApiV1Webhooks({
20
- merchantId,
20
+ spaceId,
21
21
  requestBody,
22
22
  }: {
23
23
  /**
24
- * ID del merchant en este servicio (no el businessId de jogo-backend)
24
+ * Space ID from jogo-backend
25
25
  */
26
- merchantId: string,
26
+ spaceId: string,
27
27
  requestBody: {
28
28
  /**
29
29
  * ID de la transacción en Wompi
@@ -41,9 +41,9 @@ export class PaymentsService {
41
41
  }> {
42
42
  return this.httpRequest.request({
43
43
  method: 'POST',
44
- url: '/api/v1/webhooks/{merchantId}',
44
+ url: '/api/v1/webhooks/{spaceId}',
45
45
  path: {
46
- 'merchantId': merchantId,
46
+ 'spaceId': spaceId,
47
47
  },
48
48
  body: requestBody,
49
49
  mediaType: 'application/json',