package cn.pluss.platform.util;

import org.springframework.core.ReactiveAdapterRegistry;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.FileItem;
import com.alipay.api.request.AlipayOpenAgentFacetofaceSignRequest;
import com.alipay.api.response.AlipayOpenAgentFacetofaceSignResponse;

public class AliMerchantRegistUtil {

	public static void regist() throws AlipayApiException {

		AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", "app_id",
				"your private_key", "json", "GBK", "alipay_public_key", "RSA2");
		AlipayOpenAgentFacetofaceSignRequest request = new AlipayOpenAgentFacetofaceSignRequest();
		request.setBatchNo("2017110616474516400082883");
		request.setMccCode("A_A03_4582");
		FileItem SpecialLicensePic = new FileItem(
				"C:/Downloads/ooopic_963991_7eea1f5426105f9e6069/16365_1271139700.jpg");
		request.setSpecialLicensePic(SpecialLicensePic);
		request.setBusinessLicenseNo("1532501100006302");
		FileItem BusinessLicensePic = new FileItem(
				"C:/Downloads/ooopic_963991_7eea1f5426105f9e6069/16365_1271139700.jpg");
		request.setBusinessLicensePic(BusinessLicensePic);
		FileItem BusinessLicenseAuthPic = new FileItem(
				"C:/Downloads/ooopic_963991_7eea1f5426105f9e6069/16365_1271139700.jpg");
		request.setBusinessLicenseAuthPic(BusinessLicenseAuthPic);
		request.setLongTerm(true);
		request.setDateLimitation("2017-11-11");
		FileItem ShopScenePic = new FileItem("C:/Downloads/ooopic_963991_7eea1f5426105f9e6069/16365_1271139700.jpg");
		request.setShopScenePic(ShopScenePic);
		FileItem ShopSignBoardPic = new FileItem(
				"C:/Downloads/ooopic_963991_7eea1f5426105f9e6069/16365_1271139700.jpg");
		request.setShopSignBoardPic(ShopSignBoardPic);
		AlipayOpenAgentFacetofaceSignResponse response = alipayClient.execute(request);
		if (response.isSuccess()) {
			System.out.println("调用成功");
		} else {
			System.out.println("调用失败");
		}
	}

}
