Query purchase fulfillment with identifier
parent
c15012afa7
commit
9607c3f83f
|
|
@ -42,8 +42,8 @@ export const startBuyFlow = (quantity: number) =>
|
||||||
AxiosResponse<{ url: string }, unknown, {}>
|
AxiosResponse<{ url: string }, unknown, {}>
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export const completeBuyFlow = () =>
|
export const completeBuyFlow = (purchaseId: string) =>
|
||||||
axios.post("/buy/complete", {}, getJwtHeader()) as Promise<
|
axios.post("/buy/complete", { purchaseId }, getJwtHeader()) as Promise<
|
||||||
AxiosResponse<{ url: string }, unknown, {}>
|
AxiosResponse<{ url: string }, unknown, {}>
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ export const Buy = () => {
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
value="10"
|
value="10"
|
||||||
control={<Radio />}
|
control={<Radio />}
|
||||||
label="10 tokens - 40"
|
label="10 tokens - 40€"
|
||||||
/>
|
/>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,10 @@ import { completeBuyFlow } from "../../api/client";
|
||||||
import { CircularProgress, Grid, Typography } from "@mui/material";
|
import { CircularProgress, Grid, Typography } from "@mui/material";
|
||||||
|
|
||||||
export const BuyReturn = () => {
|
export const BuyReturn = () => {
|
||||||
completeBuyFlow().then(
|
const purchaseId = new URL(window.location.href).searchParams.get(
|
||||||
|
"purchaseId",
|
||||||
|
)!;
|
||||||
|
completeBuyFlow(purchaseId).then(
|
||||||
(response) => (window.location.href = response.data.url),
|
(response) => (window.location.href = response.data.url),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue