redsys-easy 5.2.1 → 5.2.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.
- package/lib/formatters/types.d.ts +11 -11
- package/lib/index.esm.js +13 -13
- package/lib/index.js +13 -13
- package/lib/types/input-params.d.ts +1 -1
- package/package.json +1 -1
|
@@ -98,17 +98,6 @@ export interface BaseFormatterInput<RawInputParams extends Partial<BaseInputPara
|
|
|
98
98
|
* @see {@link RestTrataPeticionInputParams.DS_MERCHANT_TITULAR}
|
|
99
99
|
*/
|
|
100
100
|
cardHolder?: string | undefined;
|
|
101
|
-
/**
|
|
102
|
-
* @see {@link RestTrataPeticionInputParams}
|
|
103
|
-
*/
|
|
104
|
-
raw?: RawInputParams | undefined;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Input parameters for the redirect input formatter
|
|
108
|
-
*
|
|
109
|
-
* @public
|
|
110
|
-
*/
|
|
111
|
-
export interface RedirectFormatterInput<RawInputParams extends Partial<RedirectInputParams>> extends BaseFormatterInput<RawInputParams> {
|
|
112
101
|
/**
|
|
113
102
|
* @see {@link RedirectInputParams.DS_MERCHANT_MERCHANTURL}
|
|
114
103
|
*/
|
|
@@ -129,6 +118,17 @@ export interface RedirectFormatterInput<RawInputParams extends Partial<RedirectI
|
|
|
129
118
|
* @see {@link RedirectInputParams.DS_MERCHANT_CONSUMERLANGUAGE}
|
|
130
119
|
*/
|
|
131
120
|
lang?: Language | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* @see {@link RestTrataPeticionInputParams}
|
|
123
|
+
*/
|
|
124
|
+
raw?: RawInputParams | undefined;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Input parameters for the redirect input formatter
|
|
128
|
+
*
|
|
129
|
+
* @public
|
|
130
|
+
*/
|
|
131
|
+
export interface RedirectFormatterInput<RawInputParams extends Partial<RedirectInputParams>> extends BaseFormatterInput<RawInputParams> {
|
|
132
132
|
}
|
|
133
133
|
export interface RequestFormatterInput<RawInputParams extends Partial<RequestInputParams>> extends BaseFormatterInput<RawInputParams> {
|
|
134
134
|
/**
|
package/lib/index.esm.js
CHANGED
|
@@ -3214,7 +3214,7 @@ const formatLang$1 = (value) => {
|
|
|
3214
3214
|
return langInt;
|
|
3215
3215
|
};
|
|
3216
3216
|
const baseInputFormatter = (input) => {
|
|
3217
|
-
const { order, merchantCode, transactionType, terminal, amount, currency, merchantName, identifier, group, expiryYear, expiryMonth, pan, cvv, directPayment, merchantData, operationId, productDescription, taxReference, transactionDate, cardHolder, raw, ...unknownInput } = input;
|
|
3217
|
+
const { order, merchantCode, transactionType, terminal, amount, currency, merchantName, identifier, group, expiryYear, expiryMonth, pan, cvv, directPayment, merchantData, operationId, productDescription, taxReference, transactionDate, cardHolder, merchantURL, successURL, errorURL, payMethods, lang, raw, ...unknownInput } = input;
|
|
3218
3218
|
const unknownKeys = Object.keys(unknownInput);
|
|
3219
3219
|
if (unknownKeys.length > 0) {
|
|
3220
3220
|
throw new ValidationError([
|
|
@@ -3268,18 +3268,6 @@ const baseInputFormatter = (input) => {
|
|
|
3268
3268
|
...(isStringNotEmpty(cardHolder)
|
|
3269
3269
|
? { DS_MERCHANT_TITULAR: cardHolder }
|
|
3270
3270
|
: undefined),
|
|
3271
|
-
...raw
|
|
3272
|
-
};
|
|
3273
|
-
};
|
|
3274
|
-
/**
|
|
3275
|
-
* Redirection input formatter
|
|
3276
|
-
*
|
|
3277
|
-
* @public
|
|
3278
|
-
*/
|
|
3279
|
-
const redirectInputFormatter = (input) => {
|
|
3280
|
-
const { merchantURL, successURL, errorURL, payMethods, lang, ...baseInput } = input;
|
|
3281
|
-
return {
|
|
3282
|
-
...baseInputFormatter(baseInput),
|
|
3283
3271
|
...(isStringNotEmpty(merchantURL)
|
|
3284
3272
|
? { DS_MERCHANT_MERCHANTURL: merchantURL }
|
|
3285
3273
|
: undefined),
|
|
@@ -3295,6 +3283,18 @@ const redirectInputFormatter = (input) => {
|
|
|
3295
3283
|
...(isStringNotEmpty(lang)
|
|
3296
3284
|
? { DS_MERCHANT_CONSUMERLANGUAGE: formatLang$1(lang) }
|
|
3297
3285
|
: undefined),
|
|
3286
|
+
...raw
|
|
3287
|
+
};
|
|
3288
|
+
};
|
|
3289
|
+
/**
|
|
3290
|
+
* Redirection input formatter
|
|
3291
|
+
*
|
|
3292
|
+
* @public
|
|
3293
|
+
*/
|
|
3294
|
+
const redirectInputFormatter = (input) => {
|
|
3295
|
+
const { ...baseInput } = input;
|
|
3296
|
+
return {
|
|
3297
|
+
...baseInputFormatter(baseInput),
|
|
3298
3298
|
// Overwrite formatted parameters
|
|
3299
3299
|
...baseInput.raw
|
|
3300
3300
|
};
|
package/lib/index.js
CHANGED
|
@@ -3216,7 +3216,7 @@ const formatLang$1 = (value) => {
|
|
|
3216
3216
|
return langInt;
|
|
3217
3217
|
};
|
|
3218
3218
|
const baseInputFormatter = (input) => {
|
|
3219
|
-
const { order, merchantCode, transactionType, terminal, amount, currency, merchantName, identifier, group, expiryYear, expiryMonth, pan, cvv, directPayment, merchantData, operationId, productDescription, taxReference, transactionDate, cardHolder, raw, ...unknownInput } = input;
|
|
3219
|
+
const { order, merchantCode, transactionType, terminal, amount, currency, merchantName, identifier, group, expiryYear, expiryMonth, pan, cvv, directPayment, merchantData, operationId, productDescription, taxReference, transactionDate, cardHolder, merchantURL, successURL, errorURL, payMethods, lang, raw, ...unknownInput } = input;
|
|
3220
3220
|
const unknownKeys = Object.keys(unknownInput);
|
|
3221
3221
|
if (unknownKeys.length > 0) {
|
|
3222
3222
|
throw new ValidationError([
|
|
@@ -3270,18 +3270,6 @@ const baseInputFormatter = (input) => {
|
|
|
3270
3270
|
...(isStringNotEmpty(cardHolder)
|
|
3271
3271
|
? { DS_MERCHANT_TITULAR: cardHolder }
|
|
3272
3272
|
: undefined),
|
|
3273
|
-
...raw
|
|
3274
|
-
};
|
|
3275
|
-
};
|
|
3276
|
-
/**
|
|
3277
|
-
* Redirection input formatter
|
|
3278
|
-
*
|
|
3279
|
-
* @public
|
|
3280
|
-
*/
|
|
3281
|
-
const redirectInputFormatter = (input) => {
|
|
3282
|
-
const { merchantURL, successURL, errorURL, payMethods, lang, ...baseInput } = input;
|
|
3283
|
-
return {
|
|
3284
|
-
...baseInputFormatter(baseInput),
|
|
3285
3273
|
...(isStringNotEmpty(merchantURL)
|
|
3286
3274
|
? { DS_MERCHANT_MERCHANTURL: merchantURL }
|
|
3287
3275
|
: undefined),
|
|
@@ -3297,6 +3285,18 @@ const redirectInputFormatter = (input) => {
|
|
|
3297
3285
|
...(isStringNotEmpty(lang)
|
|
3298
3286
|
? { DS_MERCHANT_CONSUMERLANGUAGE: formatLang$1(lang) }
|
|
3299
3287
|
: undefined),
|
|
3288
|
+
...raw
|
|
3289
|
+
};
|
|
3290
|
+
};
|
|
3291
|
+
/**
|
|
3292
|
+
* Redirection input formatter
|
|
3293
|
+
*
|
|
3294
|
+
* @public
|
|
3295
|
+
*/
|
|
3296
|
+
const redirectInputFormatter = (input) => {
|
|
3297
|
+
const { ...baseInput } = input;
|
|
3298
|
+
return {
|
|
3299
|
+
...baseInputFormatter(baseInput),
|
|
3300
3300
|
// Overwrite formatted parameters
|
|
3301
3301
|
...baseInput.raw
|
|
3302
3302
|
};
|
|
@@ -90,7 +90,7 @@ export interface RedirectInputParams extends BaseInputParams {
|
|
|
90
90
|
*
|
|
91
91
|
* @public
|
|
92
92
|
*/
|
|
93
|
-
export interface RequestInputParams extends BaseInputParams {
|
|
93
|
+
export interface RequestInputParams extends BaseInputParams, Pick<RedirectInputParams, 'DS_MERCHANT_MERCHANTURL' | 'DS_MERCHANT_URLOK' | 'DS_MERCHANT_URLKO' | 'DS_MERCHANT_CONSUMERLANGUAGE' | 'DS_MERCHANT_PAYMETHODS' | 'DS_MERCHANT_PERSOCODE' | 'DS_MERCHANT_SHIPPINGADDRESSPYP'> {
|
|
94
94
|
/** xPay data, hex */
|
|
95
95
|
DS_XPAYDATA?: string | undefined;
|
|
96
96
|
/** xPay origin */
|