fedapay-reactjs 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -3
- package/package.json +15 -36
- package/dist/FedaCheckoutButton.d.ts +0 -12
- package/dist/FedaCheckoutContainer.d.ts +0 -12
- package/dist/checkout-options.d.ts +0 -32
- package/dist/index.d.ts +0 -31
- package/dist/index.es.js +0 -107
- package/dist/index.es.js.map +0 -1
- package/dist/index.js +0 -113
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -20
package/README.md
CHANGED
@@ -8,8 +8,8 @@ From a command terminal type the following
|
|
8
8
|
npm install fedapay-reactjs --save
|
9
9
|
```
|
10
10
|
|
11
|
-
|
12
11
|
## Add the CheckoutJs script
|
12
|
+
|
13
13
|
Add the checkout.js script in your index.html file.
|
14
14
|
|
15
15
|
```html
|
@@ -26,7 +26,7 @@ Add the checkout.js script in your index.html file.
|
|
26
26
|
</noscript>
|
27
27
|
|
28
28
|
<div id="root"></div>
|
29
|
-
|
29
|
+
<!-- Load the FedaPay checkout.js -->
|
30
30
|
<script src="https://cdn.fedapay.com/checkout.js?v=1.1.2"></script>
|
31
31
|
</body>
|
32
32
|
</html>
|
@@ -34,7 +34,7 @@ Add the checkout.js script in your index.html file.
|
|
34
34
|
|
35
35
|
## Usage
|
36
36
|
|
37
|
-
```
|
37
|
+
```tsx
|
38
38
|
import React, { Component } from 'react';
|
39
39
|
import { FedaCheckoutButton, FedaCheckoutContainer } from 'fedapay-reactjs';
|
40
40
|
|
package/package.json
CHANGED
@@ -1,54 +1,33 @@
|
|
1
1
|
{
|
2
2
|
"name": "fedapay-reactjs",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.1.0",
|
4
4
|
"description": "FedaPay integration for ReactJs applications",
|
5
5
|
"author": "FedaPay",
|
6
6
|
"license": "MIT",
|
7
7
|
"repository": "https://github.com/fedapay/fedapay-reactjs",
|
8
|
-
"main": "
|
9
|
-
"module": "
|
10
|
-
"
|
8
|
+
"main": "./lib/cjs/index.js",
|
9
|
+
"module": "./lib/esm/index.js",
|
10
|
+
"types": "./lib/esm/index.d.ts",
|
11
11
|
"engines": {
|
12
12
|
"node": ">=8",
|
13
13
|
"npm": ">=5"
|
14
14
|
},
|
15
15
|
"scripts": {
|
16
|
-
"build": "
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"link-lib": "npm link && cd example && npm link fedapay-reactjs",
|
21
|
-
"install-example": "cd example && npm install",
|
22
|
-
"start-example": "cd example && npm run start"
|
23
|
-
},
|
24
|
-
"dependencies": {
|
25
|
-
"fs": "0.0.1-security",
|
26
|
-
"node-sass": "^4.12.0"
|
16
|
+
"build": "yarn build:esm && yarn build:cjs",
|
17
|
+
"build:esm": "tsc",
|
18
|
+
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
|
19
|
+
"prepublishOnly": "yarn build"
|
27
20
|
},
|
28
21
|
"peerDependencies": {
|
29
|
-
"
|
30
|
-
"react": "^
|
31
|
-
"react-dom": "^15.0.0 || ^16.0.0"
|
22
|
+
"react": "^18.3.1",
|
23
|
+
"react-dom": "^18.3.1"
|
32
24
|
},
|
33
25
|
"devDependencies": {
|
34
|
-
"@
|
35
|
-
"@types/react": "^
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"cross-env": "^5.1.4",
|
40
|
-
"gh-pages": "^1.2.0",
|
41
|
-
"react": "^16.4.1",
|
42
|
-
"react-dom": "^16.4.1",
|
43
|
-
"rollup": "^0.62.0",
|
44
|
-
"rollup-plugin-babel": "^3.0.7",
|
45
|
-
"rollup-plugin-commonjs": "^9.1.3",
|
46
|
-
"rollup-plugin-node-resolve": "^3.3.0",
|
47
|
-
"rollup-plugin-peer-deps-external": "^2.2.0",
|
48
|
-
"rollup-plugin-postcss": "^1.6.2",
|
49
|
-
"rollup-plugin-typescript2": "^0.17.0",
|
50
|
-
"rollup-plugin-url": "^1.4.0",
|
51
|
-
"typescript": "^2.8.3"
|
26
|
+
"@types/react": "^17.0.0",
|
27
|
+
"@types/react-dom": "^17.0.0",
|
28
|
+
"react": "^18.3.1",
|
29
|
+
"react-dom": "^18.3.1",
|
30
|
+
"typescript": "^4.9.5"
|
52
31
|
},
|
53
32
|
"files": [
|
54
33
|
"dist"
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import FedaPayCheckoutComponent, { CheckoutProps } from './index';
|
3
|
-
/**
|
4
|
-
* @class FedaCheckoutButton
|
5
|
-
*/
|
6
|
-
export default class FedaCheckoutButton extends FedaPayCheckoutComponent {
|
7
|
-
buttonRef: any;
|
8
|
-
constructor(props: CheckoutProps);
|
9
|
-
componentDidMount(): void;
|
10
|
-
initFedaPay(): void;
|
11
|
-
render(): JSX.Element;
|
12
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import FedaPayCheckoutComponent, { CheckoutProps } from './index';
|
3
|
-
/**
|
4
|
-
* @class FedaPayCheckoutComponent
|
5
|
-
*/
|
6
|
-
export default class FedaCheckoutContainer extends FedaPayCheckoutComponent {
|
7
|
-
containerRef: any;
|
8
|
-
constructor(props: CheckoutProps);
|
9
|
-
componentDidMount(): void;
|
10
|
-
initFedaPay(): void;
|
11
|
-
render(): JSX.Element;
|
12
|
-
}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
export default interface CheckoutOptions {
|
2
|
-
environment?: 'live' | 'production' | 'test' | 'sandbox' | 'dev' | 'local';
|
3
|
-
url?: string;
|
4
|
-
public_key?: string;
|
5
|
-
container?: string | HTMLElement | null;
|
6
|
-
trigger?: string;
|
7
|
-
locale?: 'en' | 'fr';
|
8
|
-
transaction: {
|
9
|
-
id?: number;
|
10
|
-
amount: number;
|
11
|
-
description: string;
|
12
|
-
custom_metadata?: any;
|
13
|
-
};
|
14
|
-
currency: {
|
15
|
-
iso: string;
|
16
|
-
code?: number;
|
17
|
-
};
|
18
|
-
customer?: {
|
19
|
-
firstname: string;
|
20
|
-
lastname: string;
|
21
|
-
email: string;
|
22
|
-
phone_number?: {
|
23
|
-
number: string;
|
24
|
-
country: string;
|
25
|
-
};
|
26
|
-
};
|
27
|
-
button?: {
|
28
|
-
text?: string;
|
29
|
-
class?: string;
|
30
|
-
};
|
31
|
-
onComplete?: any;
|
32
|
-
}
|
package/dist/index.d.ts
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import CheckoutOptions from './checkout-options';
|
3
|
-
export interface Props {
|
4
|
-
options: CheckoutOptions;
|
5
|
-
}
|
6
|
-
/**
|
7
|
-
* @class BaseComponent
|
8
|
-
*/
|
9
|
-
export declare class BaseComponent extends React.Component<Props> {
|
10
|
-
componentDidMount(): void;
|
11
|
-
}
|
12
|
-
/**
|
13
|
-
* @class FedaCheckoutButton
|
14
|
-
*/
|
15
|
-
export declare class FedaCheckoutButton extends BaseComponent {
|
16
|
-
buttonRef: any;
|
17
|
-
constructor(props: Props);
|
18
|
-
componentDidMount(): void;
|
19
|
-
initFedaPay(): void;
|
20
|
-
render(): JSX.Element;
|
21
|
-
}
|
22
|
-
/**
|
23
|
-
* @class FedaCheckoutContainer
|
24
|
-
*/
|
25
|
-
export declare class FedaCheckoutContainer extends BaseComponent {
|
26
|
-
containerRef: any;
|
27
|
-
constructor(props: Props);
|
28
|
-
componentDidMount(): void;
|
29
|
-
initFedaPay(): void;
|
30
|
-
render(): JSX.Element;
|
31
|
-
}
|
package/dist/index.es.js
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
import { Component, createRef, createElement } from 'react';
|
2
|
-
|
3
|
-
/*! *****************************************************************************
|
4
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
6
|
-
this file except in compliance with the License. You may obtain a copy of the
|
7
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
|
9
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
10
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
11
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
12
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
13
|
-
|
14
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
15
|
-
and limitations under the License.
|
16
|
-
***************************************************************************** */
|
17
|
-
/* global Reflect, Promise */
|
18
|
-
|
19
|
-
var extendStatics = function(d, b) {
|
20
|
-
extendStatics = Object.setPrototypeOf ||
|
21
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
22
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
23
|
-
return extendStatics(d, b);
|
24
|
-
};
|
25
|
-
|
26
|
-
function __extends(d, b) {
|
27
|
-
extendStatics(d, b);
|
28
|
-
function __() { this.constructor = d; }
|
29
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
30
|
-
}
|
31
|
-
|
32
|
-
var __assign = function() {
|
33
|
-
__assign = Object.assign || function __assign(t) {
|
34
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
35
|
-
s = arguments[i];
|
36
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
37
|
-
}
|
38
|
-
return t;
|
39
|
-
};
|
40
|
-
return __assign.apply(this, arguments);
|
41
|
-
};
|
42
|
-
|
43
|
-
/**
|
44
|
-
* @class BaseComponent
|
45
|
-
*/
|
46
|
-
var BaseComponent = /** @class */ (function (_super) {
|
47
|
-
__extends(BaseComponent, _super);
|
48
|
-
function BaseComponent() {
|
49
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
50
|
-
}
|
51
|
-
BaseComponent.prototype.componentDidMount = function () {
|
52
|
-
if (typeof FedaPay === 'undefined') {
|
53
|
-
throw new Error('checkout.js script need to be included!');
|
54
|
-
}
|
55
|
-
};
|
56
|
-
return BaseComponent;
|
57
|
-
}(Component));
|
58
|
-
/**
|
59
|
-
* @class FedaCheckoutButton
|
60
|
-
*/
|
61
|
-
var FedaCheckoutButton = /** @class */ (function (_super) {
|
62
|
-
__extends(FedaCheckoutButton, _super);
|
63
|
-
function FedaCheckoutButton(props) {
|
64
|
-
var _this = _super.call(this, props) || this;
|
65
|
-
_this.buttonRef = createRef();
|
66
|
-
return _this;
|
67
|
-
}
|
68
|
-
FedaCheckoutButton.prototype.componentDidMount = function () {
|
69
|
-
_super.prototype.componentDidMount.call(this);
|
70
|
-
this.initFedaPay();
|
71
|
-
};
|
72
|
-
FedaCheckoutButton.prototype.initFedaPay = function () {
|
73
|
-
FedaPay.init(this.buttonRef, this.props.options);
|
74
|
-
};
|
75
|
-
FedaCheckoutButton.prototype.render = function () {
|
76
|
-
var _this = this;
|
77
|
-
return (createElement("button", __assign({ ref: function (el) { return _this.buttonRef = el; } }, this.props), "Click to Pay"));
|
78
|
-
};
|
79
|
-
return FedaCheckoutButton;
|
80
|
-
}(BaseComponent));
|
81
|
-
/**
|
82
|
-
* @class FedaCheckoutContainer
|
83
|
-
*/
|
84
|
-
var FedaCheckoutContainer = /** @class */ (function (_super) {
|
85
|
-
__extends(FedaCheckoutContainer, _super);
|
86
|
-
function FedaCheckoutContainer(props) {
|
87
|
-
var _this = _super.call(this, props) || this;
|
88
|
-
_this.containerRef = createRef();
|
89
|
-
return _this;
|
90
|
-
}
|
91
|
-
FedaCheckoutContainer.prototype.componentDidMount = function () {
|
92
|
-
_super.prototype.componentDidMount.call(this);
|
93
|
-
this.initFedaPay();
|
94
|
-
};
|
95
|
-
FedaCheckoutContainer.prototype.initFedaPay = function () {
|
96
|
-
this.props.options.container = this.containerRef;
|
97
|
-
FedaPay.init(this.props.options);
|
98
|
-
};
|
99
|
-
FedaCheckoutContainer.prototype.render = function () {
|
100
|
-
var _this = this;
|
101
|
-
return (createElement("div", __assign({ ref: function (el) { return _this.containerRef = el; } }, this.props)));
|
102
|
-
};
|
103
|
-
return FedaCheckoutContainer;
|
104
|
-
}(BaseComponent));
|
105
|
-
|
106
|
-
export { BaseComponent, FedaCheckoutButton, FedaCheckoutContainer };
|
107
|
-
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../node_modules/tslib/tslib.es6.js","../src/index.tsx"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import * as React from 'react';\nimport CheckoutOptions from './checkout-options';\n\nexport interface Props {\n options: CheckoutOptions\n}\n\n/**\n * @class BaseComponent\n */\nexport class BaseComponent extends React.Component<Props> {\n componentDidMount() {\n if (typeof FedaPay === 'undefined') {\n throw new Error('checkout.js script need to be included!');\n }\n }\n}\n\n/**\n * @class FedaCheckoutButton\n */\nexport class FedaCheckoutButton extends BaseComponent {\n buttonRef: any;\n\n constructor(props: Props) {\n super(props);\n this.buttonRef = React.createRef();\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.initFedaPay();\n }\n\n initFedaPay() {\n FedaPay.init(this.buttonRef, this.props.options);\n }\n\n render() {\n return (\n <button ref={el => this.buttonRef = el} {...this.props}>\n Click to Pay\n </button>\n )\n }\n}\n\n/**\n * @class FedaCheckoutContainer\n */\nexport class FedaCheckoutContainer extends BaseComponent {\n containerRef: any;\n\n constructor(props: Props) {\n super(props);\n this.containerRef = React.createRef();\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.initFedaPay();\n }\n\n initFedaPay() {\n this.props.options.container = this.containerRef;\n FedaPay.init(this.props.options);\n }\n\n render() {\n return (\n <div ref={el => this.containerRef = el} {...this.props}></div>\n )\n }\n}\n"],"names":["tslib_1.__extends","React.Component","React.createRef","React.createElement"],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAgBA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IAC/B,aAAa,GAAG,MAAM,CAAC,cAAc;SAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;QAC5E,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/E,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC9B,CAAC;;AAEF,AAAO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAC5B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpB,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;CACxF;;AAED,AAAO,IAAI,QAAQ,GAAG,WAAW;IAC7B,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC,EAAE;QAC7C,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC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,KAAI,CAAC,YAAY,GAAGE,SAAe,EAAE,CAAC;;KACvC;IAED,iDAAiB,GAAjB;QACE,iBAAM,iBAAiB,WAAE,CAAC;QAC1B,IAAI,CAAC,WAAW,EAAE,CAAC;KACpB;IAED,2CAAW,GAAX;QACE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAClC;IAED,sCAAM,GAAN;QAAA,iBAIC;QAHC,QACEC,gCAAK,GAAG,EAAE,UAAA,EAAE,IAAI,OAAA,KAAI,CAAC,YAAY,GAAG,EAAE,GAAA,IAAM,IAAI,CAAC,KAAK,EAAQ,EAC/D;KACF;IACH,4BAAC;CAvBD,CAA2C,aAAa;;;;"}
|
package/dist/index.js
DELETED
@@ -1,113 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
var React = require('react');
|
6
|
-
|
7
|
-
/*! *****************************************************************************
|
8
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
10
|
-
this file except in compliance with the License. You may obtain a copy of the
|
11
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
|
13
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
15
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
16
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
17
|
-
|
18
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
19
|
-
and limitations under the License.
|
20
|
-
***************************************************************************** */
|
21
|
-
/* global Reflect, Promise */
|
22
|
-
|
23
|
-
var extendStatics = function(d, b) {
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
26
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
27
|
-
return extendStatics(d, b);
|
28
|
-
};
|
29
|
-
|
30
|
-
function __extends(d, b) {
|
31
|
-
extendStatics(d, b);
|
32
|
-
function __() { this.constructor = d; }
|
33
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
34
|
-
}
|
35
|
-
|
36
|
-
var __assign = function() {
|
37
|
-
__assign = Object.assign || function __assign(t) {
|
38
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
39
|
-
s = arguments[i];
|
40
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
41
|
-
}
|
42
|
-
return t;
|
43
|
-
};
|
44
|
-
return __assign.apply(this, arguments);
|
45
|
-
};
|
46
|
-
|
47
|
-
/**
|
48
|
-
* @class BaseComponent
|
49
|
-
*/
|
50
|
-
var BaseComponent = /** @class */ (function (_super) {
|
51
|
-
__extends(BaseComponent, _super);
|
52
|
-
function BaseComponent() {
|
53
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
54
|
-
}
|
55
|
-
BaseComponent.prototype.componentDidMount = function () {
|
56
|
-
if (typeof FedaPay === 'undefined') {
|
57
|
-
throw new Error('checkout.js script need to be included!');
|
58
|
-
}
|
59
|
-
};
|
60
|
-
return BaseComponent;
|
61
|
-
}(React.Component));
|
62
|
-
/**
|
63
|
-
* @class FedaCheckoutButton
|
64
|
-
*/
|
65
|
-
var FedaCheckoutButton = /** @class */ (function (_super) {
|
66
|
-
__extends(FedaCheckoutButton, _super);
|
67
|
-
function FedaCheckoutButton(props) {
|
68
|
-
var _this = _super.call(this, props) || this;
|
69
|
-
_this.buttonRef = React.createRef();
|
70
|
-
return _this;
|
71
|
-
}
|
72
|
-
FedaCheckoutButton.prototype.componentDidMount = function () {
|
73
|
-
_super.prototype.componentDidMount.call(this);
|
74
|
-
this.initFedaPay();
|
75
|
-
};
|
76
|
-
FedaCheckoutButton.prototype.initFedaPay = function () {
|
77
|
-
FedaPay.init(this.buttonRef, this.props.options);
|
78
|
-
};
|
79
|
-
FedaCheckoutButton.prototype.render = function () {
|
80
|
-
var _this = this;
|
81
|
-
return (React.createElement("button", __assign({ ref: function (el) { return _this.buttonRef = el; } }, this.props), "Click to Pay"));
|
82
|
-
};
|
83
|
-
return FedaCheckoutButton;
|
84
|
-
}(BaseComponent));
|
85
|
-
/**
|
86
|
-
* @class FedaCheckoutContainer
|
87
|
-
*/
|
88
|
-
var FedaCheckoutContainer = /** @class */ (function (_super) {
|
89
|
-
__extends(FedaCheckoutContainer, _super);
|
90
|
-
function FedaCheckoutContainer(props) {
|
91
|
-
var _this = _super.call(this, props) || this;
|
92
|
-
_this.containerRef = React.createRef();
|
93
|
-
return _this;
|
94
|
-
}
|
95
|
-
FedaCheckoutContainer.prototype.componentDidMount = function () {
|
96
|
-
_super.prototype.componentDidMount.call(this);
|
97
|
-
this.initFedaPay();
|
98
|
-
};
|
99
|
-
FedaCheckoutContainer.prototype.initFedaPay = function () {
|
100
|
-
this.props.options.container = this.containerRef;
|
101
|
-
FedaPay.init(this.props.options);
|
102
|
-
};
|
103
|
-
FedaCheckoutContainer.prototype.render = function () {
|
104
|
-
var _this = this;
|
105
|
-
return (React.createElement("div", __assign({ ref: function (el) { return _this.containerRef = el; } }, this.props)));
|
106
|
-
};
|
107
|
-
return FedaCheckoutContainer;
|
108
|
-
}(BaseComponent));
|
109
|
-
|
110
|
-
exports.BaseComponent = BaseComponent;
|
111
|
-
exports.FedaCheckoutButton = FedaCheckoutButton;
|
112
|
-
exports.FedaCheckoutContainer = FedaCheckoutContainer;
|
113
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.js","../src/index.tsx"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import * as React from 'react';\nimport CheckoutOptions from './checkout-options';\n\nexport interface Props {\n options: CheckoutOptions\n}\n\n/**\n * @class BaseComponent\n */\nexport class BaseComponent extends React.Component<Props> {\n componentDidMount() {\n if (typeof FedaPay === 'undefined') {\n throw new Error('checkout.js script need to be included!');\n }\n }\n}\n\n/**\n * @class FedaCheckoutButton\n */\nexport class FedaCheckoutButton extends BaseComponent {\n buttonRef: any;\n\n constructor(props: Props) {\n super(props);\n this.buttonRef = React.createRef();\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.initFedaPay();\n }\n\n initFedaPay() {\n FedaPay.init(this.buttonRef, this.props.options);\n }\n\n render() {\n return (\n <button ref={el => this.buttonRef = el} {...this.props}>\n Click to Pay\n </button>\n )\n }\n}\n\n/**\n * @class FedaCheckoutContainer\n */\nexport class FedaCheckoutContainer extends BaseComponent {\n containerRef: any;\n\n constructor(props: Props) {\n super(props);\n this.containerRef = React.createRef();\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.initFedaPay();\n }\n\n initFedaPay() {\n this.props.options.container = this.containerRef;\n FedaPay.init(this.props.options);\n }\n\n render() {\n return (\n <div ref={el => this.containerRef = el} {...this.props}></div>\n )\n }\n}\n"],"names":["tslib_1.__extends","React.Component","React.createRef","React.createElement"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;AAgBA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CA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,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAClC;IAED,sCAAM,GAAN;QAAA,iBAIC;QAHC,QACEC,sCAAK,GAAG,EAAE,UAAA,EAAE,IAAI,OAAA,KAAI,CAAC,YAAY,GAAG,EAAE,GAAA,IAAM,IAAI,CAAC,KAAK,EAAQ,EAC/D;KACF;IACH,4BAAC;CAvBD,CAA2C,aAAa;;;;;;"}
|
package/dist/package.json
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "fedapay-reactjs",
|
3
|
-
"version": "1.0.0",
|
4
|
-
"description": "FedaPay integration for ReactJs applications",
|
5
|
-
"author": "FedaPay",
|
6
|
-
"license": "MIT",
|
7
|
-
"repository": "https://github.com/fedapay/fedapay-reactjs",
|
8
|
-
"main": "dist/index.js",
|
9
|
-
"module": "dist/index.es.js",
|
10
|
-
"jsnext:main": "dist/index.es.js",
|
11
|
-
"engines": {
|
12
|
-
"node": ">=8",
|
13
|
-
"npm": ">=5"
|
14
|
-
},
|
15
|
-
"peerDependencies": {
|
16
|
-
"prop-types": "^15.5.4",
|
17
|
-
"react": "^15.0.0 || ^16.0.0",
|
18
|
-
"react-dom": "^15.0.0 || ^16.0.0"
|
19
|
-
}
|
20
|
-
}
|