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