authscape 1.0.36 → 1.0.40

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.
@@ -28,25 +28,29 @@ export default function PaymentModal({title, description, amount, priceId, setIs
28
28
  const [paymentMethods, setPaymentMethods] = React.useState([]);
29
29
  const [paymentMethod, setPaymentMethod] = React.useState(null);
30
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
+
31
49
  useEffect(async () => {
32
50
 
33
51
  if (isOpen)
34
52
  {
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
- }
53
+ openModalEffect();
50
54
  }
51
55
 
52
56
  }, [isOpen]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.36",
3
+ "version": "1.0.40",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "index.js",