@djust-b2b/djust-front-sdk 2.13.0 → 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/lib/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const DjustSDK: {
|
|
|
20
20
|
getPaymentDetails({ details, }: import("./services/payment/definitions").GetPaymentDetailsRequest): Promise<import("./services/payment/definitions").GetPaymentDetailsResponse>;
|
|
21
21
|
getPaymentMethods({ reference, countryCode, referenceType, locale, }: import("./services/payment/definitions").GetPaymentMethodsRequest): Promise<import("./services/payment/definitions").GetPaymentMethodsResponse>;
|
|
22
22
|
deleteStoredPaymentMethodById({ storedPaymentMethodId, }: import("./services/payment/definitions").DeleteStoredPaymentMethodByIdRequest): Promise<void>;
|
|
23
|
+
precheckPurchaseCardL3({ reference, referenceType, }: import("./services/payment/definitions").PrecheckPurchaseCardL3Request): Promise<import("./services/payment/definitions").PrecheckPurchaseCardL3Response>;
|
|
23
24
|
getCustomFields(params: import("./services/custom-field/definitions").GetCustomFieldParameters): Promise<import("./services/custom-field/definitions").GetCustomFieldResponse>;
|
|
24
25
|
postMediaCustomField(params: import("./services/custom-field/definitions").PostMediaCustomFieldParameters): Promise<string>;
|
|
25
26
|
getMediaUrl(params: import("./services/custom-field/definitions").GetMediaUrlParameters): Promise<string>;
|
|
@@ -63,3 +63,16 @@ export interface GetPaymentMethodsResponse {
|
|
|
63
63
|
export interface DeleteStoredPaymentMethodByIdRequest {
|
|
64
64
|
storedPaymentMethodId: string;
|
|
65
65
|
}
|
|
66
|
+
export interface PrecheckPurchaseCardL3Request {
|
|
67
|
+
reference: string;
|
|
68
|
+
referenceType?: PaymentReferenceType;
|
|
69
|
+
}
|
|
70
|
+
export interface PrecheckPurchaseCardL3Response {
|
|
71
|
+
ready: boolean;
|
|
72
|
+
missingFields?: {
|
|
73
|
+
scope: string;
|
|
74
|
+
field: string;
|
|
75
|
+
path: string;
|
|
76
|
+
source: string;
|
|
77
|
+
}[];
|
|
78
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetPaymentDetailsRequest, GetPaymentDetailsResponse, DeleteStoredPaymentMethodByIdRequest, GetPaymentMethodsRequest, GetPaymentMethodsResponse, InitPaymentRequest, InitPaymentResponse } from "./definitions";
|
|
1
|
+
import { GetPaymentDetailsRequest, GetPaymentDetailsResponse, DeleteStoredPaymentMethodByIdRequest, GetPaymentMethodsRequest, GetPaymentMethodsResponse, InitPaymentRequest, InitPaymentResponse, PrecheckPurchaseCardL3Request, PrecheckPurchaseCardL3Response } from "./definitions";
|
|
2
2
|
/**
|
|
3
3
|
* 💳 Initializes a payment transaction.
|
|
4
4
|
*
|
|
@@ -126,3 +126,24 @@ export declare function getPaymentMethods({ reference, countryCode, referenceTyp
|
|
|
126
126
|
* @returns {Promise<void>} A promise resolving when the stored payment method is successfully deleted
|
|
127
127
|
*/
|
|
128
128
|
export declare function deleteStoredPaymentMethodById({ storedPaymentMethodId, }: DeleteStoredPaymentMethodByIdRequest): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* 💳 Prechecks a purchase card L3.
|
|
131
|
+
*
|
|
132
|
+
* This endpoint prechecks a purchase card L3.
|
|
133
|
+
* The `reference` parameter is mandatory and validated before the request is executed.
|
|
134
|
+
*
|
|
135
|
+
* 🛠 **Endpoint**: `GET /v1/shop/payments/precheck` [PAY-502]
|
|
136
|
+
*
|
|
137
|
+
* | Parameter | Type | Required | Description |
|
|
138
|
+
* |----------------|----------|----------|------------------------------------------------|
|
|
139
|
+
* | `reference` | `string` | ✅ | The payment reference identifier. |
|
|
140
|
+
* | `referenceType`| `string` | ❌ | The type of reference. |
|
|
141
|
+
*
|
|
142
|
+
* 📤 **Returns**:
|
|
143
|
+
* A `Promise` resolving to a `PrecheckPurchaseCardL3Response` containing the result of the precheck.
|
|
144
|
+
*
|
|
145
|
+
* @param {PrecheckPurchaseCardL3Request} params - The parameters for the precheck
|
|
146
|
+
* @throws {Error} If `reference` is missing
|
|
147
|
+
* @returns {Promise<PrecheckPurchaseCardL3Response>} A promise resolving to the response containing the result of the precheck
|
|
148
|
+
*/
|
|
149
|
+
export declare function precheckPurchaseCardL3({ reference, referenceType, }: PrecheckPurchaseCardL3Request): Promise<PrecheckPurchaseCardL3Response>;
|
|
@@ -4,6 +4,7 @@ exports.initPayment = initPayment;
|
|
|
4
4
|
exports.getPaymentDetails = getPaymentDetails;
|
|
5
5
|
exports.getPaymentMethods = getPaymentMethods;
|
|
6
6
|
exports.deleteStoredPaymentMethodById = deleteStoredPaymentMethodById;
|
|
7
|
+
exports.precheckPurchaseCardL3 = precheckPurchaseCardL3;
|
|
7
8
|
const parameters_validation_1 = require("../../helpers/parameters-validation");
|
|
8
9
|
const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
9
10
|
/**
|
|
@@ -184,3 +185,35 @@ async function deleteStoredPaymentMethodById({ storedPaymentMethodId, }) {
|
|
|
184
185
|
path: `/v1/shop/payments/stored-payment-methods/${storedPaymentMethodId}`,
|
|
185
186
|
});
|
|
186
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* 💳 Prechecks a purchase card L3.
|
|
190
|
+
*
|
|
191
|
+
* This endpoint prechecks a purchase card L3.
|
|
192
|
+
* The `reference` parameter is mandatory and validated before the request is executed.
|
|
193
|
+
*
|
|
194
|
+
* 🛠 **Endpoint**: `GET /v1/shop/payments/precheck` [PAY-502]
|
|
195
|
+
*
|
|
196
|
+
* | Parameter | Type | Required | Description |
|
|
197
|
+
* |----------------|----------|----------|------------------------------------------------|
|
|
198
|
+
* | `reference` | `string` | ✅ | The payment reference identifier. |
|
|
199
|
+
* | `referenceType`| `string` | ❌ | The type of reference. |
|
|
200
|
+
*
|
|
201
|
+
* 📤 **Returns**:
|
|
202
|
+
* A `Promise` resolving to a `PrecheckPurchaseCardL3Response` containing the result of the precheck.
|
|
203
|
+
*
|
|
204
|
+
* @param {PrecheckPurchaseCardL3Request} params - The parameters for the precheck
|
|
205
|
+
* @throws {Error} If `reference` is missing
|
|
206
|
+
* @returns {Promise<PrecheckPurchaseCardL3Response>} A promise resolving to the response containing the result of the precheck
|
|
207
|
+
*/
|
|
208
|
+
async function precheckPurchaseCardL3({ reference, referenceType, }) {
|
|
209
|
+
(0, parameters_validation_1.required)({ reference });
|
|
210
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
211
|
+
method: "GET",
|
|
212
|
+
path: `/v1/shop/payments/precheck`,
|
|
213
|
+
params: {
|
|
214
|
+
reference,
|
|
215
|
+
referenceType,
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
return data;
|
|
219
|
+
}
|