@tap-payments/apple-pay-button 0.0.93-development → 0.0.95-development
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/LICENSE +21 -21
- package/README.md +240 -240
- package/build/@types/ApplePayButtonProps.d.ts +56 -56
- package/build/@types/ApplePayButtonProps.js +1 -1
- package/build/@types/checkoutProfile.d.ts +216 -216
- package/build/@types/checkoutProfile.js +1 -1
- package/build/@types/enums.d.ts +44 -44
- package/build/@types/enums.js +51 -51
- package/build/@types/index.d.ts +5 -6
- package/build/@types/index.js +5 -6
- package/build/@types/tapLocalisation.d.ts +193 -193
- package/build/@types/tapLocalisation.js +1 -1
- package/build/@types/tapTheme.d.ts +842 -842
- package/build/@types/tapTheme.js +1 -1
- package/build/api.d.ts +7 -31
- package/build/api.js +84 -236
- package/build/constants/index.d.ts +4 -4
- package/build/constants/index.js +4 -4
- package/build/features/ApplePayButton/ApplePayButton.d.ts +4 -4
- package/build/features/ApplePayButton/ApplePayButton.js +48 -48
- package/build/features/ApplePayButton/index.d.ts +3 -3
- package/build/features/ApplePayButton/index.js +2 -2
- package/build/hooks/index.d.ts +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/useApplePay.d.ts +84 -81
- package/build/hooks/useApplePay.js +402 -425
- package/build/hooks/useMerchantApplePay.d.ts +22 -22
- package/build/hooks/useMerchantApplePay.js +167 -190
- package/build/index.d.ts +5 -5
- package/build/index.js +14 -14
- package/build/utils/config.d.ts +14 -14
- package/build/utils/config.js +59 -59
- package/build/utils/defaultValues.d.ts +2 -2
- package/build/utils/defaultValues.js +27 -27
- package/build/utils/index.d.ts +3 -3
- package/build/utils/index.js +3 -3
- package/build/utils/theme.d.ts +13 -13
- package/build/utils/theme.js +62 -62
- package/package.json +109 -109
- package/build/@types/charge.d.ts +0 -56
- package/build/@types/charge.js +0 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
|
-
import { MerchantCapabilities } from '../@types/enums';
|
|
11
|
-
export var getMerchantCapabilities = function (supportedCards) {
|
|
12
|
-
var merchantCapabilities = [MerchantCapabilities.Supports3DS];
|
|
13
|
-
if (!supportedCards) {
|
|
14
|
-
merchantCapabilities = __spreadArray(__spreadArray([], merchantCapabilities, true), [
|
|
15
|
-
MerchantCapabilities.SupportsCredit,
|
|
16
|
-
MerchantCapabilities.SupportsDebit
|
|
17
|
-
], false);
|
|
18
|
-
return merchantCapabilities;
|
|
19
|
-
}
|
|
20
|
-
if (supportedCards.includes('CREDIT')) {
|
|
21
|
-
merchantCapabilities.push(MerchantCapabilities.SupportsCredit);
|
|
22
|
-
}
|
|
23
|
-
if (supportedCards.includes('DEBIT')) {
|
|
24
|
-
merchantCapabilities.push(MerchantCapabilities.SupportsDebit);
|
|
25
|
-
}
|
|
26
|
-
return merchantCapabilities;
|
|
27
|
-
};
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import { MerchantCapabilities } from '../@types/enums';
|
|
11
|
+
export var getMerchantCapabilities = function (supportedCards) {
|
|
12
|
+
var merchantCapabilities = [MerchantCapabilities.Supports3DS];
|
|
13
|
+
if (!supportedCards) {
|
|
14
|
+
merchantCapabilities = __spreadArray(__spreadArray([], merchantCapabilities, true), [
|
|
15
|
+
MerchantCapabilities.SupportsCredit,
|
|
16
|
+
MerchantCapabilities.SupportsDebit
|
|
17
|
+
], false);
|
|
18
|
+
return merchantCapabilities;
|
|
19
|
+
}
|
|
20
|
+
if (supportedCards.includes('CREDIT')) {
|
|
21
|
+
merchantCapabilities.push(MerchantCapabilities.SupportsCredit);
|
|
22
|
+
}
|
|
23
|
+
if (supportedCards.includes('DEBIT')) {
|
|
24
|
+
merchantCapabilities.push(MerchantCapabilities.SupportsDebit);
|
|
25
|
+
}
|
|
26
|
+
return merchantCapabilities;
|
|
27
|
+
};
|
package/build/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './theme';
|
|
2
|
-
export * from './config';
|
|
3
|
-
export * from './defaultValues';
|
|
1
|
+
export * from './theme';
|
|
2
|
+
export * from './config';
|
|
3
|
+
export * from './defaultValues';
|
package/build/utils/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './theme';
|
|
2
|
-
export * from './config';
|
|
3
|
-
export * from './defaultValues';
|
|
1
|
+
export * from './theme';
|
|
2
|
+
export * from './config';
|
|
3
|
+
export * from './defaultValues';
|
package/build/utils/theme.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TapThemeResponse } from '../@types';
|
|
2
|
-
import { FullThemeMode } from '../@types/enums';
|
|
3
|
-
import { ApplePayButtonProps } from '..';
|
|
4
|
-
import { ColorStyle, Locale, ThemeMode } from '@tap-payments/acceptance-sdk';
|
|
5
|
-
export declare const mappingInterface: (interfaceParam?: ApplePayButtonProps['interface']) => ApplePayButtonProps['interface'];
|
|
6
|
-
export declare const getDefaultThemeMode: (themeMode?: ThemeMode) => ThemeMode;
|
|
7
|
-
export declare const getDefaultLocale: (locale?: Locale) => Locale;
|
|
8
|
-
export declare const getFullThemeMode: (themeMode?: ThemeMode, colorStyle?: ColorStyle) => FullThemeMode;
|
|
9
|
-
export declare const appendColors: (colors: Record<string, string>) => void;
|
|
10
|
-
export declare const getTapThemeValue: ({ tapTheme, value }: {
|
|
11
|
-
tapTheme: TapThemeResponse | null;
|
|
12
|
-
value?: string | undefined;
|
|
13
|
-
}) => string;
|
|
1
|
+
import { TapThemeResponse } from '../@types';
|
|
2
|
+
import { FullThemeMode } from '../@types/enums';
|
|
3
|
+
import { ApplePayButtonProps } from '..';
|
|
4
|
+
import { ColorStyle, Locale, ThemeMode } from '@tap-payments/acceptance-sdk';
|
|
5
|
+
export declare const mappingInterface: (interfaceParam?: ApplePayButtonProps['interface']) => ApplePayButtonProps['interface'];
|
|
6
|
+
export declare const getDefaultThemeMode: (themeMode?: ThemeMode) => ThemeMode;
|
|
7
|
+
export declare const getDefaultLocale: (locale?: Locale) => Locale;
|
|
8
|
+
export declare const getFullThemeMode: (themeMode?: ThemeMode, colorStyle?: ColorStyle) => FullThemeMode;
|
|
9
|
+
export declare const appendColors: (colors: Record<string, string>) => void;
|
|
10
|
+
export declare const getTapThemeValue: ({ tapTheme, value }: {
|
|
11
|
+
tapTheme: TapThemeResponse | null;
|
|
12
|
+
value?: string | undefined;
|
|
13
|
+
}) => string;
|
package/build/utils/theme.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { FullThemeMode } from '../@types/enums';
|
|
13
|
-
import { ColorStyle, Edges, Locale, ThemeMode } from '@tap-payments/acceptance-sdk';
|
|
14
|
-
export var mappingInterface = function (interfaceParam) {
|
|
15
|
-
return __assign(__assign({ edges: Edges.CURVED, colorStyle: ColorStyle.COLORED, loader: true }, interfaceParam), { locale: getDefaultLocale(interfaceParam === null || interfaceParam === void 0 ? void 0 : interfaceParam.locale), theme: getDefaultThemeMode(interfaceParam === null || interfaceParam === void 0 ? void 0 : interfaceParam.theme) });
|
|
16
|
-
};
|
|
17
|
-
export var getDefaultThemeMode = function (themeMode) {
|
|
18
|
-
return themeMode === ThemeMode.DYNAMIC || themeMode === undefined
|
|
19
|
-
? window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
20
|
-
? ThemeMode.DARK
|
|
21
|
-
: ThemeMode.LIGHT
|
|
22
|
-
: themeMode;
|
|
23
|
-
};
|
|
24
|
-
export var getDefaultLocale = function (locale) {
|
|
25
|
-
var _a;
|
|
26
|
-
return locale === Locale.DYNAMIC || locale === undefined
|
|
27
|
-
? (_a = window.navigator.language.split('-')) === null || _a === void 0 ? void 0 : _a[0]
|
|
28
|
-
: locale;
|
|
29
|
-
};
|
|
30
|
-
export var getFullThemeMode = function (themeMode, colorStyle) {
|
|
31
|
-
var themeModeValue = getDefaultThemeMode(themeMode);
|
|
32
|
-
if (themeModeValue === ThemeMode.DARK) {
|
|
33
|
-
return colorStyle === ColorStyle.MONOCHROME ? FullThemeMode.DARK : FullThemeMode.DARK_COLORED;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return colorStyle === ColorStyle.MONOCHROME ? FullThemeMode.LIGHT_MONO : FullThemeMode.LIGHT;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
export var appendColors = function (colors) {
|
|
40
|
-
try {
|
|
41
|
-
var root_1 = document.documentElement;
|
|
42
|
-
Object.entries(colors).forEach(function (_a) {
|
|
43
|
-
var key = _a[0], value = _a[1];
|
|
44
|
-
root_1.style.setProperty("--".concat(key), value);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
catch (e) {
|
|
48
|
-
throw e;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
export var getTapThemeValue = function (_a) {
|
|
52
|
-
var tapTheme = _a.tapTheme, value = _a.value;
|
|
53
|
-
if (!tapTheme)
|
|
54
|
-
return '';
|
|
55
|
-
if (!value)
|
|
56
|
-
return '';
|
|
57
|
-
if (value[0] === '#')
|
|
58
|
-
return value;
|
|
59
|
-
var colorsObject = tapTheme === null || tapTheme === void 0 ? void 0 : tapTheme.GlobalValues.Colors;
|
|
60
|
-
var valueFromGlobalColors = colorsObject === null || colorsObject === void 0 ? void 0 : colorsObject[value];
|
|
61
|
-
return valueFromGlobalColors !== null && valueFromGlobalColors !== void 0 ? valueFromGlobalColors : '';
|
|
62
|
-
};
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { FullThemeMode } from '../@types/enums';
|
|
13
|
+
import { ColorStyle, Edges, Locale, ThemeMode } from '@tap-payments/acceptance-sdk';
|
|
14
|
+
export var mappingInterface = function (interfaceParam) {
|
|
15
|
+
return __assign(__assign({ edges: Edges.CURVED, colorStyle: ColorStyle.COLORED, loader: true }, interfaceParam), { locale: getDefaultLocale(interfaceParam === null || interfaceParam === void 0 ? void 0 : interfaceParam.locale), theme: getDefaultThemeMode(interfaceParam === null || interfaceParam === void 0 ? void 0 : interfaceParam.theme) });
|
|
16
|
+
};
|
|
17
|
+
export var getDefaultThemeMode = function (themeMode) {
|
|
18
|
+
return themeMode === ThemeMode.DYNAMIC || themeMode === undefined
|
|
19
|
+
? window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
20
|
+
? ThemeMode.DARK
|
|
21
|
+
: ThemeMode.LIGHT
|
|
22
|
+
: themeMode;
|
|
23
|
+
};
|
|
24
|
+
export var getDefaultLocale = function (locale) {
|
|
25
|
+
var _a;
|
|
26
|
+
return locale === Locale.DYNAMIC || locale === undefined
|
|
27
|
+
? (_a = window.navigator.language.split('-')) === null || _a === void 0 ? void 0 : _a[0]
|
|
28
|
+
: locale;
|
|
29
|
+
};
|
|
30
|
+
export var getFullThemeMode = function (themeMode, colorStyle) {
|
|
31
|
+
var themeModeValue = getDefaultThemeMode(themeMode);
|
|
32
|
+
if (themeModeValue === ThemeMode.DARK) {
|
|
33
|
+
return colorStyle === ColorStyle.MONOCHROME ? FullThemeMode.DARK : FullThemeMode.DARK_COLORED;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return colorStyle === ColorStyle.MONOCHROME ? FullThemeMode.LIGHT_MONO : FullThemeMode.LIGHT;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export var appendColors = function (colors) {
|
|
40
|
+
try {
|
|
41
|
+
var root_1 = document.documentElement;
|
|
42
|
+
Object.entries(colors).forEach(function (_a) {
|
|
43
|
+
var key = _a[0], value = _a[1];
|
|
44
|
+
root_1.style.setProperty("--".concat(key), value);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
throw e;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export var getTapThemeValue = function (_a) {
|
|
52
|
+
var tapTheme = _a.tapTheme, value = _a.value;
|
|
53
|
+
if (!tapTheme)
|
|
54
|
+
return '';
|
|
55
|
+
if (!value)
|
|
56
|
+
return '';
|
|
57
|
+
if (value[0] === '#')
|
|
58
|
+
return value;
|
|
59
|
+
var colorsObject = tapTheme === null || tapTheme === void 0 ? void 0 : tapTheme.GlobalValues.Colors;
|
|
60
|
+
var valueFromGlobalColors = colorsObject === null || colorsObject === void 0 ? void 0 : colorsObject[value];
|
|
61
|
+
return valueFromGlobalColors !== null && valueFromGlobalColors !== void 0 ? valueFromGlobalColors : '';
|
|
62
|
+
};
|
package/package.json
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/apple-pay-button",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Apple Pay Button React Component",
|
|
5
|
-
"main": "build/index.js",
|
|
6
|
-
"module": "build/index.js",
|
|
7
|
-
"types": "build/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"build",
|
|
10
|
-
"README.md"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"start": "cross-env NODE_ENV=development webpack serve",
|
|
14
|
-
"prepare": "npx husky install",
|
|
15
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
16
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
17
|
-
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
18
|
-
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
19
|
-
"build": "cross-env NODE_ENV=production webpack",
|
|
20
|
-
"copy:files": "copyfiles -u 1 src/**/*.gif build/ && copyfiles -u 1 src/**/*.css build/",
|
|
21
|
-
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
22
|
-
"ts:build": "rm -rf build && tsc && yarn tsc:alias && yarn copy:files",
|
|
23
|
-
"push": "npm publish --access public --tag development"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [],
|
|
26
|
-
"author": {
|
|
27
|
-
"name": "Ahmed Elsharkawy",
|
|
28
|
-
"email": "a.elsharkawy@tap.company"
|
|
29
|
-
},
|
|
30
|
-
"license": "ISC",
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"@tap-payments/acceptance-sdk": "0.0.
|
|
33
|
-
"@tap-payments/browser-info": "^1.0.2",
|
|
34
|
-
"@tap-payments/web-error-handing": "^1.0.1",
|
|
35
|
-
"axios": "^1.2.2",
|
|
36
|
-
"framer-motion": "^10.16.5",
|
|
37
|
-
"jsencrypt": "^3.3.2",
|
|
38
|
-
"lottie-react": "^2.4.0",
|
|
39
|
-
"react": "^18.2.0",
|
|
40
|
-
"react-dom": "^18.2.0"
|
|
41
|
-
},
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@babel/core": "^7.18.6",
|
|
44
|
-
"@babel/preset-env": "^7.18.6",
|
|
45
|
-
"@babel/preset-react": "^7.18.6",
|
|
46
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
47
|
-
"@types/applepayjs": "^14.0.3",
|
|
48
|
-
"@types/crypto-js": "^4.1.1",
|
|
49
|
-
"@types/react": "^18.0.15",
|
|
50
|
-
"@types/react-dom": "^18.0.6",
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
52
|
-
"@typescript-eslint/parser": "^5.30.5",
|
|
53
|
-
"babel-loader": "^8.2.5",
|
|
54
|
-
"copyfiles": "^2.4.1",
|
|
55
|
-
"cross-env": "^7.0.3",
|
|
56
|
-
"css-loader": "^6.7.1",
|
|
57
|
-
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
58
|
-
"eslint": "^8.19.0",
|
|
59
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
60
|
-
"eslint-config-prettier": "^8.5.0",
|
|
61
|
-
"eslint-plugin-import": "^2.26.0",
|
|
62
|
-
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
63
|
-
"eslint-plugin-node": "^11.1.0",
|
|
64
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
65
|
-
"eslint-plugin-react": "^7.30.1",
|
|
66
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
67
|
-
"file-loader": "^6.2.0",
|
|
68
|
-
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
69
|
-
"html-loader": "^3.1.2",
|
|
70
|
-
"html-webpack-plugin": "^5.5.0",
|
|
71
|
-
"husky": "^8.0.1",
|
|
72
|
-
"lint-staged": "^13.0.3",
|
|
73
|
-
"mini-css-extract-plugin": "^2.6.1",
|
|
74
|
-
"prettier": "^2.7.1",
|
|
75
|
-
"sass": "^1.53.0",
|
|
76
|
-
"sass-loader": "^13.0.2",
|
|
77
|
-
"style-loader": "^3.3.1",
|
|
78
|
-
"terser-webpack-plugin": "^5.3.3",
|
|
79
|
-
"tsc-alias": "^1.6.11",
|
|
80
|
-
"typescript": "^4.7.4",
|
|
81
|
-
"webpack": "^5.73.0",
|
|
82
|
-
"webpack-cli": "^4.10.0",
|
|
83
|
-
"webpack-dev-server": "^4.9.3",
|
|
84
|
-
"webpack-merge": "^5.8.0"
|
|
85
|
-
},
|
|
86
|
-
"peerDependencies": {
|
|
87
|
-
"react": ">=17.0.2",
|
|
88
|
-
"react-dom": ">=17.0.2"
|
|
89
|
-
},
|
|
90
|
-
"lint-staged": {
|
|
91
|
-
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
92
|
-
"yarn run prettier:fix",
|
|
93
|
-
"yarn run lint",
|
|
94
|
-
"git add ."
|
|
95
|
-
]
|
|
96
|
-
},
|
|
97
|
-
"browserslist": {
|
|
98
|
-
"production": [
|
|
99
|
-
">0.2%",
|
|
100
|
-
"not dead",
|
|
101
|
-
"not op_mini all"
|
|
102
|
-
],
|
|
103
|
-
"development": [
|
|
104
|
-
"last 1 chrome version",
|
|
105
|
-
"last 1 firefox version",
|
|
106
|
-
"last 1 safari version"
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/apple-pay-button",
|
|
3
|
+
"version": "0.0.95-development",
|
|
4
|
+
"description": "Apple Pay Button React Component",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"module": "build/index.js",
|
|
7
|
+
"types": "build/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"build",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"start": "cross-env NODE_ENV=development webpack serve",
|
|
14
|
+
"prepare": "npx husky install",
|
|
15
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
16
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
17
|
+
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
18
|
+
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
19
|
+
"build": "cross-env NODE_ENV=production webpack",
|
|
20
|
+
"copy:files": "copyfiles -u 1 src/**/*.gif build/ && copyfiles -u 1 src/**/*.css build/",
|
|
21
|
+
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
22
|
+
"ts:build": "rm -rf build && tsc && yarn tsc:alias && yarn copy:files",
|
|
23
|
+
"push": "npm publish --access public --tag development"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [],
|
|
26
|
+
"author": {
|
|
27
|
+
"name": "Ahmed Elsharkawy",
|
|
28
|
+
"email": "a.elsharkawy@tap.company"
|
|
29
|
+
},
|
|
30
|
+
"license": "ISC",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@tap-payments/acceptance-sdk": "0.0.71",
|
|
33
|
+
"@tap-payments/browser-info": "^1.0.2",
|
|
34
|
+
"@tap-payments/web-error-handing": "^1.0.1",
|
|
35
|
+
"axios": "^1.2.2",
|
|
36
|
+
"framer-motion": "^10.16.5",
|
|
37
|
+
"jsencrypt": "^3.3.2",
|
|
38
|
+
"lottie-react": "^2.4.0",
|
|
39
|
+
"react": "^18.2.0",
|
|
40
|
+
"react-dom": "^18.2.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@babel/core": "^7.18.6",
|
|
44
|
+
"@babel/preset-env": "^7.18.6",
|
|
45
|
+
"@babel/preset-react": "^7.18.6",
|
|
46
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
47
|
+
"@types/applepayjs": "^14.0.3",
|
|
48
|
+
"@types/crypto-js": "^4.1.1",
|
|
49
|
+
"@types/react": "^18.0.15",
|
|
50
|
+
"@types/react-dom": "^18.0.6",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
52
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
53
|
+
"babel-loader": "^8.2.5",
|
|
54
|
+
"copyfiles": "^2.4.1",
|
|
55
|
+
"cross-env": "^7.0.3",
|
|
56
|
+
"css-loader": "^6.7.1",
|
|
57
|
+
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
58
|
+
"eslint": "^8.19.0",
|
|
59
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
60
|
+
"eslint-config-prettier": "^8.5.0",
|
|
61
|
+
"eslint-plugin-import": "^2.26.0",
|
|
62
|
+
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
63
|
+
"eslint-plugin-node": "^11.1.0",
|
|
64
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
65
|
+
"eslint-plugin-react": "^7.30.1",
|
|
66
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
67
|
+
"file-loader": "^6.2.0",
|
|
68
|
+
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
69
|
+
"html-loader": "^3.1.2",
|
|
70
|
+
"html-webpack-plugin": "^5.5.0",
|
|
71
|
+
"husky": "^8.0.1",
|
|
72
|
+
"lint-staged": "^13.0.3",
|
|
73
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
74
|
+
"prettier": "^2.7.1",
|
|
75
|
+
"sass": "^1.53.0",
|
|
76
|
+
"sass-loader": "^13.0.2",
|
|
77
|
+
"style-loader": "^3.3.1",
|
|
78
|
+
"terser-webpack-plugin": "^5.3.3",
|
|
79
|
+
"tsc-alias": "^1.6.11",
|
|
80
|
+
"typescript": "^4.7.4",
|
|
81
|
+
"webpack": "^5.73.0",
|
|
82
|
+
"webpack-cli": "^4.10.0",
|
|
83
|
+
"webpack-dev-server": "^4.9.3",
|
|
84
|
+
"webpack-merge": "^5.8.0"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"react": ">=17.0.2",
|
|
88
|
+
"react-dom": ">=17.0.2"
|
|
89
|
+
},
|
|
90
|
+
"lint-staged": {
|
|
91
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
92
|
+
"yarn run prettier:fix",
|
|
93
|
+
"yarn run lint",
|
|
94
|
+
"git add ."
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"browserslist": {
|
|
98
|
+
"production": [
|
|
99
|
+
">0.2%",
|
|
100
|
+
"not dead",
|
|
101
|
+
"not op_mini all"
|
|
102
|
+
],
|
|
103
|
+
"development": [
|
|
104
|
+
"last 1 chrome version",
|
|
105
|
+
"last 1 firefox version",
|
|
106
|
+
"last 1 safari version"
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
}
|
package/build/@types/charge.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export interface ChargeRequestBody {
|
|
2
|
-
source: {
|
|
3
|
-
id: string;
|
|
4
|
-
};
|
|
5
|
-
ipaddress?: string;
|
|
6
|
-
amount: number;
|
|
7
|
-
currency: string;
|
|
8
|
-
selected_amount?: number;
|
|
9
|
-
selected_currency?: string;
|
|
10
|
-
product: string;
|
|
11
|
-
threeDSecure?: boolean;
|
|
12
|
-
save_card: boolean;
|
|
13
|
-
customer: {
|
|
14
|
-
id?: string;
|
|
15
|
-
first_name?: string;
|
|
16
|
-
middle_name?: string;
|
|
17
|
-
last_name?: string;
|
|
18
|
-
email?: string;
|
|
19
|
-
phone?: {
|
|
20
|
-
country_code: string;
|
|
21
|
-
number: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
hashstring?: string;
|
|
25
|
-
metadata?: Record<string, string>;
|
|
26
|
-
post?: {
|
|
27
|
-
url: string;
|
|
28
|
-
};
|
|
29
|
-
redirect?: {
|
|
30
|
-
url: string;
|
|
31
|
-
};
|
|
32
|
-
merchant?: {
|
|
33
|
-
id: string;
|
|
34
|
-
};
|
|
35
|
-
order?: {
|
|
36
|
-
id: string;
|
|
37
|
-
};
|
|
38
|
-
payment_agreement?: {
|
|
39
|
-
id: string;
|
|
40
|
-
contract?: {
|
|
41
|
-
id: string;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
destinations?: Record<string, any>;
|
|
45
|
-
reference?: {
|
|
46
|
-
order?: string;
|
|
47
|
-
transaction?: string;
|
|
48
|
-
};
|
|
49
|
-
description?: string;
|
|
50
|
-
}
|
|
51
|
-
export interface AuthorizeRequestBody extends ChargeRequestBody {
|
|
52
|
-
auto?: {
|
|
53
|
-
type: string;
|
|
54
|
-
time: string;
|
|
55
|
-
};
|
|
56
|
-
}
|
package/build/@types/charge.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|