@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 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, env, resoucePath) => {
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,6 @@
1
1
  {
2
2
  "name": "@a-tech.jo/atech_payment",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "type": "module",
5
5
  "description": "A-Tech Payment React Package",
6
6
  "source": "index.js",
@@ -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 = `https://eu-test.oppwa.com/v1/paymentWidgets.js?checkoutId=${checkoutId}`;
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);
@@ -1,5 +1,4 @@
1
- // const env = process.env.NEXT_PUBLIC_NODE_ENV || "production";
2
- const env = "production";
1
+ const env = process.env.NEXT_PUBLIC_NODE_ENV || "production";
3
2
  let config = {
4
3
  NODE_ENV: env,
5
4
  BACKEND_BASE_URL: "http://localhost:5000/api",
package/.env DELETED
@@ -1 +0,0 @@
1
- NEXT_PUBLIC_NODE_ENV="production"