| | |
| | | contact_info: { |
| | | contact_type: form.contact_type, |
| | | contact_name: form.contact_name, |
| | | contact_id_doc_type: form.contact_id_doc_type, |
| | | contact_id_number: form.contact_id_number, |
| | | contact_id_doc_copy: form.contact_id_doc_copy?.[0]?.path, |
| | | contact_id_doc_copy_back: form.contact_id_doc_copy_back?.[0]?.path, |
| | | contact_period_begin: format(form.contact_period[0], 'YYYY-MM-DD 00:00:00'), |
| | | contact_period_end: format(form.contact_period[1], 'YYYY-MM-DD 23:59:59'), |
| | | business_authorization_letter: form.business_authorization_letter?.[0]?.path, |
| | | mobile_phone: form.mobile_phone, |
| | | contact_email: form.contact_email, |
| | | }, |
| | | subject_info: { |
| | | subject_type: form.subject_type, |
| | | business_license_info: { |
| | | license_copy: form.license_copy?.[0]?.path, |
| | | merchant_name: form.merchant_name, |
| | | license_number: form.license_number, |
| | | legal_person: form.legal_person, |
| | | }, |
| | | certificate_info: { |
| | | cert_copy: form.cert_copy?.[0]?.path, |
| | | cert_type: form.cert_type, |
| | | cert_number: form.cert_number, |
| | | merchant_name: form.cert_merchant_name, |
| | | company_address: form.cert_company_address, |
| | | legal_person: form.cert_legal_person, |
| | | period_begin: format(form.cert_period[0], 'YYYY-MM-DD 00:00:00'), |
| | | period_end: format(form.cert_period[1], 'YYYY-MM-DD 23:59:59'), |
| | | }, |
| | | |
| | | identity_info: { |
| | | id_holder_type: form.id_holder_type, |
| | | id_doc_type: form.id_doc_type, |
| | | authorize_letter_copy: form.authorize_letter_copy?.[0]?.path, |
| | | id_card_info: { |
| | | id_card_copy: form.id_card_copy?.[0]?.path, |
| | | id_card_national: form.id_card_national?.[0]?.path, |
| | | id_card_name: form.id_card_name, |
| | | id_card_number: form.id_card_number, |
| | | card_period_begin: format(form.id_card_period[0], 'YYYY-MM-DD 00:00:00'), |
| | | card_period_end: format(form.id_card_period[1], 'YYYY-MM-DD 23:59:59'), |
| | | }, |
| | | }, |
| | | ubo_info_list: |
| | | form.ubo_info_list?.length > 0 |
| | | ? form.ubo_info_list.map((x) => ({ |
| | | ubo_id_doc_type: x.ubo_id_doc_type, |
| | | ubo_id_doc_copy: x.ubo_id_doc_copy?.[0]?.path, |
| | | ubo_id_doc_name: x.ubo_id_doc_name, |
| | | ubo_id_doc_number: x.ubo_id_doc_number, |
| | | ubo_id_doc_address: x.ubo_id_doc_address, |
| | | ubo_period_begin: format(x.ubo_period[0], 'YYYY-MM-DD 00:00:00'), |
| | | ubo_period_end: format(x.ubo_period[1], 'YYYY-MM-DD 23:59:59'), |
| | | })) |
| | | : [], |
| | | }, |
| | | business_info: { |
| | | merchant_shortname: form.merchant_shortname, |
| | | service_phone: form.service_phone, |
| | | sales_info: { |
| | | sales_scenes_type: form.sales_scenes_type, |
| | | biz_store_info: { |
| | | biz_store_name: form.biz_store_name, |
| | | biz_address_code: form.biz_address_code, |
| | | biz_store_address: form.biz_store_address, |
| | | store_entrance_pic: |
| | | form.store_entrance_pic?.length > 0 |
| | | ? form.store_entrance_pic?.map((x) => x.path) |
| | | : [], |
| | | indoor_pic: form.indoor_pic?.length > 0 ? form.indoor_pic?.map((x) => x.path) : [], |
| | | }, |
| | | mp_info: { |
| | | mp_appid: form.mp_appid, |
| | | mp_sub_appid: form.mp_sub_appid, |
| | | mp_pics: form.mp_pics?.length > 0 ? form.mp_pics?.map((x) => x.path) : [], |
| | | }, |
| | | mini_program_info: { |
| | | mini_program_appid: form.mini_program_appid, |
| | | mini_program_sub_appid: form.mini_program_sub_appid, |
| | | mini_program_pics: |
| | | form.mini_program_pics?.length > 0 ? form.mini_program_pics?.map((x) => x.path) : [], |
| | | }, |
| | | app_info: { |
| | | app_appid: form.app_appid, |
| | | app_sub_appid: form.app_sub_appid, |
| | | app_pics: form.app_pics?.length > 0 ? form.app_pics?.map((x) => x.path) : [], |
| | | }, |
| | | web_info: { |
| | | domain: form.domain, |
| | | web_authorisation: form.web_authorisation?.[0]?.path, |
| | | }, |
| | | wework_info: { |
| | | sub_corp_id: form.sub_corp_id, |
| | | wework_pics: form.wework_pics?.length > 0 ? form.wework_pics?.map((x) => x.path) : [], |
| | | }, |
| | | }, |
| | | }, |
| | | settlement_info: { |
| | |
| | | need_bank_branch: form.need_bank_branch, |
| | | }, |
| | | }; |
| | | if (form.contact_type === EnumWeChatPayApplymentContactType.SUPER) { |
| | | params.contact_info.contact_id_doc_type = form.contact_id_doc_type; |
| | | params.contact_info.contact_id_number = form.contact_id_number; |
| | | params.contact_info.contact_id_doc_copy = form.contact_id_doc_copy?.[0]?.path; |
| | | params.contact_info.contact_id_doc_copy_back = form.contact_id_doc_copy_back?.[0]?.path; |
| | | params.contact_info.contact_period_begin = format( |
| | | form.contact_period[0], |
| | | 'YYYY-MM-DD 00:00:00' |
| | | ); |
| | | params.contact_info.contact_period_end = format( |
| | | form.contact_period[1], |
| | | 'YYYY-MM-DD 23:59:59' |
| | | ); |
| | | params.contact_info.business_authorization_letter = |
| | | form.business_authorization_letter?.[0]?.path; |
| | | } |
| | | if ( |
| | | form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_INDIVIDUAL || |
| | | form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_ENTERPRISE |
| | | ) { |
| | | params.subject_info.business_license_info.license_copy = form.license_copy?.[0]?.path; |
| | | params.subject_info.business_license_info.merchant_name = form.merchant_name; |
| | | params.subject_info.business_license_info.license_number = form.license_number; |
| | | params.subject_info.business_license_info.legal_person = form.legal_person; |
| | | } |
| | | if ( |
| | | form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_GOVERNMENT || |
| | | form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_INSTITUTIONS || |
| | | form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_OTHERS |
| | | ) { |
| | | params.subject_info.certificate_info.cert_copy = form.cert_copy?.[0]?.path; |
| | | params.subject_info.certificate_info.cert_type = form.cert_type; |
| | | params.subject_info.certificate_info.cert_number = form.cert_number; |
| | | params.subject_info.certificate_info.merchant_name = form.cert_merchant_name; |
| | | params.subject_info.certificate_info.company_address = form.cert_company_address; |
| | | params.subject_info.certificate_info.legal_person = form.cert_legal_person; |
| | | params.subject_info.certificate_info.period_begin = format( |
| | | form.cert_period[0], |
| | | 'YYYY-MM-DD 00:00:00' |
| | | ); |
| | | params.subject_info.certificate_info.period_end = format( |
| | | form.cert_period[1], |
| | | 'YYYY-MM-DD 23:59:59' |
| | | ); |
| | | } |
| | | if (form.id_holder_type === EnumWeChatPayApplymentIdHolderType.LEGAL) { |
| | | params.subject_info.identity_info.id_doc_type = form.id_doc_type; |
| | | } |
| | | if (form.id_holder_type === EnumWeChatPayApplymentIdHolderType.SUPER) { |
| | | params.subject_info.identity_info.authorize_letter_copy = |
| | | form.authorize_letter_copy?.[0]?.path; |
| | | } |
| | | if ( |
| | | form.id_holder_type === EnumWeChatPayApplymentIdHolderType.LEGAL && |
| | | form.id_doc_type === EnumWeChatPayApplymentIdDocType.IDENTIFICATION_TYPE_IDCARD |
| | | ) { |
| | | params.subject_info.identity_info.id_card_info.id_card_copy = form.id_card_copy?.[0]?.path; |
| | | params.subject_info.identity_info.id_card_info.id_card_national = |
| | | form.id_card_national?.[0]?.path; |
| | | params.subject_info.identity_info.id_card_info.id_card_name = form.id_card_name; |
| | | params.subject_info.identity_info.id_card_info.id_card_number = form.id_card_number; |
| | | params.subject_info.identity_info.id_card_info.card_period_begin = format( |
| | | form.id_card_period[0], |
| | | 'YYYY-MM-DD 00:00:00' |
| | | ); |
| | | params.subject_info.identity_info.id_card_info.card_period_end = format( |
| | | form.id_card_period[1], |
| | | 'YYYY-MM-DD 23:59:59' |
| | | ); |
| | | } |
| | | if ( |
| | | form.id_holder_type === EnumWeChatPayApplymentIdHolderType.LEGAL && |
| | | form.id_doc_type !== EnumWeChatPayApplymentIdDocType.IDENTIFICATION_TYPE_IDCARD |
| | | ) { |
| | | params.subject_info.identity_info.id_doc_info.id_doc_copy = form.id_doc_copy?.[0]?.path; |
| | | params.subject_info.identity_info.id_doc_info.id_doc_name = form.id_doc_name; |
| | | params.subject_info.identity_info.id_doc_info.id_doc_number = form.id_doc_number; |
| | | params.subject_info.identity_info.id_doc_info.doc_period_begin = format( |
| | | form.id_doc_period[0], |
| | | 'YYYY-MM-DD 00:00:00' |
| | | ); |
| | | params.subject_info.identity_info.id_doc_info.doc_period_end = format( |
| | | form.id_doc_period[1], |
| | | 'YYYY-MM-DD 23:59:59' |
| | | ); |
| | | } |
| | | if (form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_ENTERPRISE) { |
| | | params.subject_info.ubo_info_list = |
| | | form.ubo_info_list?.length > 0 |
| | | ? form.ubo_info_list.map((x) => ({ |
| | | ubo_id_doc_type: x.ubo_id_doc_type, |
| | | ubo_id_doc_copy: x.ubo_id_doc_copy?.[0]?.path, |
| | | ubo_id_doc_name: x.ubo_id_doc_name, |
| | | ubo_id_doc_number: x.ubo_id_doc_number, |
| | | ubo_id_doc_address: x.ubo_id_doc_address, |
| | | ubo_period_begin: format(x.ubo_period[0], 'YYYY-MM-DD 00:00:00'), |
| | | ubo_period_end: format(x.ubo_period[1], 'YYYY-MM-DD 23:59:59'), |
| | | })) |
| | | : []; |
| | | } |
| | | if (form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_STORE)) { |
| | | params.business_info.sales_info.biz_store_info.biz_store_name = form.biz_store_name; |
| | | params.business_info.sales_info.biz_store_info.biz_address_code = form.biz_address_code; |
| | | params.business_info.sales_info.biz_store_info.biz_store_address = form.biz_store_address; |
| | | params.business_info.sales_info.biz_store_info.store_entrance_pic = |
| | | form.store_entrance_pic?.length > 0 ? form.store_entrance_pic?.map((x) => x.path) : []; |
| | | params.business_info.sales_info.biz_store_info.indoor_pic = |
| | | form.indoor_pic?.length > 0 ? form.indoor_pic?.map((x) => x.path) : []; |
| | | } |
| | | if (form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_MP)) { |
| | | params.business_info.sales_info.mp_info.mp_appid = form.mp_appid; |
| | | params.business_info.sales_info.mp_info.mp_sub_appid = form.mp_sub_appid; |
| | | params.business_info.sales_info.mp_info.mp_pics = |
| | | form.mp_pics?.length > 0 ? form.mp_pics?.map((x) => x.path) : []; |
| | | } |
| | | if ( |
| | | form.sales_scenes_type.includes( |
| | | EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_MINI_PROGRAM |
| | | ) |
| | | ) { |
| | | params.business_info.sales_info.mini_program_info.mini_program_appid = |
| | | form.mini_program_appid; |
| | | params.business_info.sales_info.mini_program_info.mini_program_sub_appid = |
| | | form.mini_program_sub_appid; |
| | | params.business_info.sales_info.mini_program_info.mini_program_pics = |
| | | form.mini_program_pics?.length > 0 ? form.mini_program_pics?.map((x) => x.path) : []; |
| | | } |
| | | if (form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_APP)) { |
| | | params.business_info.sales_info.app_info.app_appid = form.app_appid; |
| | | params.business_info.sales_info.app_info.app_sub_appid = form.app_sub_appid; |
| | | params.business_info.sales_info.app_info.app_pics = |
| | | form.app_pics?.length > 0 ? form.app_pics?.map((x) => x.path) : []; |
| | | } |
| | | if (form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_WEB)) { |
| | | params.business_info.sales_info.web_info.domain = form.domain; |
| | | params.business_info.sales_info.web_info.web_authorisation = |
| | | form.web_authorisation?.[0]?.path; |
| | | } |
| | | if ( |
| | | form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_WEWORK) |
| | | ) { |
| | | params.business_info.sales_info.wework_info.sub_corp_id = form.sub_corp_id; |
| | | params.business_info.sales_info.wework_info.wework_pics = |
| | | form.wework_pics?.length > 0 ? form.wework_pics?.map((x) => x.path) : []; |
| | | } |
| | | |
| | | let res = await enterpriseWalletServices.openEnterpriseWeChatPayWallet(params); |
| | | return res; |
| | | } catch (error) {} |