frames-react-native 1.1.5 → 1.1.8
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/README.md +2 -2
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +2 -2
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/http.js +2 -2
- package/dist/utils/logger.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Start accepting online card payments in just a few minutes with Frames. It's quick and easy to integrate, accepts online card payments from all major credit cards, and is customizable to your brand.
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<img src="https://
|
|
9
|
+
<img src="https://i.ibb.co/zbjF2NQ/React-Native-Gif.gif" alt="Demo frames react native"/>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
# :nerd_face: How does it work?
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
ExpiryDate,
|
|
50
50
|
Cvv,
|
|
51
51
|
SubmitButton,
|
|
52
|
-
} from "
|
|
52
|
+
} from "frames-react-native";
|
|
53
53
|
|
|
54
54
|
export default function App() {
|
|
55
55
|
return (
|
|
@@ -7,5 +7,5 @@ export declare const SANDBOX_BASE_URL = "https://api.sandbox.checkout.com";
|
|
|
7
7
|
export declare const LIVE_BASE_URL = "https://api.checkout.com";
|
|
8
8
|
export declare const LIVE_LOGGER = "https://cloudevents.integration.checkout.com/logging";
|
|
9
9
|
export declare const SANDBOX_LOGGER = "https://cloudevents.integration.sandbox.checkout.com/logging";
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
10
|
+
export declare const MBC_LIVE_PUBLIC_KEY_REGEX: RegExp;
|
|
11
|
+
export declare const NAS_LIVE_PUBLIC_KEY_REGEX: RegExp;
|
package/dist/utils/constants.js
CHANGED
|
@@ -7,6 +7,6 @@ export var SANDBOX_BASE_URL = "https://api.sandbox.checkout.com";
|
|
|
7
7
|
export var LIVE_BASE_URL = "https://api.checkout.com";
|
|
8
8
|
export var LIVE_LOGGER = "https://cloudevents.integration.checkout.com/logging";
|
|
9
9
|
export var SANDBOX_LOGGER = "https://cloudevents.integration.sandbox.checkout.com/logging";
|
|
10
|
-
export var
|
|
11
|
-
export var
|
|
10
|
+
export var MBC_LIVE_PUBLIC_KEY_REGEX = /^pk_?(\w{8})-(\w{4})-(\w{4})-(\w{4})-(\w{12})$/;
|
|
11
|
+
export var NAS_LIVE_PUBLIC_KEY_REGEX = /^pk_?[a-z2-7]{26}[a-z2-7*#$=]$/;
|
|
12
12
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,IAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,IAAM,+BAA+B,GAAG,qBAAqB,CAAC;AACrE,MAAM,CAAC,IAAM,oCAAoC,GAAG,OAAO,CAAC;AAC5D,MAAM,CAAC,IAAM,uBAAuB,GAAG,KAAK,CAAC;AAE7C,MAAM,CAAC,IAAM,gBAAgB,GAAG,kCAAkC,CAAC;AACnE,MAAM,CAAC,IAAM,aAAa,GAAG,0BAA0B,CAAC;AACxD,MAAM,CAAC,IAAM,WAAW,GACtB,sDAAsD,CAAC;AACzD,MAAM,CAAC,IAAM,cAAc,GACzB,8DAA8D,CAAC;AACjE,MAAM,CAAC,IAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,IAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,IAAM,+BAA+B,GAAG,qBAAqB,CAAC;AACrE,MAAM,CAAC,IAAM,oCAAoC,GAAG,OAAO,CAAC;AAC5D,MAAM,CAAC,IAAM,uBAAuB,GAAG,KAAK,CAAC;AAE7C,MAAM,CAAC,IAAM,gBAAgB,GAAG,kCAAkC,CAAC;AACnE,MAAM,CAAC,IAAM,aAAa,GAAG,0BAA0B,CAAC;AACxD,MAAM,CAAC,IAAM,WAAW,GACtB,sDAAsD,CAAC;AACzD,MAAM,CAAC,IAAM,cAAc,GACzB,8DAA8D,CAAC;AACjE,MAAM,CAAC,IAAM,yBAAyB,GACpC,gDAAgD,CAAC;AACnD,MAAM,CAAC,IAAM,yBAAyB,GAAG,gCAAgC,CAAC"}
|
package/dist/utils/http.js
CHANGED
|
@@ -35,7 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import fetch from "node-fetch";
|
|
38
|
-
import { EXPIRY_DATE_DELIMITER,
|
|
38
|
+
import { EXPIRY_DATE_DELIMITER, MBC_LIVE_PUBLIC_KEY_REGEX, NAS_LIVE_PUBLIC_KEY_REGEX, SANDBOX_BASE_URL, LIVE_BASE_URL, } from "../utils/constants";
|
|
39
39
|
export var tokenize = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
40
40
|
var pjson, response, json, error_1;
|
|
41
41
|
return __generator(this, function (_a) {
|
|
@@ -120,7 +120,7 @@ export var formatDataForTokenization = function (state, config) {
|
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
122
|
export var getEnvironment = function (key) {
|
|
123
|
-
return
|
|
123
|
+
return MBC_LIVE_PUBLIC_KEY_REGEX.test(key) || NAS_LIVE_PUBLIC_KEY_REGEX.test(key)
|
|
124
124
|
? LIVE_BASE_URL + "/tokens"
|
|
125
125
|
: SANDBOX_BASE_URL + "/tokens";
|
|
126
126
|
};
|
package/dist/utils/logger.js
CHANGED
|
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import { Platform } from "react-native";
|
|
49
|
-
import { LIVE_LOGGER, SANDBOX_LOGGER,
|
|
49
|
+
import { LIVE_LOGGER, SANDBOX_LOGGER, MBC_LIVE_PUBLIC_KEY_REGEX, NAS_LIVE_PUBLIC_KEY_REGEX, } from "./constants";
|
|
50
50
|
export var log = function (loglevel, type, config, extra) { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
51
|
var pjson, date, error_1;
|
|
52
52
|
return __generator(this, function (_a) {
|
|
@@ -67,8 +67,8 @@ export var log = function (loglevel, type, config, extra) { return __awaiter(voi
|
|
|
67
67
|
type: type,
|
|
68
68
|
source: "frames-react-native-sdk",
|
|
69
69
|
time: date.toISOString(),
|
|
70
|
-
data: __assign(__assign({}, extra), { os: Platform.OS, osVersion: Platform.Version, sdkVersion: pjson.version, environment:
|
|
71
|
-
|
|
70
|
+
data: __assign(__assign({}, extra), { os: Platform.OS, osVersion: Platform.Version, sdkVersion: pjson.version, environment: MBC_LIVE_PUBLIC_KEY_REGEX.test(config.publicKey) ||
|
|
71
|
+
NAS_LIVE_PUBLIC_KEY_REGEX.test(config.publicKey)
|
|
72
72
|
? "production"
|
|
73
73
|
: "sandbox" }),
|
|
74
74
|
cko: {
|
|
@@ -106,7 +106,7 @@ var generateUUID = function () {
|
|
|
106
106
|
});
|
|
107
107
|
};
|
|
108
108
|
export var getEnvironment = function (key) {
|
|
109
|
-
return
|
|
109
|
+
return MBC_LIVE_PUBLIC_KEY_REGEX.test(key) || NAS_LIVE_PUBLIC_KEY_REGEX.test(key)
|
|
110
110
|
? LIVE_LOGGER
|
|
111
111
|
: SANDBOX_LOGGER;
|
|
112
112
|
};
|