authscape 1.0.48 → 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.48",
3
+ "version": "1.0.50",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -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,215 +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
- 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
- useEffect(async () => {
32
-
33
- if (isOpen)
34
- {
35
- let response = await ApiService().post("/StripePayment/ConnectCustomer", {
36
- paymentRequestType: 3,
37
- amount: amount,
38
- priceId: priceId
39
- });
40
-
41
- setOptions({
42
- clientSecret: response.data,
43
- });
44
-
45
- let responsePayments = await ApiService().get("/NCAInvoices/GetPaymentMethods");
46
- if (responsePayments != null && responsePayments.status == 200)
47
- {
48
- setPaymentMethods(responsePayments.data);
49
- }
50
- }
51
-
52
- }, [isOpen]);
53
-
54
- const handleChange = (event, newValue) => {
55
- setValue(newValue);
56
- };
57
-
58
- function a11yProps(index) {
59
- return {
60
- id: `simple-tab-${index}`,
61
- 'aria-controls': `simple-tabpanel-${index}`,
62
- };
63
- }
64
-
65
- const PaymentMethod = ({id, last4, clicked}) => {
66
- return (
67
- <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"}}
68
- onClick={() => {
69
- clicked(id);
70
- }}>
71
- <Typography gutterBottom variant="body" component="div" sx={{fontSize:14, position:"absolute", left:15, top:10, color:"white"}}>
72
- Visa
73
- </Typography>
74
- <Typography gutterBottom variant="body" component="div" sx={{verticalAlign:"middle", fontSize:18, color:"white"}}>
75
- * * * * &nbsp; * * * * &nbsp; * * * * &nbsp; {last4}
76
- </Typography>
77
-
78
- <Grid container spacing={1} sx={{position:"absolute", bottom:8, marginLeft:0, width: "100%"}}>
79
- <Grid item xs={6} sx={{paddingLeft:2}}>
80
- <Typography gutterBottom variant="body" component="div" sx={{textAlign:"left", fontSize:12, marginTop:1, paddingLeft:1, color:"#e9e9e9"}}>
81
- CARD HOLDER
82
- </Typography>
83
-
84
- <Typography gutterBottom variant="body" component="div" sx={{textAlign:"left", fontSize:12, marginTop:"-9px", paddingLeft:1, color:"white" }}>
85
- Brandon Zuech
86
- </Typography>
87
- </Grid>
88
- <Grid item xs={6} sx={{textAlign:"right", paddingRight:2}}>
89
- <Typography gutterBottom variant="body" component="div" sx={{fontSize:12, marginLeft:2, marginTop:1, color:"#e9e9e9"}}>
90
- EXPIRES
91
- </Typography>
92
-
93
- <Typography gutterBottom variant="body" component="div" sx={{fontSize:12, marginLeft:2, marginTop:"-9px", color:"white"}}>
94
- 08/21
95
- </Typography>
96
- </Grid>
97
- </Grid>
98
- </Box>
99
- );
100
- };
101
-
102
- function TabPanel(props) {
103
- const { children, value, index, ...other } = props;
104
-
105
- return (
106
- <div
107
- role="tabpanel"
108
- hidden={value !== index}
109
- id={`simple-tabpanel-${index}`}
110
- aria-labelledby={`simple-tab-${index}`}
111
- {...other}
112
- >
113
- {value === index && (
114
- <Box sx={{ p: 3 }}>
115
- <Typography>{children}</Typography>
116
- </Box>
117
- )}
118
- </div>
119
- );
120
- }
121
-
122
- return (
123
- <Dialog
124
- fullWidth={true}
125
- maxWidth={"sm"}
126
- open={isOpen}
127
- onClose={() => onModalClose()}>
128
- <DialogTitle>{title}
129
-
130
- <IconButton
131
- aria-label="close"
132
- onClick={() => {
133
-
134
- onModalClose();
135
- }}
136
- sx={{
137
- position: 'absolute',
138
- right: 8,
139
- top: 8,
140
- color: (theme) => theme.palette.grey[500],
141
- }}>
142
- <CloseIcon />
143
- </IconButton>
144
- </DialogTitle>
145
- <DialogContent>
146
- {description}
147
-
148
- <Box sx={{ width: '100%' }}>
149
- <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
150
- <Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
151
- <Tab label="Existing Payment Method" {...a11yProps(0)} />
152
- <Tab label="Add Payment Method" {...a11yProps(1)} />
153
- </Tabs>
154
- </Box>
155
- <TabPanel value={value} index={0}>
156
-
157
- <Select
158
- sx={{marginTop:4}}
159
- fullWidth={true}
160
- id="demo-simple-select"
161
- value={paymentMethod}
162
- onChange={(val) => {
163
- setPaymentMethod(val.target.value);
164
- }}>
165
- {paymentMethods != null && paymentMethods.map((paymentMethod) => {
166
- return (
167
- <MenuItem value={paymentMethod.id} fullWidth={true} sx={{width:"100%"}}>
168
- <PaymentMethod id={paymentMethod.id} last4={paymentMethod.last4} clicked={() => {
169
-
170
- }} />
171
- </MenuItem>)
172
- })}
173
- </Select>
174
-
175
- <Button startIcon={<PaymentRoundedIcon/>} type="submit" variant="contained" disabled={paymentMethod == null} sx={{marginTop:2}} onClick={async () => {
176
-
177
- setIsLoading(true);
178
- let response = await apiService().post("/NCAInvoices/PayInvoice", {
179
- InvoiceId: invoiceId,
180
- WalletId: paymentMethod
181
- });
182
- setIsLoading(false);
183
-
184
- if (response != null && response.status == 200)
185
- {
186
- window.location.reload();
187
- }
188
- else
189
- {
190
- alert("We had an issue with the payment method");
191
- }
192
-
193
-
194
- }}>Pay Now</Button>
195
-
196
- </TabPanel>
197
- <TabPanel value={value} index={1}>
198
- <div>
199
- <Box mt={4} mb={2}>
200
- {options != null &&
201
- <Elements stripe={stripePromise} options={options}>
202
- <CheckoutForm />
203
- </Elements>
204
- }
205
- </Box>
206
- </div>
207
- </TabPanel>
208
- </Box>
209
-
210
- </DialogContent>
211
- <DialogActions>
212
- </DialogActions>
213
- </Dialog>
214
- )
215
- }