|
|
|
@@ -0,0 +1,77 @@ |
|
|
|
import { Box, Button, Stack, Typography } from "@mui/material"; |
|
|
|
import { Dictionary } from "@types"; |
|
|
|
import { getRegisterBankAccountStartParam } from "api/customer"; |
|
|
|
import useAPICall from "hooks/useAPICall"; |
|
|
|
import useAuth from "hooks/useAuth"; |
|
|
|
import useDashboard from "hooks/useDashBoard"; |
|
|
|
import { get } from "lodash"; |
|
|
|
import { PageID, TabID } from "pages"; |
|
|
|
import { useEffect, useState } from "react"; |
|
|
|
|
|
|
|
export default function BankRegister() { |
|
|
|
const { setHeaderTitle, setTabs } = useDashboard( |
|
|
|
PageID.DASHBOARD_USER_BANK_REGISTER, |
|
|
|
TabID.NONE |
|
|
|
); |
|
|
|
const { user, authenticated } = useAuth(); |
|
|
|
|
|
|
|
const [url, setUrl] = useState(""); |
|
|
|
const [param, setParam] = useState<Dictionary>({}); |
|
|
|
|
|
|
|
const { callAPI: callGetRegisterBankAccountStartParam } = useAPICall({ |
|
|
|
apiMethod: getRegisterBankAccountStartParam, |
|
|
|
backDrop: true, |
|
|
|
onSuccess: ({ data }) => { |
|
|
|
setParam(data.param); |
|
|
|
setUrl(data.url); |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (authenticated) { |
|
|
|
callGetRegisterBankAccountStartParam({}); |
|
|
|
} |
|
|
|
}, [authenticated]); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setHeaderTitle("口座情報登録"); |
|
|
|
setTabs(null); |
|
|
|
}, []); |
|
|
|
|
|
|
|
if (!user) return null; |
|
|
|
|
|
|
|
return ( |
|
|
|
<Box mt={3}> |
|
|
|
<Stack spacing={4}> |
|
|
|
<Box> |
|
|
|
<form |
|
|
|
method="post" |
|
|
|
acceptCharset="shift_jis" |
|
|
|
action={url} |
|
|
|
target="_blank" |
|
|
|
> |
|
|
|
{Object.keys(param).map((name, index) => { |
|
|
|
const value: string = get(param, name); |
|
|
|
return ( |
|
|
|
<input type="hidden" name={name} value={value} key={index} /> |
|
|
|
); |
|
|
|
})} |
|
|
|
|
|
|
|
<Button type="submit" variant="contained"> |
|
|
|
口座振替用のページへ移動する(外部サイト) |
|
|
|
</Button> |
|
|
|
</form> |
|
|
|
</Box> |
|
|
|
<Box> |
|
|
|
<Typography variant="body2"> |
|
|
|
*遷移先でエラーが発生する場合、ご利用者様の登録情報に不備がある可能性があります。 |
|
|
|
登録済みの氏名、氏名カナをご確認ください。 |
|
|
|
</Typography> |
|
|
|
<Typography variant="body2"> |
|
|
|
*それでも解決しない場合は、恐れ入りますがお問い合わせください。 |
|
|
|
</Typography> |
|
|
|
</Box> |
|
|
|
</Stack> |
|
|
|
</Box> |
|
|
|
); |
|
|
|
} |