authscape 1.0.46 → 1.0.50
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "authscape",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.50",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@emotion/react": "^11.9.3",
|
|
14
14
|
"@emotion/styled": "^11.9.3",
|
|
15
|
-
"@mui/material": "^5.8.
|
|
15
|
+
"@mui/material": "^5.8.6",
|
|
16
16
|
"@stripe/react-stripe-js": "^1.9.0",
|
|
17
17
|
"@stripe/stripe-js": "^1.32.0",
|
|
18
18
|
"axios": "^0.27.2",
|
|
@@ -24,11 +24,5 @@
|
|
|
24
24
|
"react": "^18.2.0",
|
|
25
25
|
"react-data-table-component": "^7.5.2",
|
|
26
26
|
"react-dom": "^18.2.0"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@babel/core": "^7.18.6",
|
|
30
|
-
"@babel/preset-env": "^7.18.6",
|
|
31
|
-
"@babel/preset-react": "^7.18.6",
|
|
32
|
-
"babel-loader": "^8.2.5"
|
|
33
27
|
}
|
|
34
28
|
}
|
package/.babelrc
DELETED
|
@@ -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,229 +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 '@material-ui/core/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 '../pricing/CheckoutForm';
|
|
10
|
-
import ApiService from '../../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 '../../services/apiService';
|
|
21
|
-
import Grid from '@mui/material/Grid';
|
|
22
|
-
|
|
23
|
-
const 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 openModalEffect = 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
|
-
useEffect(() => {
|
|
50
|
-
|
|
51
|
-
if (isOpen)
|
|
52
|
-
{
|
|
53
|
-
openModalEffect();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
}, [isOpen]);
|
|
57
|
-
|
|
58
|
-
const handleChange = (event, newValue) => {
|
|
59
|
-
setValue(newValue);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
function a11yProps(index) {
|
|
63
|
-
return {
|
|
64
|
-
id: `simple-tab-${index}`,
|
|
65
|
-
'aria-controls': `simple-tabpanel-${index}`,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// const PaymentMethod = ({id, last4, clicked}) => {
|
|
70
|
-
// return (<div>
|
|
71
|
-
// <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"}}
|
|
72
|
-
// onClick={() => {
|
|
73
|
-
// clicked(id);
|
|
74
|
-
// }}>
|
|
75
|
-
// <Typography gutterBottom variant="body" component="div" sx={{fontSize:14, position:"absolute", left:15, top:10, color:"white"}}>
|
|
76
|
-
// Visa
|
|
77
|
-
// </Typography>
|
|
78
|
-
// {/* <Box sx={{position:"absolute", top:10, right:10, color:"#e9e9e9"}}>
|
|
79
|
-
// <DeleteRoundedIcon onClick={deleteClicked} />
|
|
80
|
-
// </Box> */}
|
|
81
|
-
// <Typography gutterBottom variant="body" component="div" sx={{verticalAlign:"middle", fontSize:18, color:"white"}}>
|
|
82
|
-
// * * * * * * * * * * * * {last4}
|
|
83
|
-
// </Typography>
|
|
84
|
-
|
|
85
|
-
// <Grid container spacing={1} sx={{position:"absolute", bottom:8, marginLeft:0, width: "100%"}}>
|
|
86
|
-
// <Grid item xs={6} sx={{paddingLeft:2}}>
|
|
87
|
-
// <Typography gutterBottom variant="body" component="div" sx={{textAlign:"left", fontSize:12, marginTop:1, paddingLeft:1, color:"#e9e9e9"}}>
|
|
88
|
-
// CARD HOLDER
|
|
89
|
-
// </Typography>
|
|
90
|
-
|
|
91
|
-
// <Typography gutterBottom variant="body" component="div" sx={{textAlign:"left", fontSize:12, marginTop:"-9px", paddingLeft:1, color:"white" }}>
|
|
92
|
-
// Brandon Zuech
|
|
93
|
-
// </Typography>
|
|
94
|
-
// </Grid>
|
|
95
|
-
// <Grid item xs={6} sx={{textAlign:"right", paddingRight:2}}>
|
|
96
|
-
// <Typography gutterBottom variant="body" component="div" sx={{fontSize:12, marginLeft:2, marginTop:1, color:"#e9e9e9"}}>
|
|
97
|
-
// EXPIRES
|
|
98
|
-
// </Typography>
|
|
99
|
-
|
|
100
|
-
// <Typography gutterBottom variant="body" component="div" sx={{fontSize:12, marginLeft:2, marginTop:"-9px", color:"white"}}>
|
|
101
|
-
// 08/21
|
|
102
|
-
// </Typography>
|
|
103
|
-
// </Grid>
|
|
104
|
-
// </Grid>
|
|
105
|
-
// </Box>
|
|
106
|
-
// </div>);
|
|
107
|
-
// };
|
|
108
|
-
|
|
109
|
-
// function TabPanel(props) {
|
|
110
|
-
// const { children, value, index, ...other } = props;
|
|
111
|
-
|
|
112
|
-
// return (
|
|
113
|
-
// <div
|
|
114
|
-
// role="tabpanel"
|
|
115
|
-
// hidden={value !== index}
|
|
116
|
-
// id={`simple-tabpanel-${index}`}
|
|
117
|
-
// aria-labelledby={`simple-tab-${index}`}
|
|
118
|
-
// {...other}
|
|
119
|
-
// >
|
|
120
|
-
// {value === index && (
|
|
121
|
-
// <Box sx={{ p: 3 }}>
|
|
122
|
-
// <Typography>{children}</Typography>
|
|
123
|
-
// </Box>
|
|
124
|
-
// )}
|
|
125
|
-
// </div>
|
|
126
|
-
// );
|
|
127
|
-
// }
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<div>
|
|
131
|
-
<Dialog
|
|
132
|
-
fullWidth={true}
|
|
133
|
-
maxWidth={"sm"}
|
|
134
|
-
open={isOpen}
|
|
135
|
-
onClose={() => onModalClose()}>
|
|
136
|
-
<DialogTitle>{title}
|
|
137
|
-
|
|
138
|
-
<IconButton
|
|
139
|
-
aria-label="close"
|
|
140
|
-
onClick={() => {
|
|
141
|
-
|
|
142
|
-
onModalClose();
|
|
143
|
-
}}
|
|
144
|
-
sx={{
|
|
145
|
-
position: 'absolute',
|
|
146
|
-
right: 8,
|
|
147
|
-
top: 8,
|
|
148
|
-
color: (theme) => theme.palette.grey[500],
|
|
149
|
-
}}>
|
|
150
|
-
<CloseIcon />
|
|
151
|
-
</IconButton>
|
|
152
|
-
</DialogTitle>
|
|
153
|
-
<DialogContent>
|
|
154
|
-
{description}
|
|
155
|
-
|
|
156
|
-
<Box sx={{ width: '100%' }}>
|
|
157
|
-
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
|
158
|
-
<Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
|
|
159
|
-
<Tab label="Existing Payment Method" {...a11yProps(0)} />
|
|
160
|
-
<Tab label="Add Payment Method" {...a11yProps(1)} />
|
|
161
|
-
</Tabs>
|
|
162
|
-
</Box>
|
|
163
|
-
{/* <TabPanel value={value} index={0}> */}
|
|
164
|
-
|
|
165
|
-
{/* <Select
|
|
166
|
-
sx={{marginTop:4}}
|
|
167
|
-
fullWidth={true}
|
|
168
|
-
id="demo-simple-select"
|
|
169
|
-
value={paymentMethod}
|
|
170
|
-
onChange={(val) => {
|
|
171
|
-
setPaymentMethod(val.target.value);
|
|
172
|
-
}}>
|
|
173
|
-
{paymentMethods != null && paymentMethods.map((paymentMethod) => {
|
|
174
|
-
return (
|
|
175
|
-
<MenuItem value={paymentMethod.id} fullWidth={true} sx={{width:"100%"}}>
|
|
176
|
-
|
|
177
|
-
<PaymentMethod id={paymentMethod.id} last4={paymentMethod.last4} clicked={() => {
|
|
178
|
-
|
|
179
|
-
}} />
|
|
180
|
-
|
|
181
|
-
</MenuItem>)
|
|
182
|
-
})}
|
|
183
|
-
</Select> */}
|
|
184
|
-
|
|
185
|
-
{/* <Button startIcon={<PaymentRoundedIcon/>} type="submit" variant="contained" disabled={paymentMethod == null} sx={{marginTop:2}} onClick={async () => {
|
|
186
|
-
|
|
187
|
-
setIsLoading(true);
|
|
188
|
-
let response = await apiService().post("/NCAInvoices/PayInvoice", {
|
|
189
|
-
InvoiceId: invoiceId,
|
|
190
|
-
WalletId: paymentMethod
|
|
191
|
-
});
|
|
192
|
-
setIsLoading(false);
|
|
193
|
-
|
|
194
|
-
if (response != null && response.status == 200)
|
|
195
|
-
{
|
|
196
|
-
window.location.reload();
|
|
197
|
-
}
|
|
198
|
-
else
|
|
199
|
-
{
|
|
200
|
-
alert("We had an issue with the payment method");
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}}>Pay Now</Button>
|
|
205
|
-
|
|
206
|
-
</TabPanel>
|
|
207
|
-
<TabPanel value={value} index={1}>
|
|
208
|
-
<div>
|
|
209
|
-
<Box mt={4} mb={2}>
|
|
210
|
-
{options != null &&
|
|
211
|
-
<Elements stripe={stripePromise} options={options}>
|
|
212
|
-
<CheckoutForm />
|
|
213
|
-
</Elements>
|
|
214
|
-
}
|
|
215
|
-
</Box>
|
|
216
|
-
</div>
|
|
217
|
-
</TabPanel> */}
|
|
218
|
-
</Box>
|
|
219
|
-
|
|
220
|
-
</DialogContent>
|
|
221
|
-
<DialogActions>
|
|
222
|
-
{/* <Button onClick={handleClose}>Close</Button> */}
|
|
223
|
-
</DialogActions>
|
|
224
|
-
</Dialog>
|
|
225
|
-
</div>
|
|
226
|
-
)
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export default PaymentModal;
|