@bcc-code/payment-client 1.0.6 → 1.0.8

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/dist/index.d.mts CHANGED
@@ -1,3 +1,13 @@
1
+ /** Company details required for Tripletex invoice creation. */
2
+ interface InvoiceRecipientRequest {
3
+ companyName: string;
4
+ address: string;
5
+ postalCode: string;
6
+ city: string;
7
+ country: string;
8
+ vatNumber: string;
9
+ email: string;
10
+ }
1
11
  interface CreatePaymentRequest {
2
12
  payerId?: string;
3
13
  amount: number;
@@ -6,9 +16,13 @@ interface CreatePaymentRequest {
6
16
  paymentMethodType: string;
7
17
  merchantReference?: string;
8
18
  returnUrl: string;
9
- paymentMethodDetails?: Record<string, any>;
19
+ paymentMethodDetails?: Record<string, unknown>;
10
20
  person?: PersonInfoRequest;
11
21
  lineItems?: LineItemRequest[];
22
+ /** Whether to create a Tripletex invoice when payment succeeds. */
23
+ invoiceRequested?: boolean;
24
+ /** Required when invoiceRequested is true. */
25
+ invoiceRecipient?: InvoiceRecipientRequest;
12
26
  }
13
27
  interface PersonInfoRequest {
14
28
  payerUid: string;
@@ -49,6 +63,8 @@ interface PaymentResponse {
49
63
  createdAt: string;
50
64
  updatedAt: string;
51
65
  lineItems?: LineItemResponse[];
66
+ invoiceRequested?: boolean;
67
+ tripletexInvoiceId?: string | null;
52
68
  }
53
69
  interface LineItemResponse {
54
70
  id: string;
@@ -87,6 +103,9 @@ interface PaymentReceiptResponse {
87
103
  taxAmount?: number;
88
104
  discountAmount?: number;
89
105
  amountFormatted?: string;
106
+ productName?: string;
107
+ invoiceRequested?: boolean;
108
+ tripletexInvoiceId?: string | null;
90
109
  }
91
110
  interface PaymentSucceededNotification {
92
111
  paymentId: string;
@@ -139,4 +158,4 @@ interface AdyenPaymentProps {
139
158
  onCancel?: () => void;
140
159
  }
141
160
 
142
- export { type AdyenPaymentProps, type CreatePaymentRequest, type CreatePaymentResponse, type LineItemRequest, type LineItemResponse, PaymentClient, type PaymentClientOptions, type PaymentReceiptResponse, type PaymentResponse, type PaymentSucceededNotification, type PersonInfoRequest, type StripePaymentProps };
161
+ export { type AdyenPaymentProps, type CreatePaymentRequest, type CreatePaymentResponse, type InvoiceRecipientRequest, type LineItemRequest, type LineItemResponse, PaymentClient, type PaymentClientOptions, type PaymentReceiptResponse, type PaymentResponse, type PaymentSucceededNotification, type PersonInfoRequest, type StripePaymentProps };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,13 @@
1
+ /** Company details required for Tripletex invoice creation. */
2
+ interface InvoiceRecipientRequest {
3
+ companyName: string;
4
+ address: string;
5
+ postalCode: string;
6
+ city: string;
7
+ country: string;
8
+ vatNumber: string;
9
+ email: string;
10
+ }
1
11
  interface CreatePaymentRequest {
2
12
  payerId?: string;
3
13
  amount: number;
@@ -6,9 +16,13 @@ interface CreatePaymentRequest {
6
16
  paymentMethodType: string;
7
17
  merchantReference?: string;
8
18
  returnUrl: string;
9
- paymentMethodDetails?: Record<string, any>;
19
+ paymentMethodDetails?: Record<string, unknown>;
10
20
  person?: PersonInfoRequest;
11
21
  lineItems?: LineItemRequest[];
22
+ /** Whether to create a Tripletex invoice when payment succeeds. */
23
+ invoiceRequested?: boolean;
24
+ /** Required when invoiceRequested is true. */
25
+ invoiceRecipient?: InvoiceRecipientRequest;
12
26
  }
13
27
  interface PersonInfoRequest {
14
28
  payerUid: string;
@@ -49,6 +63,8 @@ interface PaymentResponse {
49
63
  createdAt: string;
50
64
  updatedAt: string;
51
65
  lineItems?: LineItemResponse[];
66
+ invoiceRequested?: boolean;
67
+ tripletexInvoiceId?: string | null;
52
68
  }
53
69
  interface LineItemResponse {
54
70
  id: string;
@@ -87,6 +103,9 @@ interface PaymentReceiptResponse {
87
103
  taxAmount?: number;
88
104
  discountAmount?: number;
89
105
  amountFormatted?: string;
106
+ productName?: string;
107
+ invoiceRequested?: boolean;
108
+ tripletexInvoiceId?: string | null;
90
109
  }
91
110
  interface PaymentSucceededNotification {
92
111
  paymentId: string;
@@ -139,4 +158,4 @@ interface AdyenPaymentProps {
139
158
  onCancel?: () => void;
140
159
  }
141
160
 
142
- export { type AdyenPaymentProps, type CreatePaymentRequest, type CreatePaymentResponse, type LineItemRequest, type LineItemResponse, PaymentClient, type PaymentClientOptions, type PaymentReceiptResponse, type PaymentResponse, type PaymentSucceededNotification, type PersonInfoRequest, type StripePaymentProps };
161
+ export { type AdyenPaymentProps, type CreatePaymentRequest, type CreatePaymentResponse, type InvoiceRecipientRequest, type LineItemRequest, type LineItemResponse, PaymentClient, type PaymentClientOptions, type PaymentReceiptResponse, type PaymentResponse, type PaymentSucceededNotification, type PersonInfoRequest, type StripePaymentProps };
package/dist/index.js CHANGED
@@ -64,7 +64,8 @@ var PaymentClient = class {
64
64
  }
65
65
  const response = await fetch(`${this.baseUrl}/api/v1/payments/${paymentId}`, {
66
66
  headers: {
67
- "Authorization": `Bearer ${token}`
67
+ "Authorization": `Bearer ${token}`,
68
+ "X-Tenant-ID": this.tenantId
68
69
  },
69
70
  signal: controller.signal
70
71
  });
@@ -89,7 +90,8 @@ var PaymentClient = class {
89
90
  `${this.baseUrl}/api/v1/payments/${paymentId}/receipt`,
90
91
  {
91
92
  headers: {
92
- "Authorization": `Bearer ${token}`
93
+ "Authorization": `Bearer ${token}`,
94
+ "X-Tenant-ID": this.tenantId
93
95
  },
94
96
  signal: controller.signal
95
97
  }
@@ -115,7 +117,8 @@ var PaymentClient = class {
115
117
  `${this.baseUrl}/api/v1/payments/stats/total?prefix=${encodeURIComponent(prefix)}`,
116
118
  {
117
119
  headers: {
118
- "Authorization": `Bearer ${token}`
120
+ "Authorization": `Bearer ${token}`,
121
+ "X-Tenant-ID": this.tenantId
119
122
  },
120
123
  signal: controller.signal
121
124
  }
package/dist/index.mjs CHANGED
@@ -38,7 +38,8 @@ var PaymentClient = class {
38
38
  }
39
39
  const response = await fetch(`${this.baseUrl}/api/v1/payments/${paymentId}`, {
40
40
  headers: {
41
- "Authorization": `Bearer ${token}`
41
+ "Authorization": `Bearer ${token}`,
42
+ "X-Tenant-ID": this.tenantId
42
43
  },
43
44
  signal: controller.signal
44
45
  });
@@ -63,7 +64,8 @@ var PaymentClient = class {
63
64
  `${this.baseUrl}/api/v1/payments/${paymentId}/receipt`,
64
65
  {
65
66
  headers: {
66
- "Authorization": `Bearer ${token}`
67
+ "Authorization": `Bearer ${token}`,
68
+ "X-Tenant-ID": this.tenantId
67
69
  },
68
70
  signal: controller.signal
69
71
  }
@@ -89,7 +91,8 @@ var PaymentClient = class {
89
91
  `${this.baseUrl}/api/v1/payments/stats/total?prefix=${encodeURIComponent(prefix)}`,
90
92
  {
91
93
  headers: {
92
- "Authorization": `Bearer ${token}`
94
+ "Authorization": `Bearer ${token}`,
95
+ "X-Tenant-ID": this.tenantId
93
96
  },
94
97
  signal: controller.signal
95
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bcc-code/payment-client",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Client SDK for BCC Payment Orchestrator API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",