You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 line
2.1KB

  1. import { Dictionary } from "@types";
  2. import { APICommonResponse, ApiId, HttpMethod, makeParam, request } from "api";
  3. import { getUrl } from "./url";
  4. // -------Email変更手続き開始---------------
  5. export type StartChangeEmailRequest = {
  6. new_email: string;
  7. };
  8. export const startChangeEmail = async (param: StartChangeEmailRequest) => {
  9. const sendData = makeParam(param);
  10. const res = await request({
  11. url: getUrl(ApiId.START_CHANGE_EMAIL),
  12. method: HttpMethod.POST,
  13. data: sendData,
  14. });
  15. return res;
  16. };
  17. // -------Email変更手続き認証---------------
  18. export type VerifyChangeEmailRequest = {
  19. token: string;
  20. };
  21. export const verifyChangeEmail = async (param: VerifyChangeEmailRequest) => {
  22. const sendData = makeParam(param);
  23. const res = await request({
  24. url: getUrl(ApiId.VERIFY_CHANGE_EMAIL),
  25. method: HttpMethod.POST,
  26. data: sendData,
  27. });
  28. return res;
  29. };
  30. // -------利用者情報変更申請---------------
  31. export type UpdateCustomerInfoOrderParam = {
  32. name: string;
  33. name_kana: string;
  34. zip_code: string;
  35. address: string;
  36. phone_no: string;
  37. memo?: string;
  38. };
  39. export const orderCustomerInfoUpdate = async (
  40. param: UpdateCustomerInfoOrderParam
  41. ) => {
  42. const sendData = makeParam(param);
  43. const res = await request({
  44. url: getUrl(ApiId.CUSTOMER_UPDATE_INFO_ORDER),
  45. method: HttpMethod.POST,
  46. data: sendData,
  47. });
  48. return res;
  49. };
  50. // -------口座振替登録用パラメータ取得---------------
  51. export type GetRegisterBankAccountStartParamResponse = {
  52. data: {
  53. url: string;
  54. param: Dictionary;
  55. };
  56. } & APICommonResponse;
  57. export const getRegisterBankAccountStartParam = async () => {
  58. const res = await request<GetRegisterBankAccountStartParamResponse>({
  59. url: getUrl(ApiId.CUSTOMER_REGISTER_BANK_ACCOUNT_START_PARAM),
  60. method: HttpMethod.GET,
  61. });
  62. return res;
  63. };
  64. // -------クレジットカード利用申請---------------
  65. export const orderChangePaymentMetodCreditcard = async (param: {}) => {
  66. const res = await request({
  67. url: getUrl(ApiId.CUSTOMER_CHANGE_PAYMENT_METHOD_CREDITCARD_ORDER),
  68. method: HttpMethod.POST,
  69. });
  70. return res;
  71. };