react-native-payengine 1.0.5
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 +20 -0
- package/README.md +152 -0
- package/android/.gradle/5.6.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/5.6.4/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/5.6.4/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -0
- package/android/.idea/jarRepositories.xml +35 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +147 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/android/gradle.properties +5 -0
- package/android/gradlew +172 -0
- package/android/gradlew.bat +84 -0
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativepayengine/PayengineModule.java +33 -0
- package/android/src/main/java/com/reactnativepayengine/PayenginePackage.java +64 -0
- package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectModule.java +148 -0
- package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectOnCreateViewInstanceListener.java +6 -0
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCVCField.java +67 -0
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardHolderNameField.java +53 -0
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardNumberField.java +57 -0
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSExpDateField.java +54 -0
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSTextField.java +57 -0
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSZipCodeField.java +62 -0
- package/android/src/main/java/com/reactnativepayengine/util/JSONObjectUtil.java +138 -0
- package/android/src/main/java/com/reactnativepayengine/util/ResourceUtil.java +14 -0
- package/android/vgscollect-1.7.2-debug.aar +0 -0
- package/ios/Payengine-Bridging-Header.h +2 -0
- package/ios/Payengine.m +55 -0
- package/ios/Payengine.swift +637 -0
- package/ios/Payengine.xcodeproj/project.pbxproj +317 -0
- package/ios/Payengine.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Payengine.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Payengine.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +34 -0
- package/ios/Payengine.xcodeproj/project.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Payengine.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +24 -0
- package/ios/Payengine.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/ios/Payengine.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Payengine.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcschemes/Pods-Payengine.xcscheme +58 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcschemes/VGSCollectSDK-CardIcon.xcscheme +58 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcschemes/VGSCollectSDK.xcscheme +58 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcschemes/xcschememanagement.plist +32 -0
- package/lib/commonjs/components/LoadingIndicator.js +42 -0
- package/lib/commonjs/components/LoadingIndicator.js.map +1 -0
- package/lib/commonjs/components/PayEngine.js +141 -0
- package/lib/commonjs/components/PayEngine.js.map +1 -0
- package/lib/commonjs/components/SecureFields/VGS/CVCField.js +26 -0
- package/lib/commonjs/components/SecureFields/VGS/CVCField.js.map +1 -0
- package/lib/commonjs/components/SecureFields/VGS/CardHolderNameField.js +26 -0
- package/lib/commonjs/components/SecureFields/VGS/CardHolderNameField.js.map +1 -0
- package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js +26 -0
- package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js.map +1 -0
- package/lib/commonjs/components/SecureFields/VGS/CollectManager.js +65 -0
- package/lib/commonjs/components/SecureFields/VGS/CollectManager.js.map +1 -0
- package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js +26 -0
- package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js.map +1 -0
- package/lib/commonjs/components/SecureFields/VGS/TextField.js +30 -0
- package/lib/commonjs/components/SecureFields/VGS/TextField.js.map +1 -0
- package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js +26 -0
- package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js.map +1 -0
- package/lib/commonjs/components/SecureFields/index.js +34 -0
- package/lib/commonjs/components/SecureFields/index.js.map +1 -0
- package/lib/commonjs/index.js +42 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/utils/index.js +112 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/components/LoadingIndicator.js +28 -0
- package/lib/module/components/LoadingIndicator.js.map +1 -0
- package/lib/module/components/PayEngine.js +124 -0
- package/lib/module/components/PayEngine.js.map +1 -0
- package/lib/module/components/SecureFields/VGS/CVCField.js +14 -0
- package/lib/module/components/SecureFields/VGS/CVCField.js.map +1 -0
- package/lib/module/components/SecureFields/VGS/CardHolderNameField.js +14 -0
- package/lib/module/components/SecureFields/VGS/CardHolderNameField.js.map +1 -0
- package/lib/module/components/SecureFields/VGS/CardNumberField.js +14 -0
- package/lib/module/components/SecureFields/VGS/CardNumberField.js.map +1 -0
- package/lib/module/components/SecureFields/VGS/CollectManager.js +50 -0
- package/lib/module/components/SecureFields/VGS/CollectManager.js.map +1 -0
- package/lib/module/components/SecureFields/VGS/ExpDateField.js +14 -0
- package/lib/module/components/SecureFields/VGS/ExpDateField.js.map +1 -0
- package/lib/module/components/SecureFields/VGS/TextField.js +17 -0
- package/lib/module/components/SecureFields/VGS/TextField.js.map +1 -0
- package/lib/module/components/SecureFields/VGS/ZipCodeField.js +14 -0
- package/lib/module/components/SecureFields/VGS/ZipCodeField.js.map +1 -0
- package/lib/module/components/SecureFields/index.js +17 -0
- package/lib/module/components/SecureFields/index.js.map +1 -0
- package/lib/module/index.js +18 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/utils/index.js +96 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/components/LoadingIndicator.d.ts +2 -0
- package/lib/typescript/components/PayEngine.d.ts +15 -0
- package/lib/typescript/components/SecureFields/VGS/CVCField.d.ts +10 -0
- package/lib/typescript/components/SecureFields/VGS/CardHolderNameField.d.ts +10 -0
- package/lib/typescript/components/SecureFields/VGS/CardNumberField.d.ts +10 -0
- package/lib/typescript/components/SecureFields/VGS/CollectManager.d.ts +12 -0
- package/lib/typescript/components/SecureFields/VGS/ExpDateField.d.ts +10 -0
- package/lib/typescript/components/SecureFields/VGS/TextField.d.ts +14 -0
- package/lib/typescript/components/SecureFields/VGS/ZipCodeField.d.ts +10 -0
- package/lib/typescript/components/SecureFields/index.d.ts +16 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/utils/index.d.ts +45 -0
- package/package.json +154 -0
- package/react-native-payengine.podspec +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createHttpClient","config","baseUrl","publicKey","includes","scriptURL","replace","axios","create","baseURL","headers","Authorization","getScriptURL","Error","logLevelStr","logLevel","version","debuggingScript"],"sources":["index.ts"],"sourcesContent":["import axios from \"axios\"\n\nexport interface IPayEngineConfig {\n publicKey: string\n version?: string\n scriptURL?: string\n logLevel?: number\n}\n\nexport const createHttpClient = (config: IPayEngineConfig) => {\n let baseUrl = config.publicKey.includes('_prod_')\n ? \"https://console.payengine.co\"\n : \"https://console.payengine.dev\"\n\n if (config.scriptURL) {\n baseUrl = config.scriptURL.replace(/^((\\w+:)?\\/\\/[^\\/]+\\/?).*$/,'$1')\n }\n return axios.create({\n baseURL: baseUrl,\n headers: {\n Authorization: `Signature key=\"${config.publicKey}\",algorithm=\"hmac-sha256\",identifier=\"secure-fields\",signature=\"\"`\n }\n })\n}\n\nexport function getScriptURL(config: IPayEngineConfig) {\n\n if (!config.publicKey) {\n throw new Error('PayEngine Public Key is missing')\n }\n let scriptURL = ''\n const logLevelStr = config.logLevel ? `&loglevel=${config.logLevel}` : ''\n if (config.scriptURL) {\n scriptURL = `${config.scriptURL}?key=${config.publicKey}${logLevelStr}`\n } else {\n const baseURL = config.publicKey.includes('_prod_')\n ? \"https://console.payengine.co\"\n : \"https://console.payengine.dev\"\n const version = config.version ?? '1.0.0'\n scriptURL = `${baseURL}/js/${version}/embed.js?key=${config.publicKey}${logLevelStr}`\n }\n\n return scriptURL\n}\n\n/**\n * <script>\n console.log(\"AAAAAAAA\")\n var component = document.getElementById(\"component\");\n var onEvent = function(event) {\n console.log({ event })\n }\n console.log('component')\n component.addEventListener('stepChange', function(e) {\n console.log('step change')\n })\n function addEventListenerAll(target, listener, ...otherArguments) {\n\n // install listeners for all natively triggered events\n for (const key in target) {\n if (/^on/.test(key)) {\n const eventType = key.substr(2);\n target.addEventListener(eventType, listener, ...otherArguments);\n }\n }\n\n // dynamically install listeners for all manually triggered events, just-in-time before they're dispatched ;D\n const dispatchEvent_original = EventTarget.prototype.dispatchEvent;\n function dispatchEvent(event) {\n console.log('event test', event.type)\n target.addEventListener(event.type, listener, ...otherArguments); // multiple identical listeners are automatically discarded\n dispatchEvent_original.apply(this, arguments);\n }\n EventTarget.prototype.dispatchEvent = dispatchEvent;\n if (EventTarget.prototype.dispatchEvent !== dispatchEvent) throw new Error('Browser is smarter than you think');\n\n }\n\n // addEventListenerAll(component, onEvent);\n </script>\n */\nexport const debuggingScript = `\nconst consoleLog = (type, ...log) => window.ReactNativeWebView.postMessage(JSON.stringify({'type': 'Console', 'data': {'type': type, 'log': log}}));\nconsole = {\n log: (...log) => consoleLog('log', ...log),\n debug: (...log) => consoleLog('debug', ...log),\n info: (...log) => consoleLog('info', ...log),\n warn: (...log) => consoleLog('warn', ...log),\n error: (...log) => consoleLog('error', ...log),\n verbose: (...log) => consoleLog('verbose', ...log),\n};\n\nconst dispatchEvent_original = EventTarget.prototype.dispatchEvent;\nfunction dispatchEvent(event) {\n if (event.type && !event.type.startsWith('react')) {\n ReactNativeWebView.postMessage(JSON.stringify({\n type: 'PayEngine',\n event: {\n type: event.type,\n detail: event.detail\n }\n }))\n }\n}\nEventTarget.prototype.dispatchEvent = dispatchEvent;\n`;\n"],"mappings":";;;;;;;;AAAA;;;;AASO,MAAMA,gBAAgB,GAAIC,MAAD,IAA8B;EAC5D,IAAIC,OAAO,GAAGD,MAAM,CAACE,SAAP,CAAiBC,QAAjB,CAA0B,QAA1B,IACR,8BADQ,GAEV,+BAFJ;;EAIA,IAAIH,MAAM,CAACI,SAAX,EAAsB;IACpBH,OAAO,GAAGD,MAAM,CAACI,SAAP,CAAiBC,OAAjB,CAAyB,4BAAzB,EAAsD,IAAtD,CAAV;EACD;;EACD,OAAOC,cAAA,CAAMC,MAAN,CAAa;IAClBC,OAAO,EAAEP,OADS;IAElBQ,OAAO,EAAE;MACPC,aAAa,EAAG,kBAAiBV,MAAM,CAACE,SAAU;IAD3C;EAFS,CAAb,CAAP;AAMD,CAdM;;;;AAgBA,SAASS,YAAT,CAAsBX,MAAtB,EAAgD;EAErD,IAAI,CAACA,MAAM,CAACE,SAAZ,EAAuB;IACrB,MAAM,IAAIU,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,IAAIR,SAAS,GAAG,EAAhB;EACA,MAAMS,WAAW,GAAGb,MAAM,CAACc,QAAP,GAAmB,aAAYd,MAAM,CAACc,QAAS,EAA/C,GAAmD,EAAvE;;EACA,IAAId,MAAM,CAACI,SAAX,EAAsB;IACpBA,SAAS,GAAI,GAAEJ,MAAM,CAACI,SAAU,QAAOJ,MAAM,CAACE,SAAU,GAAEW,WAAY,EAAtE;EACD,CAFD,MAEO;IACL,MAAML,OAAO,GAAGR,MAAM,CAACE,SAAP,CAAiBC,QAAjB,CAA0B,QAA1B,IACZ,8BADY,GAEZ,+BAFJ;IAGA,MAAMY,OAAO,GAAGf,MAAM,CAACe,OAAP,IAAkB,OAAlC;IACAX,SAAS,GAAI,GAAEI,OAAQ,OAAMO,OAAQ,iBAAgBf,MAAM,CAACE,SAAU,GAAEW,WAAY,EAApF;EACD;;EAED,OAAOT,SAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMY,eAAe,GAAI;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAxBO"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet, ActivityIndicator, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
const LoadingIndicator = () => {
|
|
5
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
6
|
+
style: styles.container
|
|
7
|
+
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
8
|
+
size: "small",
|
|
9
|
+
color: "#0000ff"
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default LoadingIndicator;
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
container: {
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
position: 'absolute',
|
|
19
|
+
top: 0,
|
|
20
|
+
left: 0,
|
|
21
|
+
height: '100%',
|
|
22
|
+
width: '100%'
|
|
23
|
+
},
|
|
24
|
+
activityIndicatorStyle: {// flex: 1,
|
|
25
|
+
// justifyContent: "center",
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=LoadingIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","ActivityIndicator","View","LoadingIndicator","styles","container","create","alignItems","justifyContent","position","top","left","height","width","activityIndicatorStyle"],"sources":["LoadingIndicator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { StyleSheet, ActivityIndicator, View } from 'react-native';\n\nconst LoadingIndicator = () => {\n return (\n <View style={styles.container}>\n <ActivityIndicator size=\"small\" color=\"#0000ff\" />\n </View>\n );\n};\n\nexport default LoadingIndicator;\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n height: '100%',\n width: '100%'\n },\n activityIndicatorStyle: {\n // flex: 1,\n // justifyContent: \"center\",\n },\n});\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,UAAT,EAAqBC,iBAArB,EAAwCC,IAAxC,QAAoD,cAApD;;AAEA,MAAMC,gBAAgB,GAAG,MAAM;EAC7B,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEC,MAAM,CAACC;EAApB,gBACE,oBAAC,iBAAD;IAAmB,IAAI,EAAC,OAAxB;IAAgC,KAAK,EAAC;EAAtC,EADF,CADF;AAKD,CAND;;AAQA,eAAeF,gBAAf;AAEA,MAAMC,MAAM,GAAGJ,UAAU,CAACM,MAAX,CAAkB;EAC/BD,SAAS,EAAE;IACTE,UAAU,EAAE,QADH;IAETC,cAAc,EAAE,QAFP;IAGTC,QAAQ,EAAE,UAHD;IAITC,GAAG,EAAE,CAJI;IAKTC,IAAI,EAAE,CALG;IAMTC,MAAM,EAAE,MANC;IAOTC,KAAK,EAAE;EAPE,CADoB;EAU/BC,sBAAsB,EAAE,CACtB;IACA;EAFsB;AAVO,CAAlB,CAAf"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { WebView } from 'react-native-webview';
|
|
4
|
+
import { getScriptURL, debuggingScript } from '../utils';
|
|
5
|
+
import LoadingIndicator from './LoadingIndicator';
|
|
6
|
+
|
|
7
|
+
const getHtmlTag = props => {
|
|
8
|
+
const allowedProps = Object.keys(props).filter(x => !['config', 'events', 'style'].includes(x));
|
|
9
|
+
return `<pay-engine id="component"
|
|
10
|
+
style="z-index: 100"
|
|
11
|
+
${allowedProps.map(propName => `${propName}="${props[propName]}"`).join(' ')}
|
|
12
|
+
></pay-engine>`;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const generateHTML = (scriptURL, props) => {
|
|
16
|
+
return `<!DOCTYPE html>
|
|
17
|
+
<html>
|
|
18
|
+
<head>
|
|
19
|
+
<title>PayEngine Elements</title>
|
|
20
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
21
|
+
<script src="${scriptURL}" async defer type="text/javascript"></script>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
${getHtmlTag(props)}
|
|
25
|
+
<script>
|
|
26
|
+
setInterval(function() {
|
|
27
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
28
|
+
type: 'PayEngine-height',
|
|
29
|
+
height: document.body.scrollHeight
|
|
30
|
+
}))
|
|
31
|
+
}, 500);
|
|
32
|
+
</script>
|
|
33
|
+
</body>
|
|
34
|
+
</html>`;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const PayEngine = props => {
|
|
38
|
+
const [scriptURL] = React.useState(getScriptURL(props.config));
|
|
39
|
+
const [height, setHeight] = React.useState(30);
|
|
40
|
+
const html = generateHTML(scriptURL, props);
|
|
41
|
+
|
|
42
|
+
const onMessage = payload => {
|
|
43
|
+
var _props$events;
|
|
44
|
+
|
|
45
|
+
const isDebug = props.config.logLevel > 0;
|
|
46
|
+
let dataPayload;
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
dataPayload = JSON.parse(payload.nativeEvent.data);
|
|
50
|
+
} catch (e) {}
|
|
51
|
+
|
|
52
|
+
if (dataPayload) {
|
|
53
|
+
switch (dataPayload.type) {
|
|
54
|
+
case 'Console':
|
|
55
|
+
if (isDebug) {
|
|
56
|
+
console.info(`[Console] ${JSON.stringify(dataPayload.data)}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
break;
|
|
60
|
+
|
|
61
|
+
case 'PayEngine':
|
|
62
|
+
const {
|
|
63
|
+
type,
|
|
64
|
+
detail
|
|
65
|
+
} = dataPayload.event;
|
|
66
|
+
|
|
67
|
+
if ((_props$events = props.events) !== null && _props$events !== void 0 && _props$events[type]) {
|
|
68
|
+
var _props$events2, _props$events2$type;
|
|
69
|
+
|
|
70
|
+
(_props$events2 = props.events) === null || _props$events2 === void 0 ? void 0 : (_props$events2$type = _props$events2[type]) === null || _props$events2$type === void 0 ? void 0 : _props$events2$type.call(_props$events2, detail);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
break;
|
|
74
|
+
|
|
75
|
+
case 'PayEngine-height':
|
|
76
|
+
setHeight(dataPayload.height);
|
|
77
|
+
break;
|
|
78
|
+
|
|
79
|
+
default:
|
|
80
|
+
if (isDebug) {
|
|
81
|
+
console.log(dataPayload);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
90
|
+
style: [{
|
|
91
|
+
flex: 1,
|
|
92
|
+
height: height
|
|
93
|
+
}, props.style]
|
|
94
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
95
|
+
style: styles.yellowBox
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Text, null, "Script URL: ", scriptURL)), /*#__PURE__*/React.createElement(View, {
|
|
97
|
+
style: styles.yellowBox
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Text, null, getHtmlTag(props))), /*#__PURE__*/React.createElement(WebView, {
|
|
99
|
+
originWhitelist: ['*'],
|
|
100
|
+
source: {
|
|
101
|
+
html: html,
|
|
102
|
+
baseUrl: ''
|
|
103
|
+
} // source={{ uri: 'https://google.com' }}
|
|
104
|
+
,
|
|
105
|
+
applicationNameForUserAgent: `PayEngine-RN/${Platform.OS}`,
|
|
106
|
+
injectedJavaScript: debuggingScript,
|
|
107
|
+
renderLoading: LoadingIndicator,
|
|
108
|
+
startInLoadingState: true,
|
|
109
|
+
onMessage: onMessage
|
|
110
|
+
}));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const styles = StyleSheet.create({
|
|
114
|
+
yellowBox: {
|
|
115
|
+
marginVertical: 5,
|
|
116
|
+
marginHorizontal: 10,
|
|
117
|
+
padding: 10,
|
|
118
|
+
backgroundColor: 'yellow',
|
|
119
|
+
borderWidth: 1,
|
|
120
|
+
borderColor: 'yellow'
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
export default PayEngine;
|
|
124
|
+
//# sourceMappingURL=PayEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","Text","View","WebView","getScriptURL","debuggingScript","LoadingIndicator","getHtmlTag","props","allowedProps","Object","keys","filter","x","includes","map","propName","join","generateHTML","scriptURL","PayEngine","useState","config","height","setHeight","html","onMessage","payload","isDebug","logLevel","dataPayload","JSON","parse","nativeEvent","data","e","type","console","info","stringify","detail","event","events","log","flex","style","styles","yellowBox","baseUrl","OS","create","marginVertical","marginHorizontal","padding","backgroundColor","borderWidth","borderColor"],"sources":["PayEngine.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native';\nimport { WebView } from 'react-native-webview';\nimport { getScriptURL, IPayEngineConfig, debuggingScript } from '../utils';\nimport LoadingIndicator from './LoadingIndicator';\n\ninterface IProps {\n config: IPayEngineConfig\n type: string\n merchantId?: string\n hash?: string\n events: {\n [key: string]: (eventData: any) => void\n }\n style?: StyleProp<ViewStyle>\n [key: string]: any\n}\n\nconst getHtmlTag = (props: IProps) => {\n const allowedProps = Object.keys(props).filter(x => !['config', 'events', 'style'].includes(x))\n return `<pay-engine id=\"component\"\n style=\"z-index: 100\"\n ${allowedProps.map((propName: string) => `${propName}=\"${props[propName]}\"`).join(' ')}\n ></pay-engine>`\n}\n\nconst generateHTML = (scriptURL: string, props: IProps) => {\n return `<!DOCTYPE html>\n <html>\n <head>\n <title>PayEngine Elements</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <script src=\"${scriptURL}\" async defer type=\"text/javascript\"></script>\n </head>\n <body>\n ${getHtmlTag(props)}\n <script>\n setInterval(function() {\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'PayEngine-height',\n height: document.body.scrollHeight\n }))\n }, 500);\n </script>\n </body>\n </html>`\n}\n\nconst PayEngine = (props: IProps) => {\n\n const [scriptURL] = React.useState(getScriptURL(props.config))\n const [height, setHeight] = React.useState(30)\n\n const html = generateHTML(scriptURL, props)\n\n const onMessage = (payload: any) => {\n const isDebug = props.config.logLevel! > 0\n let dataPayload;\n try {\n dataPayload = JSON.parse(payload.nativeEvent.data);\n } catch (e) { }\n\n if (dataPayload) {\n switch (dataPayload.type) {\n case 'Console':\n if (isDebug) {\n console.info(`[Console] ${JSON.stringify(dataPayload.data)}`);\n }\n break;\n case 'PayEngine':\n const { type, detail } = dataPayload.event\n if (props.events?.[type]) {\n props.events?.[type]?.(detail)\n }\n break;\n case 'PayEngine-height':\n setHeight(dataPayload.height)\n break;\n default:\n if (isDebug) {\n console.log(dataPayload)\n }\n break;\n }\n }\n };\n\n return <View style={[{ flex: 1, height: height }, props.style]}>\n <View style={styles.yellowBox}>\n <Text>Script URL: {scriptURL}</Text>\n </View>\n <View style={styles.yellowBox}>\n <Text>{getHtmlTag(props)}</Text>\n </View>\n <WebView\n originWhitelist={['*']}\n source={{ html: html, baseUrl: '' }}\n // source={{ uri: 'https://google.com' }}\n applicationNameForUserAgent={`PayEngine-RN/${Platform.OS}`}\n injectedJavaScript={debuggingScript}\n renderLoading={LoadingIndicator}\n startInLoadingState={true}\n onMessage={onMessage}\n />\n </View>\n}\n\nconst styles = StyleSheet.create({\n yellowBox: {\n marginVertical: 5,\n marginHorizontal: 10,\n padding: 10,\n backgroundColor: 'yellow',\n borderWidth: 1,\n borderColor: 'yellow'\n }\n})\n\n\nexport default PayEngine\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAA8BC,UAA9B,EAA0CC,IAA1C,EAAgDC,IAAhD,QAAuE,cAAvE;AACA,SAASC,OAAT,QAAwB,sBAAxB;AACA,SAASC,YAAT,EAAyCC,eAAzC,QAAgE,UAAhE;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;;AAcA,MAAMC,UAAU,GAAIC,KAAD,IAAmB;EACpC,MAAMC,YAAY,GAAGC,MAAM,CAACC,IAAP,CAAYH,KAAZ,EAAmBI,MAAnB,CAA0BC,CAAC,IAAI,CAAC,CAAC,QAAD,EAAW,QAAX,EAAqB,OAArB,EAA8BC,QAA9B,CAAuCD,CAAvC,CAAhC,CAArB;EACA,OAAQ;AACV;AACA,MAAMJ,YAAY,CAACM,GAAb,CAAkBC,QAAD,IAAuB,GAAEA,QAAS,KAAIR,KAAK,CAACQ,QAAD,CAAW,GAAvE,EAA2EC,IAA3E,CAAgF,GAAhF,CAAqF;AAC3F,iBAHE;AAID,CAND;;AAQA,MAAMC,YAAY,GAAG,CAACC,SAAD,EAAoBX,KAApB,KAAsC;EACzD,OAAQ;AACV;AACA;AACA;AACA;AACA,qBAAqBW,SAAU;AAC/B;AACA;AACA,QAAQZ,UAAU,CAACC,KAAD,CAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAlBE;AAmBD,CApBD;;AAsBA,MAAMY,SAAS,GAAIZ,KAAD,IAAmB;EAEnC,MAAM,CAACW,SAAD,IAAcrB,KAAK,CAACuB,QAAN,CAAejB,YAAY,CAACI,KAAK,CAACc,MAAP,CAA3B,CAApB;EACA,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsB1B,KAAK,CAACuB,QAAN,CAAe,EAAf,CAA5B;EAEA,MAAMI,IAAI,GAAGP,YAAY,CAACC,SAAD,EAAYX,KAAZ,CAAzB;;EAEA,MAAMkB,SAAS,GAAIC,OAAD,IAAkB;IAAA;;IAClC,MAAMC,OAAO,GAAGpB,KAAK,CAACc,MAAN,CAAaO,QAAb,GAAyB,CAAzC;IACA,IAAIC,WAAJ;;IACA,IAAI;MACFA,WAAW,GAAGC,IAAI,CAACC,KAAL,CAAWL,OAAO,CAACM,WAAR,CAAoBC,IAA/B,CAAd;IACD,CAFD,CAEE,OAAOC,CAAP,EAAU,CAAG;;IAEf,IAAIL,WAAJ,EAAiB;MACf,QAAQA,WAAW,CAACM,IAApB;QACE,KAAK,SAAL;UACE,IAAIR,OAAJ,EAAa;YACXS,OAAO,CAACC,IAAR,CAAc,aAAYP,IAAI,CAACQ,SAAL,CAAeT,WAAW,CAACI,IAA3B,CAAiC,EAA3D;UACD;;UACD;;QACF,KAAK,WAAL;UACE,MAAM;YAAEE,IAAF;YAAQI;UAAR,IAAmBV,WAAW,CAACW,KAArC;;UACA,qBAAIjC,KAAK,CAACkC,MAAV,0CAAI,cAAeN,IAAf,CAAJ,EAA0B;YAAA;;YACxB,kBAAA5B,KAAK,CAACkC,MAAN,yFAAeN,IAAf,kGAAuBI,MAAvB;UACD;;UACD;;QACF,KAAK,kBAAL;UACEhB,SAAS,CAACM,WAAW,CAACP,MAAb,CAAT;UACA;;QACF;UACE,IAAIK,OAAJ,EAAa;YACXS,OAAO,CAACM,GAAR,CAAYb,WAAZ;UACD;;UACD;MAnBJ;IAqBD;EACF,CA9BD;;EAgCA,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAE,CAAC;MAAEc,IAAI,EAAE,CAAR;MAAWrB,MAAM,EAAEA;IAAnB,CAAD,EAA8Bf,KAAK,CAACqC,KAApC;EAAb,gBACL,oBAAC,IAAD;IAAM,KAAK,EAAEC,MAAM,CAACC;EAApB,gBACE,oBAAC,IAAD,wBAAmB5B,SAAnB,CADF,CADK,eAIL,oBAAC,IAAD;IAAM,KAAK,EAAE2B,MAAM,CAACC;EAApB,gBACE,oBAAC,IAAD,QAAOxC,UAAU,CAACC,KAAD,CAAjB,CADF,CAJK,eAOL,oBAAC,OAAD;IACE,eAAe,EAAE,CAAC,GAAD,CADnB;IAEE,MAAM,EAAE;MAAEiB,IAAI,EAAEA,IAAR;MAAcuB,OAAO,EAAE;IAAvB,CAFV,CAGE;IAHF;IAIE,2BAA2B,EAAG,gBAAejD,QAAQ,CAACkD,EAAG,EAJ3D;IAKE,kBAAkB,EAAE5C,eALtB;IAME,aAAa,EAAEC,gBANjB;IAOE,mBAAmB,EAAE,IAPvB;IAQE,SAAS,EAAEoB;EARb,EAPK,CAAP;AAkBD,CAzDD;;AA2DA,MAAMoB,MAAM,GAAG9C,UAAU,CAACkD,MAAX,CAAkB;EAC/BH,SAAS,EAAE;IACTI,cAAc,EAAE,CADP;IAETC,gBAAgB,EAAE,EAFT;IAGTC,OAAO,EAAE,EAHA;IAITC,eAAe,EAAE,QAJR;IAKTC,WAAW,EAAE,CALJ;IAMTC,WAAW,EAAE;EANJ;AADoB,CAAlB,CAAf;AAYA,eAAepC,SAAf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
3
|
+
import { requireNativeComponent } from 'react-native';
|
|
4
|
+
|
|
5
|
+
class CVCField extends PureComponent {
|
|
6
|
+
render() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(RTCCVCField, this.props);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const RTCCVCField = requireNativeComponent('VGSCVCField');
|
|
13
|
+
export default CVCField;
|
|
14
|
+
//# sourceMappingURL=CVCField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","requireNativeComponent","CVCField","render","props","RTCCVCField"],"sources":["CVCField.tsx"],"sourcesContent":["import React from 'react'\nimport { PureComponent } from 'react';\nimport { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';\n\n\n\ninterface CVCFieldProps {\n placeholder?: string\n style?: StyleProp<ViewStyle>\n}\n\nclass CVCField extends PureComponent<CVCFieldProps> {\n\n render() {\n return <RTCCVCField {...this.props} />\n }\n}\n\nconst RTCCVCField = requireNativeComponent('VGSCVCField');\n\nexport default CVCField;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,aAAT,QAA8B,OAA9B;AACA,SAASC,sBAAT,QAA6D,cAA7D;;AASA,MAAMC,QAAN,SAAuBF,aAAvB,CAAoD;EAElDG,MAAM,GAAG;IACP,oBAAO,oBAAC,WAAD,EAAiB,KAAKC,KAAtB,CAAP;EACD;;AAJiD;;AAOpD,MAAMC,WAAW,GAAGJ,sBAAsB,CAAC,aAAD,CAA1C;AAEA,eAAeC,QAAf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
3
|
+
import { requireNativeComponent } from 'react-native';
|
|
4
|
+
|
|
5
|
+
class CardHolderNameField extends PureComponent {
|
|
6
|
+
render() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(RTCCardHolderNameField, this.props);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const RTCCardHolderNameField = requireNativeComponent('VGSCardHolderNameField');
|
|
13
|
+
export default CardHolderNameField;
|
|
14
|
+
//# sourceMappingURL=CardHolderNameField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","requireNativeComponent","CardHolderNameField","render","props","RTCCardHolderNameField"],"sources":["CardHolderNameField.tsx"],"sourcesContent":["import React from 'react'\nimport { PureComponent } from 'react';\nimport { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';\n\n\n\ninterface CardHolderNameFieldProps {\n placeholder?: string\n style?: StyleProp<ViewStyle>\n}\n\nclass CardHolderNameField extends PureComponent<CardHolderNameFieldProps> {\n\n render() {\n return <RTCCardHolderNameField {...this.props} />\n }\n}\n\nconst RTCCardHolderNameField = requireNativeComponent('VGSCardHolderNameField');\n\nexport default CardHolderNameField;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,aAAT,QAA8B,OAA9B;AACA,SAASC,sBAAT,QAA6D,cAA7D;;AASA,MAAMC,mBAAN,SAAkCF,aAAlC,CAA0E;EAExEG,MAAM,GAAG;IACP,oBAAO,oBAAC,sBAAD,EAA4B,KAAKC,KAAjC,CAAP;EACD;;AAJuE;;AAO1E,MAAMC,sBAAsB,GAAGJ,sBAAsB,CAAC,wBAAD,CAArD;AAEA,eAAeC,mBAAf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
3
|
+
import { requireNativeComponent } from 'react-native';
|
|
4
|
+
|
|
5
|
+
class CardNumberField extends PureComponent {
|
|
6
|
+
render() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(RTCCardNumberField, this.props);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const RTCCardNumberField = requireNativeComponent('VGSCardNumberField');
|
|
13
|
+
export default CardNumberField;
|
|
14
|
+
//# sourceMappingURL=CardNumberField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","requireNativeComponent","CardNumberField","render","props","RTCCardNumberField"],"sources":["CardNumberField.tsx"],"sourcesContent":["import React from 'react'\nimport { PureComponent } from 'react';\nimport { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';\n\n\n\ninterface CardNumberFieldProps {\n placeholder?: string\n style?: StyleProp<ViewStyle>\n}\n\nclass CardNumberField extends PureComponent<CardNumberFieldProps> {\n\n render() {\n return <RTCCardNumberField {...this.props} />\n }\n}\n\nconst RTCCardNumberField = requireNativeComponent('VGSCardNumberField');\n\nexport default CardNumberField;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,aAAT,QAA8B,OAA9B;AACA,SAASC,sBAAT,QAA6D,cAA7D;;AASA,MAAMC,eAAN,SAA8BF,aAA9B,CAAkE;EAEhEG,MAAM,GAAG;IACP,oBAAO,oBAAC,kBAAD,EAAwB,KAAKC,KAA7B,CAAP;EACD;;AAJ+D;;AAOlE,MAAMC,kBAAkB,GAAGJ,sBAAsB,CAAC,oBAAD,CAAjD;AAEA,eAAeC,eAAf"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Text, NativeModules } from 'react-native';
|
|
3
|
+
import { createHttpClient } from '../../../utils';
|
|
4
|
+
const NativeVGSCollectManager = NativeModules.VGSCollectManager;
|
|
5
|
+
const CollectManager = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
6
|
+
React.useImperativeHandle(ref, () => ({
|
|
7
|
+
createCard: merchantId => {
|
|
8
|
+
return NativeVGSCollectManager.createCard(merchantId);
|
|
9
|
+
},
|
|
10
|
+
cardBankAccount: merchantId => {
|
|
11
|
+
return NativeVGSCollectManager.createBankAccount(merchantId);
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
14
|
+
const [loading, setLoading] = React.useState(true);
|
|
15
|
+
const [error, setError] = React.useState("");
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
const configure = async () => {
|
|
18
|
+
setLoading(true);
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
const http = createHttpClient(props.config);
|
|
22
|
+
const resp = await http.get('/api/setting/secure-fields');
|
|
23
|
+
const {
|
|
24
|
+
vault,
|
|
25
|
+
environment,
|
|
26
|
+
cname,
|
|
27
|
+
vgs_satellite_port
|
|
28
|
+
} = resp.data.data;
|
|
29
|
+
console.log({
|
|
30
|
+
resp
|
|
31
|
+
});
|
|
32
|
+
console.log('Starting collect');
|
|
33
|
+
NativeVGSCollectManager.setConfiguration(vault, environment, cname.replace(/[^a-zA-Z\.]/g, ''), Number(vgs_satellite_port));
|
|
34
|
+
console.log('Set configuration successfully');
|
|
35
|
+
} catch (e) {
|
|
36
|
+
console.log({
|
|
37
|
+
error: e
|
|
38
|
+
});
|
|
39
|
+
setError("Unexpected error: " + e.message);
|
|
40
|
+
} finally {
|
|
41
|
+
setLoading(false);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
configure();
|
|
46
|
+
}, []);
|
|
47
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, loading ? /*#__PURE__*/React.createElement(Text, null, "Loading") : error.length ? /*#__PURE__*/React.createElement(Text, null, error) : props.children);
|
|
48
|
+
});
|
|
49
|
+
export default CollectManager;
|
|
50
|
+
//# sourceMappingURL=CollectManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","NativeModules","createHttpClient","NativeVGSCollectManager","VGSCollectManager","CollectManager","forwardRef","props","ref","useImperativeHandle","createCard","merchantId","cardBankAccount","createBankAccount","loading","setLoading","useState","error","setError","useEffect","configure","http","config","resp","get","vault","environment","cname","vgs_satellite_port","data","console","log","setConfiguration","replace","Number","e","message","length","children"],"sources":["CollectManager.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Text, NativeModules } from 'react-native';\nimport { createHttpClient, IPayEngineConfig } from '../../../utils';\n\nconst NativeVGSCollectManager = NativeModules.VGSCollectManager;\n\nexport interface CollectManagerProps {\n config: IPayEngineConfig\n children: JSX.Element | JSX.Element[]\n}\n\nexport interface VGSCollectManagerMethods {\n createCard: (merchantId?: string) => void\n cardBankAccount: (merchantId?: string) => void\n}\n\nconst CollectManager = React.forwardRef<VGSCollectManagerMethods, CollectManagerProps>((props, ref) => {\n\n React.useImperativeHandle(ref, () => ({\n createCard: (merchantId?: string) => {\n return NativeVGSCollectManager.createCard(merchantId);\n },\n cardBankAccount: (merchantId?: string) => {\n return NativeVGSCollectManager.createBankAccount(merchantId);\n }\n }));\n\n const [loading, setLoading] = React.useState(true)\n const [error, setError] = React.useState(\"\")\n\n React.useEffect(() => {\n const configure = async () => {\n setLoading(true)\n try {\n const http = createHttpClient(props.config)\n const resp = await http.get('/api/setting/secure-fields')\n\n const { vault, environment, cname, vgs_satellite_port } = resp.data.data\n console.log({ resp })\n console.log('Starting collect')\n\n NativeVGSCollectManager.setConfiguration(vault, environment, cname.replace(/[^a-zA-Z\\.]/g, ''), Number(vgs_satellite_port))\n console.log('Set configuration successfully')\n } catch (e: any) {\n console.log({ error: e })\n setError(\"Unexpected error: \" + e.message)\n } finally {\n setLoading(false)\n }\n }\n\n configure()\n }, [])\n\n return (\n <React.Fragment>\n {loading ? <Text>Loading</Text> : (error.length ? <Text>{error}</Text> : props.children)}\n </React.Fragment>\n );\n});\n\nexport default CollectManager;\n\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,EAAeC,aAAf,QAAoC,cAApC;AACA,SAASC,gBAAT,QAAmD,gBAAnD;AAEA,MAAMC,uBAAuB,GAAGF,aAAa,CAACG,iBAA9C;AAYA,MAAMC,cAAc,gBAAGN,KAAK,CAACO,UAAN,CAAgE,CAACC,KAAD,EAAQC,GAAR,KAAgB;EAErGT,KAAK,CAACU,mBAAN,CAA0BD,GAA1B,EAA+B,OAAO;IACpCE,UAAU,EAAGC,UAAD,IAAyB;MACnC,OAAOR,uBAAuB,CAACO,UAAxB,CAAmCC,UAAnC,CAAP;IACD,CAHmC;IAIpCC,eAAe,EAAGD,UAAD,IAAyB;MACxC,OAAOR,uBAAuB,CAACU,iBAAxB,CAA0CF,UAA1C,CAAP;IACD;EANmC,CAAP,CAA/B;EASA,MAAM,CAACG,OAAD,EAAUC,UAAV,IAAwBhB,KAAK,CAACiB,QAAN,CAAe,IAAf,CAA9B;EACA,MAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBnB,KAAK,CAACiB,QAAN,CAAe,EAAf,CAA1B;EAEAjB,KAAK,CAACoB,SAAN,CAAgB,MAAM;IACpB,MAAMC,SAAS,GAAG,YAAY;MAC5BL,UAAU,CAAC,IAAD,CAAV;;MACA,IAAI;QACF,MAAMM,IAAI,GAAGnB,gBAAgB,CAACK,KAAK,CAACe,MAAP,CAA7B;QACA,MAAMC,IAAI,GAAG,MAAMF,IAAI,CAACG,GAAL,CAAS,4BAAT,CAAnB;QAEA,MAAM;UAAEC,KAAF;UAASC,WAAT;UAAsBC,KAAtB;UAA6BC;QAA7B,IAAoDL,IAAI,CAACM,IAAL,CAAUA,IAApE;QACAC,OAAO,CAACC,GAAR,CAAY;UAAER;QAAF,CAAZ;QACAO,OAAO,CAACC,GAAR,CAAY,kBAAZ;QAEA5B,uBAAuB,CAAC6B,gBAAxB,CAAyCP,KAAzC,EAAgDC,WAAhD,EAA6DC,KAAK,CAACM,OAAN,CAAc,cAAd,EAA8B,EAA9B,CAA7D,EAAgGC,MAAM,CAACN,kBAAD,CAAtG;QACAE,OAAO,CAACC,GAAR,CAAY,gCAAZ;MACD,CAVD,CAUE,OAAOI,CAAP,EAAe;QACfL,OAAO,CAACC,GAAR,CAAY;UAAEd,KAAK,EAAEkB;QAAT,CAAZ;QACAjB,QAAQ,CAAC,uBAAuBiB,CAAC,CAACC,OAA1B,CAAR;MACD,CAbD,SAaU;QACRrB,UAAU,CAAC,KAAD,CAAV;MACD;IACF,CAlBD;;IAoBAK,SAAS;EACV,CAtBD,EAsBG,EAtBH;EAwBA,oBACE,oBAAC,KAAD,CAAO,QAAP,QACGN,OAAO,gBAAG,oBAAC,IAAD,kBAAH,GAA2BG,KAAK,CAACoB,MAAN,gBAAe,oBAAC,IAAD,QAAOpB,KAAP,CAAf,GAAsCV,KAAK,CAAC+B,QADjF,CADF;AAKD,CA3CsB,CAAvB;AA6CA,eAAejC,cAAf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
3
|
+
import { requireNativeComponent } from 'react-native';
|
|
4
|
+
|
|
5
|
+
class ExpDateField extends PureComponent {
|
|
6
|
+
render() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(RTCExpDateField, this.props);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const RTCExpDateField = requireNativeComponent('VGSExpDateField');
|
|
13
|
+
export default ExpDateField;
|
|
14
|
+
//# sourceMappingURL=ExpDateField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","requireNativeComponent","ExpDateField","render","props","RTCExpDateField"],"sources":["ExpDateField.tsx"],"sourcesContent":["import React from 'react'\nimport { PureComponent } from 'react';\nimport { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';\n\n\n\ninterface ExpDateFieldProps {\n placeholder?: string\n style?: StyleProp<ViewStyle>\n}\n\nclass ExpDateField extends PureComponent<ExpDateFieldProps> {\n\n render() {\n return <RTCExpDateField {...this.props} />\n }\n}\n\nconst RTCExpDateField = requireNativeComponent('VGSExpDateField');\n\nexport default ExpDateField;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,aAAT,QAA8B,OAA9B;AACA,SAASC,sBAAT,QAA6D,cAA7D;;AASA,MAAMC,YAAN,SAA2BF,aAA3B,CAA4D;EAE1DG,MAAM,GAAG;IACP,oBAAO,oBAAC,eAAD,EAAqB,KAAKC,KAA1B,CAAP;EACD;;AAJyD;;AAO5D,MAAMC,eAAe,GAAGJ,sBAAsB,CAAC,iBAAD,CAA9C;AAEA,eAAeC,YAAf"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { requireNativeComponent } from 'react-native';
|
|
3
|
+
|
|
4
|
+
class TextField extends PureComponent {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
render() {
|
|
10
|
+
return /*#__PURE__*/React.createElement(RTCTextField, this.props);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const RTCTextField = requireNativeComponent('VGSTextField');
|
|
16
|
+
export default TextField;
|
|
17
|
+
//# sourceMappingURL=TextField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","requireNativeComponent","TextField","constructor","props","render","RTCTextField"],"sources":["TextField.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';\n\n\n\ninterface TextFieldProps {\n name?: string\n placeholder?: string\n maxLength?: number\n pattern?: string\n style?: StyleProp<ViewStyle>\n}\n\nclass TextField extends PureComponent<TextFieldProps> {\n\n constructor(props: TextFieldProps) {\n super(props)\n }\n\n render() {\n return <RTCTextField {...this.props} />\n }\n}\n\nconst RTCTextField = requireNativeComponent('VGSTextField');\n\nexport default TextField;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,aAAhB,QAAqC,OAArC;AACA,SAASC,sBAAT,QAA6D,cAA7D;;AAYA,MAAMC,SAAN,SAAwBF,aAAxB,CAAsD;EAEpDG,WAAW,CAACC,KAAD,EAAwB;IACjC,MAAMA,KAAN;EACD;;EAEDC,MAAM,GAAG;IACP,oBAAO,oBAAC,YAAD,EAAkB,KAAKD,KAAvB,CAAP;EACD;;AARmD;;AAWtD,MAAME,YAAY,GAAGL,sBAAsB,CAAC,cAAD,CAA3C;AAEA,eAAeC,SAAf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
3
|
+
import { requireNativeComponent } from 'react-native';
|
|
4
|
+
|
|
5
|
+
class ZipCodeField extends PureComponent {
|
|
6
|
+
render() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(RTCZipCodeField, this.props);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const RTCZipCodeField = requireNativeComponent('VGSZipCodeField');
|
|
13
|
+
export default ZipCodeField;
|
|
14
|
+
//# sourceMappingURL=ZipCodeField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","requireNativeComponent","ZipCodeField","render","props","RTCZipCodeField"],"sources":["ZipCodeField.tsx"],"sourcesContent":["import React from 'react'\nimport { PureComponent } from 'react';\nimport { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';\n\n\n\ninterface ZipCodeFieldProps {\n placeholder?: string\n style?: StyleProp<ViewStyle>\n}\n\nclass ZipCodeField extends PureComponent<ZipCodeFieldProps> {\n\n render() {\n return <RTCZipCodeField {...this.props} />\n }\n}\n\nconst RTCZipCodeField = requireNativeComponent('VGSZipCodeField');\n\nexport default ZipCodeField;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,aAAT,QAA8B,OAA9B;AACA,SAASC,sBAAT,QAA6D,cAA7D;;AASA,MAAMC,YAAN,SAA2BF,aAA3B,CAA4D;EAE1DG,MAAM,GAAG;IACP,oBAAO,oBAAC,eAAD,EAAqB,KAAKC,KAA1B,CAAP;EACD;;AAJyD;;AAO5D,MAAMC,eAAe,GAAGJ,sBAAsB,CAAC,iBAAD,CAA9C;AAEA,eAAeC,YAAf"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import CardNumberField from "./VGS/CardNumberField";
|
|
2
|
+
import CVCField from "./VGS/CVCField";
|
|
3
|
+
import ExpDateTextField from "./VGS/ExpDateField";
|
|
4
|
+
import CollectManager from "./VGS/CollectManager";
|
|
5
|
+
import TextField from './VGS/TextField';
|
|
6
|
+
import CardHolderNameField from './VGS/CardHolderNameField';
|
|
7
|
+
import ZipCodeField from './VGS/ZipCodeField';
|
|
8
|
+
export const SecureFields = {
|
|
9
|
+
CollectManager,
|
|
10
|
+
ExpDateTextField,
|
|
11
|
+
CardNumberField,
|
|
12
|
+
CVCField,
|
|
13
|
+
CardHolderNameField,
|
|
14
|
+
ZipCodeField,
|
|
15
|
+
TextField
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CardNumberField","CVCField","ExpDateTextField","CollectManager","TextField","CardHolderNameField","ZipCodeField","SecureFields"],"sources":["index.ts"],"sourcesContent":["import CardNumberField from \"./VGS/CardNumberField\";\nimport CVCField from \"./VGS/CVCField\";\nimport ExpDateTextField from \"./VGS/ExpDateField\";\nimport CollectManager from \"./VGS/CollectManager\";\nimport TextField from './VGS/TextField';\nimport CardHolderNameField from './VGS/CardHolderNameField';\nimport ZipCodeField from './VGS/ZipCodeField';\n\nexport const SecureFields = {\n CollectManager,\n ExpDateTextField,\n CardNumberField,\n CVCField,\n CardHolderNameField,\n ZipCodeField,\n TextField\n}\n"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uBAA5B;AACA,OAAOC,QAAP,MAAqB,gBAArB;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,OAAOC,cAAP,MAA2B,sBAA3B;AACA,OAAOC,SAAP,MAAsB,iBAAtB;AACA,OAAOC,mBAAP,MAAgC,2BAAhC;AACA,OAAOC,YAAP,MAAyB,oBAAzB;AAEA,OAAO,MAAMC,YAAY,GAAG;EAC1BJ,cAD0B;EAE1BD,gBAF0B;EAG1BF,eAH0B;EAI1BC,QAJ0B;EAK1BI,mBAL0B;EAM1BC,YAN0B;EAO1BF;AAP0B,CAArB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import PayEngine from './components/PayEngine';
|
|
2
|
+
import { NativeModules, Platform } from 'react-native';
|
|
3
|
+
import { SecureFields } from './components/SecureFields/index';
|
|
4
|
+
const LINKING_ERROR = `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
5
|
+
ios: "- You have run 'pod install'\n",
|
|
6
|
+
default: ''
|
|
7
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
8
|
+
const PayEngineStatic = NativeModules.Payengine ? NativeModules.Payengine : new Proxy({}, {
|
|
9
|
+
get() {
|
|
10
|
+
throw new Error(LINKING_ERROR);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}); // function multiply(a: number, b: number): Promise<number> {
|
|
14
|
+
// return PayEngineStatic.multiply(a, b);
|
|
15
|
+
// }
|
|
16
|
+
|
|
17
|
+
export { PayEngineStatic, PayEngine, SecureFields };
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PayEngine","NativeModules","Platform","SecureFields","LINKING_ERROR","select","ios","default","PayEngineStatic","Payengine","Proxy","get","Error"],"sources":["index.tsx"],"sourcesContent":["import PayEngine from './components/PayEngine'\nimport { NativeModules, Platform } from 'react-native';\nimport { SecureFields } from './components/SecureFields/index';\nimport type { IPayEngineConfig } from './utils';\n\nconst LINKING_ERROR =\n `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PayEngineStatic = NativeModules.Payengine ? NativeModules.Payengine : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n);\n\n// function multiply(a: number, b: number): Promise<number> {\n// return PayEngineStatic.multiply(a, b);\n// }\n\nexport {\n PayEngineStatic,\n PayEngine,\n SecureFields,\n IPayEngineConfig\n}\n\n\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,wBAAtB;AACA,SAASC,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AACA,SAASC,YAAT,QAA6B,iCAA7B;AAGA,MAAMC,aAAa,GAChB,iFAAD,GACAF,QAAQ,CAACG,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,eAAe,GAAGP,aAAa,CAACQ,SAAd,GAA0BR,aAAa,CAACQ,SAAxC,GAAoD,IAAIC,KAAJ,CAC1E,EAD0E,EAE1E;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUR,aAAV,CAAN;EACD;;AAHH,CAF0E,CAA5E,C,CASA;AACA;AACA;;AAEA,SACEI,eADF,EAEER,SAFF,EAGEG,YAHF"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
export const createHttpClient = config => {
|
|
3
|
+
let baseUrl = config.publicKey.includes('_prod_') ? "https://console.payengine.co" : "https://console.payengine.dev";
|
|
4
|
+
|
|
5
|
+
if (config.scriptURL) {
|
|
6
|
+
baseUrl = config.scriptURL.replace(/^((\w+:)?\/\/[^\/]+\/?).*$/, '$1');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return axios.create({
|
|
10
|
+
baseURL: baseUrl,
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Signature key="${config.publicKey}",algorithm="hmac-sha256",identifier="secure-fields",signature=""`
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export function getScriptURL(config) {
|
|
17
|
+
if (!config.publicKey) {
|
|
18
|
+
throw new Error('PayEngine Public Key is missing');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let scriptURL = '';
|
|
22
|
+
const logLevelStr = config.logLevel ? `&loglevel=${config.logLevel}` : '';
|
|
23
|
+
|
|
24
|
+
if (config.scriptURL) {
|
|
25
|
+
scriptURL = `${config.scriptURL}?key=${config.publicKey}${logLevelStr}`;
|
|
26
|
+
} else {
|
|
27
|
+
const baseURL = config.publicKey.includes('_prod_') ? "https://console.payengine.co" : "https://console.payengine.dev";
|
|
28
|
+
const version = config.version ?? '1.0.0';
|
|
29
|
+
scriptURL = `${baseURL}/js/${version}/embed.js?key=${config.publicKey}${logLevelStr}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return scriptURL;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* <script>
|
|
36
|
+
console.log("AAAAAAAA")
|
|
37
|
+
var component = document.getElementById("component");
|
|
38
|
+
var onEvent = function(event) {
|
|
39
|
+
console.log({ event })
|
|
40
|
+
}
|
|
41
|
+
console.log('component')
|
|
42
|
+
component.addEventListener('stepChange', function(e) {
|
|
43
|
+
console.log('step change')
|
|
44
|
+
})
|
|
45
|
+
function addEventListenerAll(target, listener, ...otherArguments) {
|
|
46
|
+
|
|
47
|
+
// install listeners for all natively triggered events
|
|
48
|
+
for (const key in target) {
|
|
49
|
+
if (/^on/.test(key)) {
|
|
50
|
+
const eventType = key.substr(2);
|
|
51
|
+
target.addEventListener(eventType, listener, ...otherArguments);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// dynamically install listeners for all manually triggered events, just-in-time before they're dispatched ;D
|
|
56
|
+
const dispatchEvent_original = EventTarget.prototype.dispatchEvent;
|
|
57
|
+
function dispatchEvent(event) {
|
|
58
|
+
console.log('event test', event.type)
|
|
59
|
+
target.addEventListener(event.type, listener, ...otherArguments); // multiple identical listeners are automatically discarded
|
|
60
|
+
dispatchEvent_original.apply(this, arguments);
|
|
61
|
+
}
|
|
62
|
+
EventTarget.prototype.dispatchEvent = dispatchEvent;
|
|
63
|
+
if (EventTarget.prototype.dispatchEvent !== dispatchEvent) throw new Error('Browser is smarter than you think');
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// addEventListenerAll(component, onEvent);
|
|
68
|
+
</script>
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
export const debuggingScript = `
|
|
72
|
+
const consoleLog = (type, ...log) => window.ReactNativeWebView.postMessage(JSON.stringify({'type': 'Console', 'data': {'type': type, 'log': log}}));
|
|
73
|
+
console = {
|
|
74
|
+
log: (...log) => consoleLog('log', ...log),
|
|
75
|
+
debug: (...log) => consoleLog('debug', ...log),
|
|
76
|
+
info: (...log) => consoleLog('info', ...log),
|
|
77
|
+
warn: (...log) => consoleLog('warn', ...log),
|
|
78
|
+
error: (...log) => consoleLog('error', ...log),
|
|
79
|
+
verbose: (...log) => consoleLog('verbose', ...log),
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const dispatchEvent_original = EventTarget.prototype.dispatchEvent;
|
|
83
|
+
function dispatchEvent(event) {
|
|
84
|
+
if (event.type && !event.type.startsWith('react')) {
|
|
85
|
+
ReactNativeWebView.postMessage(JSON.stringify({
|
|
86
|
+
type: 'PayEngine',
|
|
87
|
+
event: {
|
|
88
|
+
type: event.type,
|
|
89
|
+
detail: event.detail
|
|
90
|
+
}
|
|
91
|
+
}))
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
EventTarget.prototype.dispatchEvent = dispatchEvent;
|
|
95
|
+
`;
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["axios","createHttpClient","config","baseUrl","publicKey","includes","scriptURL","replace","create","baseURL","headers","Authorization","getScriptURL","Error","logLevelStr","logLevel","version","debuggingScript"],"sources":["index.ts"],"sourcesContent":["import axios from \"axios\"\n\nexport interface IPayEngineConfig {\n publicKey: string\n version?: string\n scriptURL?: string\n logLevel?: number\n}\n\nexport const createHttpClient = (config: IPayEngineConfig) => {\n let baseUrl = config.publicKey.includes('_prod_')\n ? \"https://console.payengine.co\"\n : \"https://console.payengine.dev\"\n\n if (config.scriptURL) {\n baseUrl = config.scriptURL.replace(/^((\\w+:)?\\/\\/[^\\/]+\\/?).*$/,'$1')\n }\n return axios.create({\n baseURL: baseUrl,\n headers: {\n Authorization: `Signature key=\"${config.publicKey}\",algorithm=\"hmac-sha256\",identifier=\"secure-fields\",signature=\"\"`\n }\n })\n}\n\nexport function getScriptURL(config: IPayEngineConfig) {\n\n if (!config.publicKey) {\n throw new Error('PayEngine Public Key is missing')\n }\n let scriptURL = ''\n const logLevelStr = config.logLevel ? `&loglevel=${config.logLevel}` : ''\n if (config.scriptURL) {\n scriptURL = `${config.scriptURL}?key=${config.publicKey}${logLevelStr}`\n } else {\n const baseURL = config.publicKey.includes('_prod_')\n ? \"https://console.payengine.co\"\n : \"https://console.payengine.dev\"\n const version = config.version ?? '1.0.0'\n scriptURL = `${baseURL}/js/${version}/embed.js?key=${config.publicKey}${logLevelStr}`\n }\n\n return scriptURL\n}\n\n/**\n * <script>\n console.log(\"AAAAAAAA\")\n var component = document.getElementById(\"component\");\n var onEvent = function(event) {\n console.log({ event })\n }\n console.log('component')\n component.addEventListener('stepChange', function(e) {\n console.log('step change')\n })\n function addEventListenerAll(target, listener, ...otherArguments) {\n\n // install listeners for all natively triggered events\n for (const key in target) {\n if (/^on/.test(key)) {\n const eventType = key.substr(2);\n target.addEventListener(eventType, listener, ...otherArguments);\n }\n }\n\n // dynamically install listeners for all manually triggered events, just-in-time before they're dispatched ;D\n const dispatchEvent_original = EventTarget.prototype.dispatchEvent;\n function dispatchEvent(event) {\n console.log('event test', event.type)\n target.addEventListener(event.type, listener, ...otherArguments); // multiple identical listeners are automatically discarded\n dispatchEvent_original.apply(this, arguments);\n }\n EventTarget.prototype.dispatchEvent = dispatchEvent;\n if (EventTarget.prototype.dispatchEvent !== dispatchEvent) throw new Error('Browser is smarter than you think');\n\n }\n\n // addEventListenerAll(component, onEvent);\n </script>\n */\nexport const debuggingScript = `\nconst consoleLog = (type, ...log) => window.ReactNativeWebView.postMessage(JSON.stringify({'type': 'Console', 'data': {'type': type, 'log': log}}));\nconsole = {\n log: (...log) => consoleLog('log', ...log),\n debug: (...log) => consoleLog('debug', ...log),\n info: (...log) => consoleLog('info', ...log),\n warn: (...log) => consoleLog('warn', ...log),\n error: (...log) => consoleLog('error', ...log),\n verbose: (...log) => consoleLog('verbose', ...log),\n};\n\nconst dispatchEvent_original = EventTarget.prototype.dispatchEvent;\nfunction dispatchEvent(event) {\n if (event.type && !event.type.startsWith('react')) {\n ReactNativeWebView.postMessage(JSON.stringify({\n type: 'PayEngine',\n event: {\n type: event.type,\n detail: event.detail\n }\n }))\n }\n}\nEventTarget.prototype.dispatchEvent = dispatchEvent;\n`;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AASA,OAAO,MAAMC,gBAAgB,GAAIC,MAAD,IAA8B;EAC5D,IAAIC,OAAO,GAAGD,MAAM,CAACE,SAAP,CAAiBC,QAAjB,CAA0B,QAA1B,IACR,8BADQ,GAEV,+BAFJ;;EAIA,IAAIH,MAAM,CAACI,SAAX,EAAsB;IACpBH,OAAO,GAAGD,MAAM,CAACI,SAAP,CAAiBC,OAAjB,CAAyB,4BAAzB,EAAsD,IAAtD,CAAV;EACD;;EACD,OAAOP,KAAK,CAACQ,MAAN,CAAa;IAClBC,OAAO,EAAEN,OADS;IAElBO,OAAO,EAAE;MACPC,aAAa,EAAG,kBAAiBT,MAAM,CAACE,SAAU;IAD3C;EAFS,CAAb,CAAP;AAMD,CAdM;AAgBP,OAAO,SAASQ,YAAT,CAAsBV,MAAtB,EAAgD;EAErD,IAAI,CAACA,MAAM,CAACE,SAAZ,EAAuB;IACrB,MAAM,IAAIS,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,IAAIP,SAAS,GAAG,EAAhB;EACA,MAAMQ,WAAW,GAAGZ,MAAM,CAACa,QAAP,GAAmB,aAAYb,MAAM,CAACa,QAAS,EAA/C,GAAmD,EAAvE;;EACA,IAAIb,MAAM,CAACI,SAAX,EAAsB;IACpBA,SAAS,GAAI,GAAEJ,MAAM,CAACI,SAAU,QAAOJ,MAAM,CAACE,SAAU,GAAEU,WAAY,EAAtE;EACD,CAFD,MAEO;IACL,MAAML,OAAO,GAAGP,MAAM,CAACE,SAAP,CAAiBC,QAAjB,CAA0B,QAA1B,IACZ,8BADY,GAEZ,+BAFJ;IAGA,MAAMW,OAAO,GAAGd,MAAM,CAACc,OAAP,IAAkB,OAAlC;IACAV,SAAS,GAAI,GAAEG,OAAQ,OAAMO,OAAQ,iBAAgBd,MAAM,CAACE,SAAU,GAAEU,WAAY,EAApF;EACD;;EAED,OAAOR,SAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMW,eAAe,GAAI;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAxBO"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { IPayEngineConfig } from '../utils';
|
|
3
|
+
interface IProps {
|
|
4
|
+
config: IPayEngineConfig;
|
|
5
|
+
type: string;
|
|
6
|
+
merchantId?: string;
|
|
7
|
+
hash?: string;
|
|
8
|
+
events: {
|
|
9
|
+
[key: string]: (eventData: any) => void;
|
|
10
|
+
};
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
declare const PayEngine: (props: IProps) => JSX.Element;
|
|
15
|
+
export default PayEngine;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
interface CVCFieldProps {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
}
|
|
7
|
+
declare class CVCField extends PureComponent<CVCFieldProps> {
|
|
8
|
+
render(): JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export default CVCField;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
interface CardHolderNameFieldProps {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
}
|
|
7
|
+
declare class CardHolderNameField extends PureComponent<CardHolderNameFieldProps> {
|
|
8
|
+
render(): JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export default CardHolderNameField;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
interface CardNumberFieldProps {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
}
|
|
7
|
+
declare class CardNumberField extends PureComponent<CardNumberFieldProps> {
|
|
8
|
+
render(): JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export default CardNumberField;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IPayEngineConfig } from '../../../utils';
|
|
3
|
+
export interface CollectManagerProps {
|
|
4
|
+
config: IPayEngineConfig;
|
|
5
|
+
children: JSX.Element | JSX.Element[];
|
|
6
|
+
}
|
|
7
|
+
export interface VGSCollectManagerMethods {
|
|
8
|
+
createCard: (merchantId?: string) => void;
|
|
9
|
+
cardBankAccount: (merchantId?: string) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const CollectManager: React.ForwardRefExoticComponent<CollectManagerProps & React.RefAttributes<VGSCollectManagerMethods>>;
|
|
12
|
+
export default CollectManager;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
interface ExpDateFieldProps {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
}
|
|
7
|
+
declare class ExpDateField extends PureComponent<ExpDateFieldProps> {
|
|
8
|
+
render(): JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export default ExpDateField;
|