@a-tech.jo/atech_payment 1.0.14 → 1.0.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a-tech.jo/atech_payment",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
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,4 +1,4 @@
1
- const env = process.env.NEXT_PUBLIC_NODE_ENV || "staging";
1
+ const env = process.env.NEXT_PUBLIC_NODE_ENV || "production";
2
2
  let config = {
3
3
  NODE_ENV: env,
4
4
  BACKEND_BASE_URL: "http://localhost:5000/api",
package/.env DELETED
@@ -1 +0,0 @@
1
- NEXT_PUBLIC_NODE_ENV="production"