@a-tech.jo/atech_payment 1.0.15 → 1.0.17
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/.env.example +1 -0
- package/index.js +1 -2
- package/package.json +1 -1
- package/src/hyperpay/hyperpayOrder.js +2 -1
- package/src/shared/config.js +1 -2
- package/.env +0 -1
package/.env.example
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NEXT_PUBLIC_NODE_ENV="production|staging"
|
package/index.js
CHANGED
|
@@ -28,11 +28,10 @@ const PymentOrder = ({
|
|
|
28
28
|
return <div />;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const verifyCheckout = async (provider, checkoutId,
|
|
31
|
+
const verifyCheckout = async (provider, checkoutId, resoucePath) => {
|
|
32
32
|
if (provider === "hyperpay") {
|
|
33
33
|
const response = await hyperpayConnector.getOrderStatus(
|
|
34
34
|
checkoutId,
|
|
35
|
-
env,
|
|
36
35
|
resoucePath
|
|
37
36
|
);
|
|
38
37
|
console.log(response);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
import hyperpayConnector from "../shared/requests/hyperpayConnector.js";
|
|
3
3
|
import backendConnector from "../shared/requests/backendConnector.js";
|
|
4
|
+
import config from "../shared/config.js";
|
|
4
5
|
|
|
5
6
|
const HyperpayOrder = ({ redirectUrl, order }) => {
|
|
6
7
|
const [error, setError] = useState(null);
|
|
@@ -60,7 +61,7 @@ const HyperpayOrder = ({ redirectUrl, order }) => {
|
|
|
60
61
|
useEffect(() => {
|
|
61
62
|
if (checkoutId) {
|
|
62
63
|
const script = document.createElement("script");
|
|
63
|
-
script.src =
|
|
64
|
+
script.src = `${config?.HYPERPAY_BASE_URL}/v1/paymentWidgets.js?checkoutId=${checkoutId}`;
|
|
64
65
|
script.async = true;
|
|
65
66
|
script.crossOrigin = "anonymous";
|
|
66
67
|
document.body.appendChild(script);
|
package/src/shared/config.js
CHANGED
package/.env
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
NEXT_PUBLIC_NODE_ENV="production"
|