redsys-easy 4.0.3 → 5.1.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/assets/card-brands.d.ts +28 -28
- package/lib/assets/countries.d.ts +31 -31
- package/lib/assets/currencies.d.ts +36 -36
- package/lib/assets/error-codes.d.ts +17 -17
- package/lib/assets/lang-codes.d.ts +31 -31
- package/lib/assets/response-codes.d.ts +2 -2
- package/lib/assets/transaction-types.d.ts +56 -56
- package/lib/client.d.ts +102 -50
- package/lib/crypto.d.ts +25 -25
- package/lib/errors.d.ts +75 -75
- package/lib/formatter-utils.d.ts +24 -24
- package/lib/formatters/input-params.d.ts +21 -21
- package/lib/formatters/output-params.d.ts +29 -29
- package/lib/formatters/types.d.ts +316 -316
- package/lib/index.d.ts +30 -30
- package/lib/index.esm.js +3429 -1985
- package/lib/index.js +3429 -1996
- package/lib/rest/3ds.d.ts +31 -31
- package/lib/rest/json-serialization.d.ts +2 -2
- package/lib/rest/json-sha256-signature.d.ts +3 -3
- package/lib/rest/json.d.ts +3 -3
- package/lib/rest/requests.d.ts +8 -2
- package/lib/soap/notification-serialization.d.ts +3 -3
- package/lib/soap/notification-signature.d.ts +3 -3
- package/lib/soap/notification.d.ts +4 -4
- package/lib/soap/utils.d.ts +43 -43
- package/lib/types/3ds-params.d.ts +345 -345
- package/lib/types/api.d.ts +80 -80
- package/lib/types/input-params.d.ts +176 -176
- package/lib/types/output-params.d.ts +158 -158
- package/lib/utils/codes.d.ts +13 -13
- package/lib/utils/misc.d.ts +30 -24
- package/package.json +40 -41
package/lib/rest/3ds.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type { ThreeDSv1ChallengeOutputParams, ThreeDSv2ChallengeOutputParams, ThreeDSv2PreAuthWithMethodOutputParams, ThreeDSMethodData, ThreeDSMethodForm, ThreeDSv1ChallengeForm, ThreeDSv2ChallengeForm, ThreeDSCres } from '../types/3ds-params';
|
|
2
|
-
/**
|
|
3
|
-
* Creates parameters for a 3DS method form
|
|
4
|
-
*
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export declare const create3DSMethodForm: (emv3dsParams: Pick<ThreeDSv2PreAuthWithMethodOutputParams, 'threeDSServerTransID' | 'threeDSMethodURL'>, notificationURL: string) => ThreeDSMethodForm;
|
|
8
|
-
/**
|
|
9
|
-
* Creates parameters for a 3DS v1 challenge form
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare const create3DSv1ChallengeForm: (emv3dsV1Challenge: ThreeDSv1ChallengeOutputParams, challengeNotificationUrl: string) => ThreeDSv1ChallengeForm;
|
|
14
|
-
/**
|
|
15
|
-
* Creates parameters for a 3DS v2 challenge form
|
|
16
|
-
*
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export declare const create3DSv2ChallengeForm: (emv3dsV2Challenge: ThreeDSv2ChallengeOutputParams) => ThreeDSv2ChallengeForm;
|
|
20
|
-
/**
|
|
21
|
-
* Deserialize threeDSMethodData
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
export declare const deserializeThreeDSMethodData: (threeDSMethodData: string) => ThreeDSMethodData;
|
|
26
|
-
/**
|
|
27
|
-
* Deserialize `cres` field of a 3DS v2 challenge
|
|
28
|
-
*
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
31
|
-
export declare const deserializeCres: (cres: string) => ThreeDSCres;
|
|
1
|
+
import type { ThreeDSv1ChallengeOutputParams, ThreeDSv2ChallengeOutputParams, ThreeDSv2PreAuthWithMethodOutputParams, ThreeDSMethodData, ThreeDSMethodForm, ThreeDSv1ChallengeForm, ThreeDSv2ChallengeForm, ThreeDSCres } from '../types/3ds-params';
|
|
2
|
+
/**
|
|
3
|
+
* Creates parameters for a 3DS method form
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare const create3DSMethodForm: (emv3dsParams: Pick<ThreeDSv2PreAuthWithMethodOutputParams, 'threeDSServerTransID' | 'threeDSMethodURL'>, notificationURL: string) => ThreeDSMethodForm;
|
|
8
|
+
/**
|
|
9
|
+
* Creates parameters for a 3DS v1 challenge form
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export declare const create3DSv1ChallengeForm: (emv3dsV1Challenge: ThreeDSv1ChallengeOutputParams, challengeNotificationUrl: string) => ThreeDSv1ChallengeForm;
|
|
14
|
+
/**
|
|
15
|
+
* Creates parameters for a 3DS v2 challenge form
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export declare const create3DSv2ChallengeForm: (emv3dsV2Challenge: ThreeDSv2ChallengeOutputParams) => ThreeDSv2ChallengeForm;
|
|
20
|
+
/**
|
|
21
|
+
* Deserialize threeDSMethodData
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare const deserializeThreeDSMethodData: (threeDSMethodData: string) => ThreeDSMethodData;
|
|
26
|
+
/**
|
|
27
|
+
* Deserialize `cres` field of a 3DS v2 challenge
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export declare const deserializeCres: (cres: string) => ThreeDSCres;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const deserializeJSONMerchantParams: <DeserializedResponseParams = unknown>(strPayload: string) => DeserializedResponseParams;
|
|
2
|
-
export declare const serializeJSONMerchantParams: (requestParams: unknown) => string;
|
|
1
|
+
export declare const deserializeJSONMerchantParams: <DeserializedResponseParams = unknown>(strPayload: string) => DeserializedResponseParams;
|
|
2
|
+
export declare const serializeJSONMerchantParams: (requestParams: unknown) => string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ResponseJSONSuccess, CommonRawRequestParams, CommonRawResponseParams, SHA256SignedJSONParameters } from '../types/api';
|
|
2
|
-
export declare const sha256VerifyJSONResponse: (merchantKey: string, response: ResponseJSONSuccess, responseParams: CommonRawResponseParams) => void;
|
|
3
|
-
export declare const sha256SignJSONRequest: (merchantKey: string, serializedParams: string, requestParams: CommonRawRequestParams) => SHA256SignedJSONParameters;
|
|
1
|
+
import type { ResponseJSONSuccess, CommonRawRequestParams, CommonRawResponseParams, SHA256SignedJSONParameters } from '../types/api';
|
|
2
|
+
export declare const sha256VerifyJSONResponse: (merchantKey: string, response: ResponseJSONSuccess, responseParams: CommonRawResponseParams) => void;
|
|
3
|
+
export declare const sha256SignJSONRequest: (merchantKey: string, serializedParams: string, requestParams: CommonRawRequestParams) => SHA256SignedJSONParameters;
|
package/lib/rest/json.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ResponseJSONSuccess, CommonRawRequestParams, CommonRawResponseParams, SHA256SignedJSONParameters } from '../types/api';
|
|
2
|
-
export declare const deserializeAndVerifyJSONResponse: <ResponseParams extends CommonRawResponseParams>(merchantKey: string, response: ResponseJSONSuccess) => ResponseParams;
|
|
3
|
-
export declare const serializeAndSignJSONRequest: <RequestParams extends CommonRawRequestParams>(merchantKey: string, requestParams: RequestParams) => SHA256SignedJSONParameters;
|
|
1
|
+
import type { ResponseJSONSuccess, CommonRawRequestParams, CommonRawResponseParams, SHA256SignedJSONParameters } from '../types/api';
|
|
2
|
+
export declare const deserializeAndVerifyJSONResponse: <ResponseParams extends CommonRawResponseParams>(merchantKey: string, response: ResponseJSONSuccess) => ResponseParams;
|
|
3
|
+
export declare const serializeAndSignJSONRequest: <RequestParams extends CommonRawRequestParams>(merchantKey: string, requestParams: RequestParams) => SHA256SignedJSONParameters;
|
package/lib/rest/requests.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { fetch as Fetch } from 'undici';
|
|
2
|
+
import type { CommonRawRequestParams, CommonRawResponseParams } from '../types/api';
|
|
3
|
+
export declare const jsonRequest: <RequestParams extends CommonRawRequestParams, ResponseParams extends CommonRawResponseParams>({ fetch, url, merchantKey, rawRequestParams }: {
|
|
4
|
+
fetch: typeof Fetch;
|
|
5
|
+
url: string;
|
|
6
|
+
merchantKey: string;
|
|
7
|
+
rawRequestParams: RequestParams;
|
|
8
|
+
}) => Promise<ResponseParams>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ParsedSoapNotifiation, SoapNotificationResponse } from '../types/api';
|
|
2
|
-
export declare const serializeSoapNotificationResponse: ({ allow: allowOperation }: SoapNotificationResponse) => string;
|
|
3
|
-
export declare const deserializeSoapNotification: (xml: string) => ParsedSoapNotifiation['Message'];
|
|
1
|
+
import type { ParsedSoapNotifiation, SoapNotificationResponse } from '../types/api';
|
|
2
|
+
export declare const serializeSoapNotificationResponse: ({ allow: allowOperation }: SoapNotificationResponse) => string;
|
|
3
|
+
export declare const deserializeSoapNotification: (xml: string) => ParsedSoapNotifiation['Message'];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ParsedSoapNotifiation, SoapNotificationResponse } from '../types/api';
|
|
2
|
-
export declare const verifySoapNotification: (merchantKey: string, xml: string, msg: ParsedSoapNotifiation['Message']) => void;
|
|
3
|
-
export declare const signSoapNotificationResponse: (merchantKey: string, serializedResponse: string, response: SoapNotificationResponse) => string;
|
|
1
|
+
import type { ParsedSoapNotifiation, SoapNotificationResponse } from '../types/api';
|
|
2
|
+
export declare const verifySoapNotification: (merchantKey: string, xml: string, msg: ParsedSoapNotifiation['Message']) => void;
|
|
3
|
+
export declare const signSoapNotificationResponse: (merchantKey: string, serializedResponse: string, response: SoapNotificationResponse) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SoapNotificationResponse } from '../types/api';
|
|
2
|
-
import type { SoapNotificationOutputParams } from '../types/output-params';
|
|
3
|
-
export declare const serializeAndSignSoapNotificationResponse: (merchantKey: string, response: SoapNotificationResponse) => string;
|
|
4
|
-
export declare const deserializeAndVerifySoapNotification: (merchantKey: string, xml: string) => SoapNotificationOutputParams;
|
|
1
|
+
import type { SoapNotificationResponse } from '../types/api';
|
|
2
|
+
import type { SoapNotificationOutputParams } from '../types/output-params';
|
|
3
|
+
export declare const serializeAndSignSoapNotificationResponse: (merchantKey: string, response: SoapNotificationResponse) => string;
|
|
4
|
+
export declare const deserializeAndVerifySoapNotification: (merchantKey: string, xml: string) => SoapNotificationOutputParams;
|
package/lib/soap/utils.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
export declare const unescapeXML: (str: string) => string;
|
|
2
|
-
export declare const escapeXML: (str: string) => string;
|
|
3
|
-
|
|
4
|
-
headers: Record<string, string>;
|
|
5
|
-
body?: string;
|
|
6
|
-
} | {
|
|
7
|
-
headers?: Record<string, string
|
|
8
|
-
body: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Detects the soap version of a HTTP request
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export declare const detectSoapVersion: (req: SoapRequest) => "1.2" | "1.1";
|
|
16
|
-
/**
|
|
17
|
-
* Extracts the body of a SOAP notification from the body of the HTTP request
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* It does not understand SOAP or use WSDL, the implementation is a little bit hacky
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export declare const mimicSoapNotificationReceiver: (xml: string) => string;
|
|
25
|
-
/**
|
|
26
|
-
* Creates the body of a HTTP response as SOAP 1.1 from the body of a SOAP notification response
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
* It does not understand SOAP or use WSDL, the implementation is a little bit hacky
|
|
30
|
-
*
|
|
31
|
-
* @public
|
|
32
|
-
*/
|
|
33
|
-
export declare const mimicSoap11NotificationResponse: (answer: string) => string;
|
|
34
|
-
/**
|
|
35
|
-
* Creates the body of a HTTP response as SOAP 1.2 from the body of a SOAP notification response
|
|
36
|
-
*
|
|
37
|
-
* @remarks
|
|
38
|
-
* It does not understand SOAP or use WSDL, the implementation is a little bit hacky
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
*/
|
|
42
|
-
export declare const mimicSoap12NotificationResponse: (answer: string) => string;
|
|
43
|
-
export {};
|
|
1
|
+
export declare const unescapeXML: (str: string) => string;
|
|
2
|
+
export declare const escapeXML: (str: string) => string;
|
|
3
|
+
type SoapRequest = {
|
|
4
|
+
headers: Record<string, string>;
|
|
5
|
+
body?: string | undefined;
|
|
6
|
+
} | {
|
|
7
|
+
headers?: Record<string, string> | undefined;
|
|
8
|
+
body: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Detects the soap version of a HTTP request
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare const detectSoapVersion: (req: SoapRequest) => "1.2" | "1.1";
|
|
16
|
+
/**
|
|
17
|
+
* Extracts the body of a SOAP notification from the body of the HTTP request
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* It does not understand SOAP or use WSDL, the implementation is a little bit hacky
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare const mimicSoapNotificationReceiver: (xml: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Creates the body of a HTTP response as SOAP 1.1 from the body of a SOAP notification response
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* It does not understand SOAP or use WSDL, the implementation is a little bit hacky
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export declare const mimicSoap11NotificationResponse: (answer: string) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Creates the body of a HTTP response as SOAP 1.2 from the body of a SOAP notification response
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* It does not understand SOAP or use WSDL, the implementation is a little bit hacky
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare const mimicSoap12NotificationResponse: (answer: string) => string;
|
|
43
|
+
export {};
|