Skip to content

Commit

Permalink
Merge pull request #8 from optile/PCPAY-2308
Browse files Browse the repository at this point in the history
Remove longId query param and the ability to use any env
  • Loading branch information
AnwerAR authored Aug 29, 2024
2 parents 5248092 + 2101d5b commit 41ce585
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/components/payment-methods/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,21 @@ export default function PaymentMethods() {
const [checkout, setCheckout] = useState(undefined);
const [activeNetwork, setActiveNetwork] = useState("");
const [searchParams] = useSearchParams();
const env = "pi-nightly.integration";

/**
* method, env, and longId are passed as URL query params
*/
const method = searchParams.get("method");
const env = searchParams.get("env") || "pi-nightly.integration";
const id = searchParams.get("longId");

useEffect(() => {
/**
* Use the longId passed by URL query param or generate a new list session.
* Generate a new list session.
*/
if (!id) {
generateList("EMBEDDED", 100, country, method || "").then((response) => {
setLongId(response?.identification?.longId);
});
} else {
setLongId(id);
}
}, [method, country, searchParams, id]);
}, [method, country]);

useEffect(() => {
/**
Expand Down

0 comments on commit 41ce585

Please sign in to comment.