redsys-easy 4.0.3 → 5.0.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 +85 -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 +3363 -1985
- package/lib/index.js +3363 -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
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Card brand name
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export
|
|
7
|
-
/**
|
|
8
|
-
* Card brand number
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export
|
|
13
|
-
/**
|
|
14
|
-
* Card brand name to number
|
|
15
|
-
*
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
export declare const CARDBRANDS: Record<CardBrand, CardBrandNum>;
|
|
19
|
-
/**
|
|
20
|
-
* Card brand number to name
|
|
21
|
-
*
|
|
22
|
-
* @remarks
|
|
23
|
-
* @see {@link CARDBRANDS}
|
|
24
|
-
*
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
declare const REV_CARDBRANDS: Record<CardBrandNum, CardBrand>;
|
|
28
|
-
export { REV_CARDBRANDS };
|
|
1
|
+
/**
|
|
2
|
+
* Card brand name
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type CardBrand = 'VISA' | 'MASTERCARD' | 'DINERS' | 'PRIVATE' | 'AMEX' | 'JCB' | 'UPI';
|
|
7
|
+
/**
|
|
8
|
+
* Card brand number
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export type CardBrandNum = '1' | '2' | '6' | '7' | '8' | '9' | '22';
|
|
13
|
+
/**
|
|
14
|
+
* Card brand name to number
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export declare const CARDBRANDS: Record<CardBrand, CardBrandNum>;
|
|
19
|
+
/**
|
|
20
|
+
* Card brand number to name
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* @see {@link CARDBRANDS}
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
declare const REV_CARDBRANDS: Record<CardBrandNum, CardBrand>;
|
|
28
|
+
export { REV_CARDBRANDS };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Country ISO 3166 Alpha 2 code
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export
|
|
7
|
-
/**
|
|
8
|
-
* Country UN M49 number
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export
|
|
13
|
-
/**
|
|
14
|
-
* Maps ISO 3166 Alpha 2 codes to UN M49 numbers
|
|
15
|
-
*
|
|
16
|
-
* @remarks
|
|
17
|
-
* [UN M49 to ISO 3166 information](https://unstats.un.org/unsd/methodology/m49/)
|
|
18
|
-
*
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export declare const COUNTRIES: Record<Country, CountryNum>;
|
|
22
|
-
/**
|
|
23
|
-
* Maps UN M49 numbers to ISO 3166 Alpha 2 codes
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* @see {@link COUNTRIES}
|
|
27
|
-
*
|
|
28
|
-
* @public
|
|
29
|
-
*/
|
|
30
|
-
declare const REV_COUNTRIES: Record<CountryNum, Country>;
|
|
31
|
-
export { REV_COUNTRIES };
|
|
1
|
+
/**
|
|
2
|
+
* Country ISO 3166 Alpha 2 code
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type Country = 'af' | 'al' | 'aq' | 'dz' | 'as' | 'ad' | 'ao' | 'ag' | 'az' | 'ar' | 'au' | 'at' | 'bs' | 'bh' | 'bd' | 'am' | 'bb' | 'be' | 'bm' | 'bt' | 'bo' | 'ba' | 'bw' | 'bv' | 'br' | 'bz' | 'io' | 'sb' | 'vg' | 'bn' | 'bg' | 'mm' | 'bi' | 'by' | 'kh' | 'cm' | 'ca' | 'cv' | 'ky' | 'cf' | 'lk' | 'td' | 'cl' | 'cn' | 'tw' | 'cx' | 'cc' | 'co' | 'km' | 'yt' | 'cg' | 'cd' | 'ck' | 'cr' | 'hr' | 'cu' | 'cy' | 'cz' | 'bj' | 'dk' | 'dm' | 'do' | 'ec' | 'sv' | 'gq' | 'et' | 'er' | 'ee' | 'fo' | 'fk' | 'gs' | 'fj' | 'fi' | 'ax' | 'fr' | 'gf' | 'pf' | 'tf' | 'dj' | 'ga' | 'ge' | 'gm' | 'ps' | 'de' | 'gh' | 'gi' | 'ki' | 'gr' | 'gl' | 'gd' | 'gp' | 'gu' | 'gt' | 'gn' | 'gy' | 'ht' | 'hm' | 'va' | 'hn' | 'hk' | 'hu' | 'is' | 'in' | 'id' | 'ir' | 'iq' | 'ie' | 'il' | 'it' | 'ci' | 'jm' | 'jp' | 'kz' | 'jo' | 'ke' | 'kp' | 'kr' | 'kw' | 'kg' | 'la' | 'lb' | 'ls' | 'lv' | 'lr' | 'ly' | 'li' | 'lt' | 'lu' | 'mo' | 'mg' | 'mw' | 'my' | 'mv' | 'ml' | 'mt' | 'mq' | 'mr' | 'mu' | 'mx' | 'mc' | 'mn' | 'md' | 'me' | 'ms' | 'ma' | 'mz' | 'om' | 'na' | 'nr' | 'np' | 'nl' | 'cw' | 'aw' | 'sx' | 'bq' | 'nc' | 'vu' | 'nz' | 'ni' | 'ne' | 'ng' | 'nu' | 'nf' | 'no' | 'mp' | 'um' | 'fm' | 'mh' | 'pw' | 'pk' | 'pa' | 'pg' | 'py' | 'pe' | 'ph' | 'pn' | 'pl' | 'pt' | 'gw' | 'tl' | 'pr' | 'qa' | 're' | 'ro' | 'ru' | 'rw' | 'bl' | 'sh' | 'kn' | 'ai' | 'lc' | 'mf' | 'pm' | 'vc' | 'sm' | 'st' | 'sa' | 'sn' | 'rs' | 'sc' | 'sl' | 'sg' | 'sk' | 'vn' | 'si' | 'so' | 'za' | 'zw' | 'es' | 'ss' | 'sd' | 'eh' | 'sr' | 'sj' | 'sz' | 'se' | 'ch' | 'sy' | 'tj' | 'th' | 'tg' | 'tk' | 'to' | 'tt' | 'ae' | 'tn' | 'tr' | 'tm' | 'tc' | 'tv' | 'ug' | 'ua' | 'mk' | 'eg' | 'gb' | 'gg' | 'je' | 'im' | 'tz' | 'us' | 'vi' | 'bf' | 'uy' | 'uz' | 've' | 'wf' | 'ws' | 'ye' | 'zm';
|
|
7
|
+
/**
|
|
8
|
+
* Country UN M49 number
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export type CountryNum = '4' | '8' | '10' | '12' | '16' | '20' | '24' | '28' | '31' | '32' | '36' | '40' | '44' | '48' | '50' | '51' | '52' | '56' | '60' | '64' | '68' | '70' | '72' | '74' | '76' | '84' | '86' | '90' | '92' | '96' | '100' | '104' | '108' | '112' | '116' | '120' | '124' | '132' | '136' | '140' | '144' | '148' | '152' | '156' | '158' | '162' | '166' | '170' | '174' | '175' | '178' | '180' | '184' | '188' | '191' | '192' | '196' | '203' | '204' | '208' | '212' | '214' | '218' | '222' | '226' | '231' | '232' | '233' | '234' | '238' | '239' | '242' | '246' | '248' | '250' | '254' | '258' | '260' | '262' | '266' | '268' | '270' | '275' | '276' | '288' | '292' | '296' | '300' | '304' | '308' | '312' | '316' | '320' | '324' | '328' | '332' | '334' | '336' | '340' | '344' | '348' | '352' | '356' | '360' | '364' | '368' | '372' | '376' | '380' | '384' | '388' | '392' | '398' | '400' | '404' | '408' | '410' | '414' | '417' | '418' | '422' | '426' | '428' | '430' | '434' | '438' | '440' | '442' | '446' | '450' | '454' | '458' | '462' | '466' | '470' | '474' | '478' | '480' | '484' | '492' | '496' | '498' | '499' | '500' | '504' | '508' | '512' | '516' | '520' | '524' | '528' | '531' | '533' | '534' | '535' | '540' | '548' | '554' | '558' | '562' | '566' | '570' | '574' | '578' | '580' | '581' | '583' | '584' | '585' | '586' | '591' | '598' | '600' | '604' | '608' | '612' | '616' | '620' | '624' | '626' | '630' | '634' | '638' | '642' | '643' | '646' | '652' | '654' | '659' | '660' | '662' | '663' | '666' | '670' | '674' | '678' | '682' | '686' | '688' | '690' | '694' | '702' | '703' | '704' | '705' | '706' | '710' | '716' | '724' | '728' | '729' | '732' | '740' | '744' | '748' | '752' | '756' | '760' | '762' | '764' | '768' | '772' | '776' | '780' | '784' | '788' | '792' | '795' | '796' | '798' | '800' | '804' | '807' | '818' | '826' | '831' | '832' | '833' | '834' | '840' | '850' | '854' | '858' | '860' | '862' | '876' | '882' | '887' | '894';
|
|
13
|
+
/**
|
|
14
|
+
* Maps ISO 3166 Alpha 2 codes to UN M49 numbers
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* [UN M49 to ISO 3166 information](https://unstats.un.org/unsd/methodology/m49/)
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare const COUNTRIES: Record<Country, CountryNum>;
|
|
22
|
+
/**
|
|
23
|
+
* Maps UN M49 numbers to ISO 3166 Alpha 2 codes
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* @see {@link COUNTRIES}
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
declare const REV_COUNTRIES: Record<CountryNum, Country>;
|
|
31
|
+
export { REV_COUNTRIES };
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ISO 4217 currency code
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export
|
|
7
|
-
/**
|
|
8
|
-
* ISO 4217 currency number
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export
|
|
13
|
-
interface CurrencyData {
|
|
14
|
-
num: CurrencyNum;
|
|
15
|
-
decimals: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Maps a ISO 4217 code to a ISO 4217 currency number and decimal positions
|
|
19
|
-
*
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export declare const CURRENCIES: Record<Currency, CurrencyData>;
|
|
23
|
-
interface RevCurrencyData {
|
|
24
|
-
code: Currency;
|
|
25
|
-
decimals: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Maps a ISO 4217 number to a ISO 4217 currency code and decimal positions
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* @see {@link CURRENCIES}
|
|
32
|
-
*
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
35
|
-
declare const REV_CURRENCIES: Record<CurrencyNum, RevCurrencyData>;
|
|
36
|
-
export { REV_CURRENCIES };
|
|
1
|
+
/**
|
|
2
|
+
* ISO 4217 currency code
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type Currency = 'ALL' | 'DZD' | 'ARS' | 'AUD' | 'BSD' | 'BHD' | 'BDT' | 'AMD' | 'BBD' | 'BMD' | 'BTN' | 'BOB' | 'BWP' | 'BZD' | 'SBD' | 'BND' | 'MMK' | 'BIF' | 'KHR' | 'CAD' | 'CVE' | 'KYD' | 'LKR' | 'CLP' | 'CNY' | 'COP' | 'KMF' | 'CRC' | 'HRK' | 'CUP' | 'CZK' | 'DKK' | 'DOP' | 'SVC' | 'ETB' | 'ERN' | 'FKP' | 'FJD' | 'DJF' | 'GMD' | 'GIP' | 'GTQ' | 'GNF' | 'GYD' | 'HTG' | 'HNL' | 'HKD' | 'HUF' | 'ISK' | 'INR' | 'IDR' | 'IRR' | 'IQD' | 'ILS' | 'JMD' | 'JPY' | 'KZT' | 'JOD' | 'KES' | 'KPW' | 'KRW' | 'KWD' | 'KGS' | 'LAK' | 'LBP' | 'LSL' | 'LRD' | 'LYD' | 'MOP' | 'MWK' | 'MYR' | 'MVR' | 'MUR' | 'MXN' | 'MNT' | 'MDL' | 'MAD' | 'OMR' | 'NAD' | 'NPR' | 'ANG' | 'AWG' | 'VUV' | 'NZD' | 'NIO' | 'NGN' | 'NOK' | 'PKR' | 'PAB' | 'PGK' | 'PYG' | 'PEN' | 'PHP' | 'QAR' | 'RUB' | 'RWF' | 'SHP' | 'SAR' | 'SCR' | 'SLL' | 'SGD' | 'VND' | 'SOS' | 'ZAR' | 'SSP' | 'SZL' | 'SEK' | 'CHF' | 'SYP' | 'THB' | 'TOP' | 'TTD' | 'AED' | 'TND' | 'UGX' | 'MKD' | 'EGP' | 'GBP' | 'TZS' | 'USD' | 'UYU' | 'UZS' | 'WST' | 'YER' | 'TWD' | 'TMT' | 'GHS' | 'RSD' | 'MZN' | 'AZN' | 'RON' | 'TRY' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'ZMW' | 'SRD' | 'AFN' | 'TJS' | 'AOA' | 'BGN' | 'CDF' | 'BAM' | 'EUR' | 'UAH' | 'GEL' | 'PLN' | 'BRL';
|
|
7
|
+
/**
|
|
8
|
+
* ISO 4217 currency number
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export type CurrencyNum = '8' | '12' | '32' | '36' | '44' | '48' | '50' | '51' | '52' | '60' | '64' | '68' | '72' | '84' | '90' | '96' | '104' | '108' | '116' | '124' | '132' | '136' | '144' | '152' | '156' | '170' | '174' | '188' | '191' | '192' | '203' | '208' | '214' | '222' | '230' | '232' | '238' | '242' | '262' | '270' | '292' | '320' | '324' | '328' | '332' | '340' | '344' | '348' | '352' | '356' | '360' | '364' | '368' | '376' | '388' | '392' | '398' | '400' | '404' | '408' | '410' | '414' | '417' | '418' | '422' | '426' | '430' | '434' | '446' | '454' | '458' | '462' | '480' | '484' | '496' | '498' | '504' | '512' | '516' | '524' | '532' | '533' | '548' | '554' | '558' | '566' | '578' | '586' | '590' | '598' | '600' | '604' | '608' | '634' | '643' | '646' | '654' | '682' | '690' | '694' | '702' | '704' | '706' | '710' | '728' | '748' | '752' | '756' | '760' | '764' | '776' | '780' | '784' | '788' | '800' | '807' | '818' | '826' | '834' | '840' | '858' | '860' | '882' | '886' | '901' | '934' | '936' | '941' | '943' | '944' | '946' | '949' | '950' | '951' | '952' | '953' | '967' | '968' | '971' | '972' | '973' | '975' | '976' | '977' | '978' | '980' | '981' | '985' | '986';
|
|
13
|
+
interface CurrencyData {
|
|
14
|
+
num: CurrencyNum;
|
|
15
|
+
decimals: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Maps a ISO 4217 code to a ISO 4217 currency number and decimal positions
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare const CURRENCIES: Record<Currency, CurrencyData>;
|
|
23
|
+
interface RevCurrencyData {
|
|
24
|
+
code: Currency;
|
|
25
|
+
decimals: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Maps a ISO 4217 number to a ISO 4217 currency code and decimal positions
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* @see {@link CURRENCIES}
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
declare const REV_CURRENCIES: Record<CurrencyNum, RevCurrencyData>;
|
|
36
|
+
export { REV_CURRENCIES };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
code: number;
|
|
3
|
-
sisCode: null;
|
|
4
|
-
text: string;
|
|
5
|
-
} | {
|
|
6
|
-
code: null;
|
|
7
|
-
sisCode: string;
|
|
8
|
-
text: string;
|
|
9
|
-
} | {
|
|
10
|
-
code: number;
|
|
11
|
-
sisCode: string;
|
|
12
|
-
text: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const ALL_ERRORS: ErrorRecord[];
|
|
15
|
-
declare const ERROR_CODES: Record<string, string>;
|
|
16
|
-
declare const SIS_ERROR_CODES: Record<string, string>;
|
|
17
|
-
export { ERROR_CODES, SIS_ERROR_CODES };
|
|
1
|
+
type ErrorRecord = {
|
|
2
|
+
code: number;
|
|
3
|
+
sisCode: null;
|
|
4
|
+
text: string;
|
|
5
|
+
} | {
|
|
6
|
+
code: null;
|
|
7
|
+
sisCode: string;
|
|
8
|
+
text: string;
|
|
9
|
+
} | {
|
|
10
|
+
code: number;
|
|
11
|
+
sisCode: string;
|
|
12
|
+
text: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const ALL_ERRORS: ErrorRecord[];
|
|
15
|
+
declare const ERROR_CODES: Record<string, string>;
|
|
16
|
+
declare const SIS_ERROR_CODES: Record<string, string>;
|
|
17
|
+
export { ERROR_CODES, SIS_ERROR_CODES };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ISO 639-1 language code
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export
|
|
7
|
-
/**
|
|
8
|
-
* Redsys language code
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export
|
|
13
|
-
/**
|
|
14
|
-
* Maps an ISO 639-1 language code to redsys language number
|
|
15
|
-
*
|
|
16
|
-
* @remarks
|
|
17
|
-
* Some ISO 639-1 language codes may include more more than one redsys language number. In such cases the main redsys language number is used.
|
|
18
|
-
*
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export declare const LANGUAGES: Record<Language, LanguageNum>;
|
|
22
|
-
/**
|
|
23
|
-
* Maps a redsys language code to an ISO 639-1 language code
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* @see {@link LANGUAGES}
|
|
27
|
-
*
|
|
28
|
-
* @public
|
|
29
|
-
*/
|
|
30
|
-
declare const REV_LANGUAGES: Record<LanguageNum, Language>;
|
|
31
|
-
export { REV_LANGUAGES };
|
|
1
|
+
/**
|
|
2
|
+
* ISO 639-1 language code
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type Language = 'es' | 'en' | 'ca' | 'fr' | 'de' | 'nl' | 'it' | 'sv' | 'pt' | 'pl' | 'gl' | 'eu' | 'bg' | 'zh' | 'hr' | 'cs' | 'da' | 'et' | 'fi' | 'el' | 'hu' | 'ja' | 'lv' | 'lt' | 'mt' | 'ro' | 'ru' | 'sk' | 'sl' | 'tr';
|
|
7
|
+
/**
|
|
8
|
+
* Redsys language code
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export type LanguageNum = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '100' | '156' | '191' | '203' | '208' | '233' | '246' | '300' | '348' | '392' | '428' | '440' | '470' | '642' | '643' | '703' | '705' | '792';
|
|
13
|
+
/**
|
|
14
|
+
* Maps an ISO 639-1 language code to redsys language number
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Some ISO 639-1 language codes may include more more than one redsys language number. In such cases the main redsys language number is used.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare const LANGUAGES: Record<Language, LanguageNum>;
|
|
22
|
+
/**
|
|
23
|
+
* Maps a redsys language code to an ISO 639-1 language code
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* @see {@link LANGUAGES}
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
declare const REV_LANGUAGES: Record<LanguageNum, Language>;
|
|
31
|
+
export { REV_LANGUAGES };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const RESPONSE_CODES: Record<string, string>;
|
|
2
|
-
export default RESPONSE_CODES;
|
|
1
|
+
declare const RESPONSE_CODES: Record<string, string>;
|
|
2
|
+
export default RESPONSE_CODES;
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transaction type code
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export
|
|
7
|
-
/**
|
|
8
|
-
* Transaction type enum
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare const TRANSACTION_TYPES: {
|
|
13
|
-
/** Autorización */
|
|
14
|
-
readonly AUTHORIZATION: "0";
|
|
15
|
-
/** Preautorización */
|
|
16
|
-
readonly PRE_AUTHORIZATION: "1";
|
|
17
|
-
/** Confirmación de preautorización */
|
|
18
|
-
readonly CONFIRMATION: "2";
|
|
19
|
-
/** Devolución Automática */
|
|
20
|
-
readonly AUTO_REFUND: "3";
|
|
21
|
-
/** Transacción Recurrente */
|
|
22
|
-
readonly RECURRING_TRANSACTION: "5";
|
|
23
|
-
/** Transacción Sucesiva */
|
|
24
|
-
readonly SUCCESSIVE_TRANSACTION: "6";
|
|
25
|
-
/** Pre-autenticación */
|
|
26
|
-
readonly PRE_AUTHENTICATION: "7";
|
|
27
|
-
/** Confirmación de pre-autenticación */
|
|
28
|
-
readonly PRE_AUTHENTICATION_CONFIRMATION: "8";
|
|
29
|
-
/** Anulación de Preautorización */
|
|
30
|
-
readonly PRE_AUTHORIZATION_CANCEL: "9";
|
|
31
|
-
/** Autorización en diferido */
|
|
32
|
-
readonly DEFERRED_AUTHORIZATION: "O";
|
|
33
|
-
/** Paygold */
|
|
34
|
-
readonly PAYGOLD: "15";
|
|
35
|
-
/** Autenticación Puce */
|
|
36
|
-
readonly PUCE_AUTH: "17";
|
|
37
|
-
/** Devolución sin original */
|
|
38
|
-
readonly RETURN_WITHOUT_ORIGINAL: "34";
|
|
39
|
-
/** Premio de apuestas */
|
|
40
|
-
readonly BETTING_PAYOUT: "37";
|
|
41
|
-
/** Eliminar referencia */
|
|
42
|
-
readonly DELETE_REFERENCE: "44";
|
|
43
|
-
/** Operaciones sin autenticacíon */
|
|
44
|
-
readonly NO_AUTHENTICATION: "A";
|
|
45
|
-
/** Paygold */
|
|
46
|
-
readonly PAYLINK: "F";
|
|
47
|
-
/** Confirmación de autorización en diferido */
|
|
48
|
-
readonly DEFERRED_AUTHORIZATION_CONFIRMATION: "P";
|
|
49
|
-
/** Anulación de autorización en diferido */
|
|
50
|
-
readonly DEFERRED_AUTHORIZATION_CANCEL: "Q";
|
|
51
|
-
/** Cuota inicial diferido */
|
|
52
|
-
readonly DEFERRED_INITIAL_FEE: "R";
|
|
53
|
-
/** Cuota sucesiva diferido */
|
|
54
|
-
readonly DEFERRED_SUCCESSIVE_FEE: "S";
|
|
55
|
-
};
|
|
56
|
-
export default TRANSACTION_TYPES;
|
|
1
|
+
/**
|
|
2
|
+
* Transaction type code
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type TransactionType = '0' | '1' | '2' | '3' | '5' | '6' | '7' | '8' | '9' | '15' | '17' | '34' | '37' | '44' | 'O' | 'F' | 'P' | 'Q' | 'R' | 'S' | 'A';
|
|
7
|
+
/**
|
|
8
|
+
* Transaction type enum
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare const TRANSACTION_TYPES: {
|
|
13
|
+
/** Autorización */
|
|
14
|
+
readonly AUTHORIZATION: "0";
|
|
15
|
+
/** Preautorización */
|
|
16
|
+
readonly PRE_AUTHORIZATION: "1";
|
|
17
|
+
/** Confirmación de preautorización */
|
|
18
|
+
readonly CONFIRMATION: "2";
|
|
19
|
+
/** Devolución Automática */
|
|
20
|
+
readonly AUTO_REFUND: "3";
|
|
21
|
+
/** Transacción Recurrente */
|
|
22
|
+
readonly RECURRING_TRANSACTION: "5";
|
|
23
|
+
/** Transacción Sucesiva */
|
|
24
|
+
readonly SUCCESSIVE_TRANSACTION: "6";
|
|
25
|
+
/** Pre-autenticación */
|
|
26
|
+
readonly PRE_AUTHENTICATION: "7";
|
|
27
|
+
/** Confirmación de pre-autenticación */
|
|
28
|
+
readonly PRE_AUTHENTICATION_CONFIRMATION: "8";
|
|
29
|
+
/** Anulación de Preautorización */
|
|
30
|
+
readonly PRE_AUTHORIZATION_CANCEL: "9";
|
|
31
|
+
/** Autorización en diferido */
|
|
32
|
+
readonly DEFERRED_AUTHORIZATION: "O";
|
|
33
|
+
/** Paygold */
|
|
34
|
+
readonly PAYGOLD: "15";
|
|
35
|
+
/** Autenticación Puce */
|
|
36
|
+
readonly PUCE_AUTH: "17";
|
|
37
|
+
/** Devolución sin original */
|
|
38
|
+
readonly RETURN_WITHOUT_ORIGINAL: "34";
|
|
39
|
+
/** Premio de apuestas */
|
|
40
|
+
readonly BETTING_PAYOUT: "37";
|
|
41
|
+
/** Eliminar referencia */
|
|
42
|
+
readonly DELETE_REFERENCE: "44";
|
|
43
|
+
/** Operaciones sin autenticacíon */
|
|
44
|
+
readonly NO_AUTHENTICATION: "A";
|
|
45
|
+
/** Paygold */
|
|
46
|
+
readonly PAYLINK: "F";
|
|
47
|
+
/** Confirmación de autorización en diferido */
|
|
48
|
+
readonly DEFERRED_AUTHORIZATION_CONFIRMATION: "P";
|
|
49
|
+
/** Anulación de autorización en diferido */
|
|
50
|
+
readonly DEFERRED_AUTHORIZATION_CANCEL: "Q";
|
|
51
|
+
/** Cuota inicial diferido */
|
|
52
|
+
readonly DEFERRED_INITIAL_FEE: "R";
|
|
53
|
+
/** Cuota sucesiva diferido */
|
|
54
|
+
readonly DEFERRED_SUCCESSIVE_FEE: "S";
|
|
55
|
+
};
|
|
56
|
+
export default TRANSACTION_TYPES;
|
package/lib/client.d.ts
CHANGED
|
@@ -1,50 +1,85 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
import type { fetch as Fetch } from 'undici';
|
|
2
|
+
import type { ResponseJSONSuccess, RedirectForm } from './types/api';
|
|
3
|
+
import type { RestIniciaPeticionInputParams, RestTrataPeticionInputParams, RedirectInputParams } from './types/input-params';
|
|
4
|
+
import type { RestIniciaPeticionOutputParams, RestTrataPeticionOutputParams, RestNotificationOutputParams, SoapNotificationOutputParams } from './types/output-params';
|
|
5
|
+
/**
|
|
6
|
+
* URLs to configure the API
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface UrlsConfig {
|
|
11
|
+
redirect: string;
|
|
12
|
+
restTrataPeticion: string;
|
|
13
|
+
restIniciaPeticion: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Redsys production urls
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export declare const PRODUCTION_URLS: UrlsConfig;
|
|
21
|
+
/**
|
|
22
|
+
* Redsys sandbox urls
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export declare const SANDBOX_URLS: UrlsConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Redsys API settings
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
export interface RedsysConfig {
|
|
33
|
+
fetch?: typeof Fetch | undefined;
|
|
34
|
+
secretKey: string;
|
|
35
|
+
urls: UrlsConfig;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Sends a iniciaPeticion request using REST interface
|
|
39
|
+
*/
|
|
40
|
+
export type RestIniciaPeticion = (paramsInput: RestIniciaPeticionInputParams) => Promise<RestIniciaPeticionOutputParams>;
|
|
41
|
+
/**
|
|
42
|
+
* Sends a trataPeticion request using REST interface
|
|
43
|
+
*/
|
|
44
|
+
export type RestTrataPeticion = (paramsInput: RestTrataPeticionInputParams) => Promise<RestTrataPeticionOutputParams>;
|
|
45
|
+
/**
|
|
46
|
+
* Creates the parameters needed for a redirect form
|
|
47
|
+
*/
|
|
48
|
+
export type CreateRedirectForm = (paramsInput: RedirectInputParams) => RedirectForm;
|
|
49
|
+
/**
|
|
50
|
+
* Processes a JSON REST notification
|
|
51
|
+
*/
|
|
52
|
+
export type ProcessRestNotification = (
|
|
53
|
+
/** Body of JSON notification, as a POJO (Plain Old Javascript Object) */
|
|
54
|
+
body: ResponseJSONSuccess) => RestNotificationOutputParams;
|
|
55
|
+
/**
|
|
56
|
+
* Parses and verifies the body of a SOAP notification
|
|
57
|
+
*/
|
|
58
|
+
export type ProcessSoapNotification = (
|
|
59
|
+
/** SOAP notification as a XML string */
|
|
60
|
+
xml: string) => SoapNotificationOutputParams;
|
|
61
|
+
/**
|
|
62
|
+
* Creates an answer for a SOAP notification, serializes and signs it
|
|
63
|
+
*/
|
|
64
|
+
export type CreateSoapNotificationAnswer = (
|
|
65
|
+
/** Order identifier */
|
|
66
|
+
order: string,
|
|
67
|
+
/** Indicates if the payment is allowed to proceed */
|
|
68
|
+
allow: boolean) => string;
|
|
69
|
+
export interface RedsysAPI {
|
|
70
|
+
restIniciaPeticion: RestIniciaPeticion;
|
|
71
|
+
restTrataPeticion: RestTrataPeticion;
|
|
72
|
+
createRedirectForm: CreateRedirectForm;
|
|
73
|
+
processRestNotification: ProcessRestNotification;
|
|
74
|
+
processSoapNotification: ProcessSoapNotification;
|
|
75
|
+
createSoapNotificationAnswer: CreateSoapNotificationAnswer;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Creates Redsys API functions
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
* These API functions are anonymous and can be wrapped by formatters and processors
|
|
82
|
+
*
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
85
|
+
export declare const createRedsysAPI: (config: RedsysConfig) => RedsysAPI;
|