브랜드 페이 redirectUrl 관련 문의입니다

. 츠 sdk .
중 redirectUrl 한 Access Token .

이 GET로 redirectUrl에 code, customerKey , 래 2이 redirectUrl및 api ,
redirectUrl.
게 TOO_MANY_REQUESTS .


.

1. 트 URL (http://localhost:7001/toss-payment/bp-auth)
2. FE서 redirectUrl 로 BE.
// FE에서 구현한 페이지 코드 로직
import { useMutation } from "@apollo/client";
...

export const TossBrandPayAccessTokenApiRedirect: React.FC = () => {
  const [apiFunc] = useMutation(apiMutation);

  useEffect(() => {
    const urlParams = new URLSearchParams(window.location.search);
    const code = urlParams.get("code");
    const customerKey = urlParams.get("customerKey");
    apiFunc({ variables: { code, customerKey } });
  }, []);

  return <></>;
};

3. BE은 variables로 Access Token 한 api (~/v1/brandpay/authorizations/access-token)

// index.tsx
import * as React from "react";
import ReactDOM from "react-dom/client";

import App from "./app/App";

const root = ReactDOM.createRoot(document.getElementById("root"));

const startApp = async () => {
  root.render(<App />);
};

startApp();
image.png
image.png
Was this page helpful?