Skip to content

Commit

Permalink
Updte getStripePaymentStatus endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNeshi committed Dec 14, 2023
1 parent ccebcc2 commit fc60bb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/pages/DonateFiatThanks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import { EMAIL_SUPPORT } from "constants/env";
import { appRoutes } from "constants/routes";

export default function DonateFiatThanks() {
const clientSecret = new URLSearchParams(window.location.search).get(
"payment_intent_client_secret"
const paymentIntentId = new URLSearchParams(window.location.search).get(
"payment_intent"
);

const queryState = useGetStripePaymentStatusQuery(
{ clientSecret: clientSecret ?? "" },
{ skip: !clientSecret }
{ paymentIntentId: paymentIntentId ?? "" },
{ skip: !paymentIntentId }
);

const { refetch } = queryState;
Expand Down
9 changes: 3 additions & 6 deletions src/services/apes/apes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { PaymentIntent } from "@stripe/stripe-js";
import { Token } from "types/aws";
import { ChainID } from "types/chain";
import { APIs } from "constants/urls";
import { version as v } from "../helpers";
import { tags } from "./tags";

type StripePaymentIntentParams = {
Expand All @@ -25,12 +24,10 @@ export const apes = createApi({
}),
getStripePaymentStatus: builder.query<
Pick<PaymentIntent, "status">,
{ clientSecret: string }
{ paymentIntentId: string }
>({
query: ({ clientSecret }) => ({
url: `${v(
1
)}/fiat/stripe-proxy/apes/staging/payment-status/${clientSecret}`,
query: ({ paymentIntentId }) => ({
url: `v2/fiat/stripe-proxy/apes/staging?paymentIntentId=${paymentIntentId}`,
}),
}),
createStripePaymentIntent: builder.mutation<
Expand Down

0 comments on commit fc60bb4

Please sign in to comment.