authscape 1.0.55 → 1.0.60

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/.babelrc CHANGED
@@ -1,3 +1,3 @@
1
- {
2
- "presets": ["@babel/preset-react", "@babel/preset-env"]
1
+ {
2
+ "presets": ["@babel/preset-react", "@babel/preset-env"]
3
3
  }
package/index.js CHANGED
@@ -1,13 +1,51 @@
1
- import React, { Component } from 'react';
2
-
3
- export default class DummyComponent extends Component {
4
-
5
- render () {
6
-
7
- return (
8
- <div>I am a dummy react npm module</div>
9
- )
10
-
11
- }
12
-
13
- }
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
11
+
12
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13
+
14
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
+
16
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
17
+
18
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
19
+
20
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
21
+
22
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
23
+
24
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
25
+
26
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
27
+
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
+
30
+ var DummyComponent =
31
+ /*#__PURE__*/
32
+ function (_Component) {
33
+ _inherits(DummyComponent, _Component);
34
+
35
+ function DummyComponent() {
36
+ _classCallCheck(this, DummyComponent);
37
+
38
+ return _possibleConstructorReturn(this, _getPrototypeOf(DummyComponent).apply(this, arguments));
39
+ }
40
+
41
+ _createClass(DummyComponent, [{
42
+ key: "render",
43
+ value: function render() {
44
+ return _react.default.createElement("div", null, "I am a dummy react npm module");
45
+ }
46
+ }]);
47
+
48
+ return DummyComponent;
49
+ }(_react.Component);
50
+
51
+ exports.default = DummyComponent;
package/package.json CHANGED
@@ -1,33 +1,24 @@
1
- {
2
- "name": "authscape",
3
- "version": "1.0.55",
4
- "description": "",
5
- "type": "module",
6
- "main": "index.js",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1"
9
- },
10
- "author": "zuechb",
11
- "license": "ISC",
12
- "dependencies": {
13
- "@babel/cli": "^7.18.6",
14
- "@babel/core": "^7.18.6",
15
- "@babel/preset-env": "^7.18.6",
16
- "@babel/preset-react": "^7.18.6",
17
- "@emotion/react": "^11.9.3",
18
- "@emotion/styled": "^11.9.3",
19
- "@mui/icons-material": "^5.8.4",
20
- "@mui/material": "^5.8.6",
21
- "@stripe/react-stripe-js": "^1.9.0",
22
- "@stripe/stripe-js": "^1.32.0",
23
- "axios": "^0.27.2",
24
- "js-file-download": "^0.4.12",
25
- "next": "^12.1.6",
26
- "next-cookies": "^2.0.3",
27
- "nookies": "^2.5.2",
28
- "querystring": "^0.2.1",
29
- "react": "^18.2.0",
30
- "react-data-table-component": "^7.5.2",
31
- "react-dom": "^18.2.0"
32
- }
33
- }
1
+ {
2
+ "name": "authscape",
3
+ "version": "1.0.60",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build": "./node_modules/.bin/babel src --out-file index.js"
9
+ },
10
+ "author": "zuechb",
11
+ "license": "ISC",
12
+ "peerDependencies": {
13
+ "react": "^16.6.1",
14
+ "react-dom": "^16.6.3"
15
+ },
16
+ "devDependencies": {
17
+ "@babel/cli": "^7.1.5",
18
+ "@babel/core": "^7.1.6",
19
+ "@babel/preset-env": "^7.1.6",
20
+ "@babel/preset-react": "^7.0.0",
21
+ "react": "^16.6.1",
22
+ "react-dom": "^16.6.3"
23
+ }
24
+ }
package/readme.md ADDED
@@ -0,0 +1,13 @@
1
+ Dummy react component
2
+ ====
3
+
4
+ This will be a how to guide for your fellow developers
5
+
6
+ ```
7
+ <DummyComponent />
8
+ ```
9
+
10
+ etc
11
+ ===
12
+
13
+ Thanks
package/src/index.js ADDED
@@ -0,0 +1,13 @@
1
+ import React, { Component } from 'react';
2
+
3
+ export default class DummyComponent extends Component {
4
+
5
+ render () {
6
+
7
+ return (
8
+ <div>I am a dummy react npm module</div>
9
+ )
10
+
11
+ }
12
+
13
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,118 +0,0 @@
1
- import React, { Component } from 'react';
2
- import apiService from '../services/apiService';
3
- import DataTable, {createTheme} from "react-data-table-component";
4
-
5
- export default class Datatable extends Component {
6
-
7
- static defaultProps = {
8
- options: {}
9
- }
10
-
11
- constructor(props) {
12
- super(props);
13
-
14
- this.state = {
15
- pageNumber : 1,
16
- pageLength : props.pageLength ? props.pageLength : 10,
17
- data: [],
18
- loading: false,
19
- totalRows: 0
20
- };
21
- }
22
-
23
- componentDidMount = async () => {
24
- await this.GetDataFromUrl(this.state.pageNumber, this.state.pageLength, this.props.params);
25
- createTheme('dataTable', {
26
- text:{
27
-
28
- }
29
- })
30
- }
31
-
32
- reload = async (reset = false) => {
33
-
34
- if (reset === true)
35
- {
36
- this.setState({pageNumber: 1}, async () => {
37
- await this.GetDataFromUrl(this.state.pageNumber, this.state.pageLength, this.props.params);
38
- })
39
- }
40
- else
41
- {
42
- await this.GetDataFromUrl(this.state.pageNumber, this.state.pageLength, this.props.params);
43
- }
44
-
45
-
46
- }
47
-
48
- GetDataFromUrl = (page, length, postData = {}) => {
49
-
50
- this.setState({
51
- loading: true
52
- }, async function () {
53
-
54
- let data = postData;
55
-
56
- data.offset = page;
57
- data.length = length;
58
-
59
- let response = null;
60
- if (this.props.methodType == "get")
61
- {
62
- response = await apiService().get(this.props.url);
63
- }
64
- else
65
- {
66
- response = await apiService().post(this.props.url, postData);
67
- }
68
-
69
- if (response != null && response.status === 200)
70
- {
71
- if (this.props.returnResult != null)
72
- {
73
- this.props.returnResult(response.data.data);
74
- }
75
-
76
- this.setState({
77
- totalRows: response.data.recordsTotal,
78
- data: response.data.data,
79
- loading: false
80
- });
81
- }
82
- else
83
- {
84
- //console.error(response.status + " - " + response.data);
85
- }
86
-
87
- });
88
-
89
- }
90
-
91
- handlePageChange = async page => {
92
- const { pageLength } = this.state;
93
- this.setState({pageNumber: page});
94
- await this.GetDataFromUrl(page, pageLength, this.props.params);
95
- };
96
-
97
- render() {
98
-
99
- return (
100
- <div>
101
- <DataTable
102
- title={this.props.title}
103
- columns={this.props.columns}
104
- data={this.state.data}
105
- paginationRowsPerPageOptions={this.props.pageLength ? [this.props.pageLength] : [10]}
106
- progressPending={this.state.loading}
107
- customStyles={this.props.customStyles}
108
- paginationPerPage={this.props.pageLength ? this.props.pageLength : 10}
109
- paginationServer
110
- pagination
111
- paginationTotalRows={this.state.totalRows}
112
- // onChangeRowsPerPage={this.handlePerRowsChange}
113
- onChangePage={this.handlePageChange}
114
- noDataComponent={this.props.noDataComponent}
115
- />
116
- </div>);
117
- }
118
- }
@@ -1,55 +0,0 @@
1
- import React, {useState} from 'react';
2
- import Button from '@mui/material/Button';
3
- import {useStripe, useElements, PaymentElement} from '@stripe/react-stripe-js';
4
- import PaymentRoundedIcon from '@mui/icons-material/PaymentRounded';
5
-
6
- const CheckoutForm = () => {
7
- const stripe = useStripe();
8
- const elements = useElements();
9
-
10
- const [errorMessage, setErrorMessage] = useState(null);
11
-
12
- const handleSubmit = async (event) => {
13
-
14
- // We don't want to let default form submission happen here,
15
- // which would refresh the page.
16
- event.preventDefault();
17
-
18
- if (!stripe || !elements) {
19
- // Stripe.js has not yet loaded.
20
- // Make sure to disable form submission until Stripe.js has loaded.
21
- return;
22
- }
23
-
24
- const {error} = await stripe.confirmPayment({
25
- //`Elements` instance that was used to create the Payment Element
26
- elements,
27
- confirmParams: {
28
- return_url: process.env.WebsiteBaseUri + '/confirmPayment?redirectUrl=' + encodeURIComponent(window.location.href),
29
- },
30
- });
31
-
32
- if (error) {
33
- // This point will only be reached if there is an immediate error when
34
- // confirming the payment. Show error to your customer (for example, payment
35
- // details incomplete)
36
- setErrorMessage(error.message);
37
- } else {
38
- // Your customer will be redirected to your `return_url`. For some payment
39
- // methods like iDEAL, your customer will be redirected to an intermediate
40
- // site first to authorize the payment, then redirected to the `return_url`.
41
-
42
- }
43
- };
44
-
45
- return (
46
- <form onSubmit={handleSubmit}>
47
- <PaymentElement />
48
- <Button startIcon={<PaymentRoundedIcon/>} type="submit" variant="contained" disabled={!stripe} sx={{marginTop:2}}>Pay Now</Button>
49
- {/* Show error message to your customers */}
50
- {errorMessage && <div>{errorMessage}</div>}
51
- </form>
52
- )
53
- };
54
-
55
- export default CheckoutForm;
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import Button from '@mui/material/Button';
3
- import Dialog from '@mui/material/Dialog';
4
- import DialogActions from '@mui/material/DialogActions';
5
- import DialogContent from '@mui/material/DialogContent';
6
- import DialogContentText from '@mui/material/DialogContentText';
7
- import DialogTitle from '@mui/material/DialogTitle';
8
-
9
- export default function confirmationModal({title, description, cancelClicked, okClicked, open = false, cancelTitle = "Cancel", okTitle = "OK"}) {
10
- return (
11
- <Dialog
12
- open={open}
13
- onClose={cancelClicked}
14
- aria-labelledby="alert-dialog-title"
15
- aria-describedby="alert-dialog-description">
16
- <DialogTitle id="alert-dialog-title">
17
- {title}
18
- </DialogTitle>
19
- <DialogContent>
20
- <DialogContentText id="alert-dialog-description">
21
- {description}
22
- </DialogContentText>
23
- </DialogContent>
24
- <DialogActions>
25
- <Button onClick={cancelClicked}>{cancelTitle}</Button>
26
- <Button onClick={okClicked}>
27
- {okTitle}
28
- </Button>
29
- </DialogActions>
30
- </Dialog>
31
- );
32
- }
@@ -1,220 +0,0 @@
1
- import React, {useEffect, useState} from 'react';
2
- import {Elements} from '@stripe/react-stripe-js';
3
- import {loadStripe} from '@stripe/stripe-js';
4
- import Box from '@mui/material/Box';
5
- import Dialog from '@mui/material/Dialog';
6
- import DialogActions from '@mui/material/DialogActions';
7
- import DialogContent from '@mui/material/DialogContent';
8
- import DialogTitle from '@mui/material/DialogTitle';
9
- import CheckoutForm from './checkoutForm';
10
- import ApiService from 'authscape/services/apiService';
11
- import IconButton from '@mui/material/IconButton';
12
- import CloseIcon from '@mui/icons-material/Close';
13
- import Tabs from '@mui/material/Tabs';
14
- import Tab from '@mui/material/Tab';
15
- import Typography from '@mui/material/Typography';
16
- import Select from '@mui/material/Select';
17
- import MenuItem from '@mui/material/MenuItem';
18
- import Button from '@mui/material/Button';
19
- import PaymentRoundedIcon from '@mui/icons-material/PaymentRounded';
20
- import apiService from 'authscape/services/apiService';
21
- import Grid from '@mui/material/Grid';
22
-
23
- export default function PaymentModal({title, description, amount, priceId, setIsLoading, isOpen, invoiceId, onModalClose}) {
24
-
25
- const stripePromise = loadStripe(process.env.stripePublicKey);
26
- const [options, setOptions] = useState(null);
27
- const [value, setValue] = React.useState(0);
28
- const [paymentMethods, setPaymentMethods] = React.useState([]);
29
- const [paymentMethod, setPaymentMethod] = React.useState(null);
30
-
31
- const paymentMethodOpened = async () => {
32
- let response = await ApiService().post("/StripePayment/ConnectCustomer", {
33
- paymentRequestType: 3,
34
- amount: amount,
35
- priceId: priceId
36
- });
37
-
38
- setOptions({
39
- clientSecret: response.data,
40
- });
41
-
42
- let responsePayments = await ApiService().get("/NCAInvoices/GetPaymentMethods");
43
- if (responsePayments != null && responsePayments.status == 200)
44
- {
45
- setPaymentMethods(responsePayments.data);
46
- }
47
- }
48
-
49
-
50
- useEffect(() => {
51
-
52
- if (isOpen)
53
- {
54
- paymentMethodOpened();
55
- }
56
-
57
- }, [isOpen]);
58
-
59
- const handleChange = (event, newValue) => {
60
- setValue(newValue);
61
- };
62
-
63
- function a11yProps(index) {
64
- return {
65
- id: `simple-tab-${index}`,
66
- 'aria-controls': `simple-tabpanel-${index}`,
67
- };
68
- }
69
-
70
- const PaymentMethod = ({id, last4, clicked}) => {
71
- return (
72
- <Box fullWidth={true} sx={{height: 160, width:"100%", marginTop:2, backgroundColor:"#2196F3", position:"relative", border: "1px solid #2196F3", borderRadius: 1, display:"flex", flexDirection:"column", justifyContent:"center", textAlign:"center", cursor:"pointer"}}
73
- onClick={() => {
74
- clicked(id);
75
- }}>
76
- <Typography gutterBottom variant="body" component="div" sx={{fontSize:14, position:"absolute", left:15, top:10, color:"white"}}>
77
- Visa
78
- </Typography>
79
- <Typography gutterBottom variant="body" component="div" sx={{verticalAlign:"middle", fontSize:18, color:"white"}}>
80
- * * * * &nbsp; * * * * &nbsp; * * * * &nbsp; {last4}
81
- </Typography>
82
-
83
- <Grid container spacing={1} sx={{position:"absolute", bottom:8, marginLeft:0, width: "100%"}}>
84
- <Grid item xs={6} sx={{paddingLeft:2}}>
85
- <Typography gutterBottom variant="body" component="div" sx={{textAlign:"left", fontSize:12, marginTop:1, paddingLeft:1, color:"#e9e9e9"}}>
86
- CARD HOLDER
87
- </Typography>
88
-
89
- <Typography gutterBottom variant="body" component="div" sx={{textAlign:"left", fontSize:12, marginTop:"-9px", paddingLeft:1, color:"white" }}>
90
- Brandon Zuech
91
- </Typography>
92
- </Grid>
93
- <Grid item xs={6} sx={{textAlign:"right", paddingRight:2}}>
94
- <Typography gutterBottom variant="body" component="div" sx={{fontSize:12, marginLeft:2, marginTop:1, color:"#e9e9e9"}}>
95
- EXPIRES
96
- </Typography>
97
-
98
- <Typography gutterBottom variant="body" component="div" sx={{fontSize:12, marginLeft:2, marginTop:"-9px", color:"white"}}>
99
- 08/21
100
- </Typography>
101
- </Grid>
102
- </Grid>
103
- </Box>
104
- );
105
- };
106
-
107
- function TabPanel(props) {
108
- const { children, value, index, ...other } = props;
109
-
110
- return (
111
- <div
112
- role="tabpanel"
113
- hidden={value !== index}
114
- id={`simple-tabpanel-${index}`}
115
- aria-labelledby={`simple-tab-${index}`}
116
- {...other}
117
- >
118
- {value === index && (
119
- <Box sx={{ p: 3 }}>
120
- <Typography>{children}</Typography>
121
- </Box>
122
- )}
123
- </div>
124
- );
125
- }
126
-
127
- return (
128
- <Dialog
129
- fullWidth={true}
130
- maxWidth={"sm"}
131
- open={isOpen}
132
- onClose={() => onModalClose()}>
133
- <DialogTitle>{title}
134
-
135
- <IconButton
136
- aria-label="close"
137
- onClick={() => {
138
-
139
- onModalClose();
140
- }}
141
- sx={{
142
- position: 'absolute',
143
- right: 8,
144
- top: 8,
145
- color: (theme) => theme.palette.grey[500],
146
- }}>
147
- <CloseIcon />
148
- </IconButton>
149
- </DialogTitle>
150
- <DialogContent>
151
- {description}
152
-
153
- <Box sx={{ width: '100%' }}>
154
- <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
155
- <Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
156
- <Tab label="Existing Payment Method" {...a11yProps(0)} />
157
- <Tab label="Add Payment Method" {...a11yProps(1)} />
158
- </Tabs>
159
- </Box>
160
- <TabPanel value={value} index={0}>
161
-
162
- <Select
163
- sx={{marginTop:4}}
164
- fullWidth={true}
165
- id="demo-simple-select"
166
- value={paymentMethod}
167
- onChange={(val) => {
168
- setPaymentMethod(val.target.value);
169
- }}>
170
- {paymentMethods != null && paymentMethods.map((paymentMethod) => {
171
- return (
172
- <MenuItem value={paymentMethod.id} fullWidth={true} sx={{width:"100%"}}>
173
- <PaymentMethod id={paymentMethod.id} last4={paymentMethod.last4} clicked={() => {
174
-
175
- }} />
176
- </MenuItem>)
177
- })}
178
- </Select>
179
-
180
- <Button startIcon={<PaymentRoundedIcon/>} type="submit" variant="contained" disabled={paymentMethod == null} sx={{marginTop:2}} onClick={async () => {
181
-
182
- setIsLoading(true);
183
- let response = await apiService().post("/NCAInvoices/PayInvoice", {
184
- InvoiceId: invoiceId,
185
- WalletId: paymentMethod
186
- });
187
- setIsLoading(false);
188
-
189
- if (response != null && response.status == 200)
190
- {
191
- window.location.reload();
192
- }
193
- else
194
- {
195
- alert("We had an issue with the payment method");
196
- }
197
-
198
-
199
- }}>Pay Now</Button>
200
-
201
- </TabPanel>
202
- <TabPanel value={value} index={1}>
203
- <div>
204
- <Box mt={4} mb={2}>
205
- {options != null &&
206
- <Elements stripe={stripePromise} options={options}>
207
- <CheckoutForm />
208
- </Elements>
209
- }
210
- </Box>
211
- </div>
212
- </TabPanel>
213
- </Box>
214
-
215
- </DialogContent>
216
- <DialogActions>
217
- </DialogActions>
218
- </Dialog>
219
- )
220
- }
package/webpack.config.js DELETED
File without changes