代发提现

  • 下载地址

SDK下载

Demo下载

  • SDK 版本记录

版本

日期

说明

v1.0.1

2021-11-18

java sdk上线

商户代发?

  • 简介

从商户账户将资金付款至指定的银行账户或汇付虚拟账户。

  • 代发申请示例

Java

  
	// 商户的私钥(base64编码格式)
	String merchantPrivateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMpT/BKCrfkPKbMggoIQVpYL8chw8e9do+vuh5f5OsZNVm+BAtpJY+nGTBW4ggWEbtDWh4e+IsCVDzeXVDUmPO4GXro0o7QZpOVN+bo28k1x69tw65HMLTgjx3jjrQK7JdON7cqbtqWN624GVMgk5mJGu0ua+eBiOPuIBM3Re+61AgMBAAECgYEAqWvWIjHnOCzoQCSy4/KGbrKlzbA2BrgksUVVqX57Jt5PyKMBHoRh87mmsHGF/tS8boeViac/NoAa8/P2AWN5lGFl8Z9A4NlpXojA+vn7bn2fIjDzsB8s2txkmskuzzoDhUSeiPGf/HjPG7w6fl1BiHiix2xRr8Bw5wTeMJmsXQECQQDwrktdw8NP0FzmqmyFzTfz97UDsexKQfLSaFq31YydMoYlHEwsZcZhNTTBx71tni7/2eEQdVtFToAQRbEvGJBVAkEA1zTDC18DBHeGQdMwywrdc9BhbYY4a2ucc8XhRHScQzzyG4WgSFTrorLAH6QohpmFHfHm0Ws6AfDDhdQwuNTE4QJARI6hUTguLlH/5ISvHP3z7j6lBURtNknKzTyEetENmMmHhJKm8A6dj5sESB6JSuxAHwkFHxcOxJMzz27KpcutcQJAfnQNS6g3kK9e31zmJdiriXrfVMjybAReeRTEKkJO859jL9LT/MyRbReVlsIR4g1hT9gtZc6Y1j0P1pp5SpITYQJAdxwKEBXokaZwWy2gzEt3XdXBYoR5lvg/3T4GSEMBJZRmlmZpBOTbg/yYaf7lXtGUm+mZ3UZsCfJvwufit314sw==";
	
	// 汇付国际的公钥(base64编码格式)
	String gcbPublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
	
	// 商户代发请求url(测试环境)
	String reqUrl = "https://hfgj.testpnr.com/sell/receivesell.htm";
	
	// 初始化客户端
	GcbPayClient client = new DefaultGcbPayClient(reqUrl, merchantPrivateKey, gcbPublicKey);
	
	// 构建商户代发请求对象
	GcbAgcyPaymentApplyRequest request = new GcbAgcyPaymentApplyRequest();
	//必填,会员账号,由我司提供的商户号+01,共13位数字
	request.setMerchantId("1001215986501");
	//必填,终端号,由我司提供的终端号
	request.setTerminalId("JHDF002");
	//必填,代发批次号 商户系统唯一ID
	request.setBatchNo(new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()));
	//必填,请求时间 yyyyMMddHHmmss
	request.setRequestTime(new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
	//必填,明细总笔数
	request.setPayTotalCnt("2");
	//必填,用途
	request.setPurpose("工资");
	//非必填,扩展字段1
	request.setExt1("");
	//非必填,扩展字段2
	request.setExt2("");
	//必填,结果通知地址
	request.setReviewUrl("http://xxx/notifyReceiverBg.do");
	//必填,审核通知地址
	request.setResultUrl("http://xxx/notifyReceiverBg.do");
	
	//必填,构建代发申请明细
	GcbAgcyPaymentApplyRequestDetail detail = new GcbAgcyPaymentApplyRequestDetail();
	//代发申请流水号,同一商户号下唯一
	detail.setRemitNo(new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + new Random().nextInt(1000));
	//代发金额,格式为实际金额扩大100倍提交。如1000,表示10元
	detail.setAmt("1000");
	//收款银行代码或名称
	detail.setBankId("CMB");
	//收款账户的类型
	detail.setAcctType("P");
	//银行账号
	detail.setAcctNo("1111111111");
	//账户名称
	detail.setPayeeName("李财水");
	//证件类型
	detail.setIdType("00");
	//证件号码
	detail.setIdNo("320125198805232313");
	//省份
	detail.setProvince("江苏省");
	//地区
	detail.setCity("南京市");
	//支行名
	detail.setBranchBankName("招行银行南京分行城东支行");
	//用途
	detail.setPurpose("Test");
	//对应结汇明细
	detail.setSellTrxIds("T1001");
	//扩展字段1
	detail.setExt1("ext1");
	//扩展字段2
	detail.setExt2("ext2");
	//联行号
	detail.setCnapsCode("");
	//备注
	detail.setRemark("备注");
	//到账时效
	detail.setRemitType("1");
	
	List<GcbAgcyPaymentApplyRequestDetail> detailsList = new ArrayList<GcbAgcyPaymentApplyRequestDetail>();
	detailsList.add(detail);
	
	//必填,代发明细
	request.setDetails(detailsList);
	
	//必填,请求总金额 格式为实际金额扩大100倍提交。 如10000,表示100元
	request.setPayTotalAmt("1000");
	
	// 发送请求
	GcbAgcyPaymentApplyResponse response = client.execute(request);
	
	//根据响应结果,进行业务逻辑处理
	// ......
  													
									
  • 接收异步示例

Java

  
	// 汇付国际的公钥(base64编码格式)
	String base64PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
	
	// 实例化通知解析器
	GcbPayCallbackMessageParser gcbMessageParser = new DefaultGcbPayCallbackMessageParser(base64PublicKey);
	
	// 解析代发结果
	GcbAgcyPaymentResult result = gcbMessageParser.parse(httpServletRequest, GcbAgcyPaymentResult.class);
	   
	//根据结果,进行业务逻辑处理
	// ......
  													
									
  • 代发结果查询示例

Java

  
	// 商户的私钥(base64编码格式)
	String merchantPrivateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMpT/BKCrfkPKbMggoIQVpYL8chw8e9do+vuh5f5OsZNVm+BAtpJY+nGTBW4ggWEbtDWh4e+IsCVDzeXVDUmPO4GXro0o7QZpOVN+bo28k1x69tw65HMLTgjx3jjrQK7JdON7cqbtqWN624GVMgk5mJGu0ua+eBiOPuIBM3Re+61AgMBAAECgYEAqWvWIjHnOCzoQCSy4/KGbrKlzbA2BrgksUVVqX57Jt5PyKMBHoRh87mmsHGF/tS8boeViac/NoAa8/P2AWN5lGFl8Z9A4NlpXojA+vn7bn2fIjDzsB8s2txkmskuzzoDhUSeiPGf/HjPG7w6fl1BiHiix2xRr8Bw5wTeMJmsXQECQQDwrktdw8NP0FzmqmyFzTfz97UDsexKQfLSaFq31YydMoYlHEwsZcZhNTTBx71tni7/2eEQdVtFToAQRbEvGJBVAkEA1zTDC18DBHeGQdMwywrdc9BhbYY4a2ucc8XhRHScQzzyG4WgSFTrorLAH6QohpmFHfHm0Ws6AfDDhdQwuNTE4QJARI6hUTguLlH/5ISvHP3z7j6lBURtNknKzTyEetENmMmHhJKm8A6dj5sESB6JSuxAHwkFHxcOxJMzz27KpcutcQJAfnQNS6g3kK9e31zmJdiriXrfVMjybAReeRTEKkJO859jL9LT/MyRbReVlsIR4g1hT9gtZc6Y1j0P1pp5SpITYQJAdxwKEBXokaZwWy2gzEt3XdXBYoR5lvg/3T4GSEMBJZRmlmZpBOTbg/yYaf7lXtGUm+mZ3UZsCfJvwufit314sw==";
	
	// 汇付国际的公钥(base64编码格式)
	String gcbPublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
	
	// 商户代发结果查询请求url(测试环境)
	String reqUrl = "https://hfgj.testpnr.com/sell/receivesell.htm";
	
	// 初始化客户端
	GcbPayClient client = new DefaultGcbPayClient(reqUrl, merchantPrivateKey, gcbPublicKey);
	
	// 构建商户代发请求对象
	GcbAgcyPaymentQueryRequest request = new GcbAgcyPaymentQueryRequest();
	//必填,会员账号,由我司提供的商户号+01,共13位数字
	request.setMerchantId("1001215986501");
	//必填,终端号,由我司提供的终端号
	request.setTerminalId("JHDF002");
	//必填,代发批次号 商户系统唯一ID
	request.setBatchNo("20211025095823730");
	//必填,代发明细流水号
	request.setRemitReqId("1635127014504");
	//必填,代发日期
	request.setApplyDate("20211025");
	
	GcbAgcyPaymentQueryResponse response = client.execute(request);

	
	//根据响应结果,进行业务逻辑处理
	// ......
  													
											
  • 参数说明

调用参数详见 商户代发接口

用户提现?

  • 简介

从用户账户将资金付款至同名银行账户或汇付虚拟账户。

  • 提现申请示例

Java

  
	// 商户的私钥(base64编码格式)
	String base64PrivateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMpT/BKCrfkPKbMggoIQVpYL8chw8e9do+vuh5f5OsZNVm+BAtpJY+nGTBW4ggWEbtDWh4e+IsCVDzeXVDUmPO4GXro0o7QZpOVN+bo28k1x69tw65HMLTgjx3jjrQK7JdON7cqbtqWN624GVMgk5mJGu0ua+eBiOPuIBM3Re+61AgMBAAECgYEAqWvWIjHnOCzoQCSy4/KGbrKlzbA2BrgksUVVqX57Jt5PyKMBHoRh87mmsHGF/tS8boeViac/NoAa8/P2AWN5lGFl8Z9A4NlpXojA+vn7bn2fIjDzsB8s2txkmskuzzoDhUSeiPGf/HjPG7w6fl1BiHiix2xRr8Bw5wTeMJmsXQECQQDwrktdw8NP0FzmqmyFzTfz97UDsexKQfLSaFq31YydMoYlHEwsZcZhNTTBx71tni7/2eEQdVtFToAQRbEvGJBVAkEA1zTDC18DBHeGQdMwywrdc9BhbYY4a2ucc8XhRHScQzzyG4WgSFTrorLAH6QohpmFHfHm0Ws6AfDDhdQwuNTE4QJARI6hUTguLlH/5ISvHP3z7j6lBURtNknKzTyEetENmMmHhJKm8A6dj5sESB6JSuxAHwkFHxcOxJMzz27KpcutcQJAfnQNS6g3kK9e31zmJdiriXrfVMjybAReeRTEKkJO859jL9LT/MyRbReVlsIR4g1hT9gtZc6Y1j0P1pp5SpITYQJAdxwKEBXokaZwWy2gzEt3XdXBYoR5lvg/3T4GSEMBJZRmlmZpBOTbg/yYaf7lXtGUm+mZ3UZsCfJvwufit314sw==";
	
	// 汇付国际的公钥(base64编码格式)
	String base64PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
	
	// 用户提现申请服务的url(测试环境)
	String serverUrl = "https://hfgj.testpnr.com/mcs/remit.htm";
	
	// 实例化客户端
	GcbPayClient gcbPayClient = new DefaultGcbPayClient(serverUrl, base64PrivateKey, base64PublicKey);
	
	GcbUserAgcyPaymentApplyRequest request = new GcbUserAgcyPaymentApplyRequest();
	
	String randomNum = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
	String time = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
	//请求流水号,商户系统中唯一性ID
	request.setRequestId(randomNum);
	//请求时间,格式:yyyyMMddHHmmss
	request.setRequestTime(time);
	//会员账号,由我司提供的商户号+01,共13位数字
	request.setMerchantAcctId("1001215986501");
	//终端号
	request.setTerminalId("JHDF002");
	//提现批次号
	request.setBatchNo(randomNum);
	
	//构建提现明细
	List<GcbUserAgcyPaymentApplyRequestDetail> detailsList = new ArrayList<GcbUserAgcyPaymentApplyRequestDetail>();
	GcbUserAgcyPaymentApplyRequestDetail detail = new GcbUserAgcyPaymentApplyRequestDetail();
	//提现明细流水号,同一商户号下唯一
	detail.setRemitNo(new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()));
	//金额,格式为实际金额扩大100倍提交。如1000,表示10元
	detail.setAmt("1000");
	//收款银行代码
	detail.setBankId("CMB");
	//收款账户的类型
	detail.setAcctType("P");
	//到账时效, 1:T+0,2:T+1;
	detail.setRemitType("1");
	//银行账户
	detail.setAcctNo("111111");
	//户名
	detail.setPayeeName("李财水");
	//证件类型
	detail.setIdType("00");
	//证件号码
	detail.setIdNo("320125198805232313");
	//备注
	detail.setRemark("工资代发");
	//出款用户号
	detail.setUserId("10000001");
	//提现用途
	detail.setPurpose("用途");
	
	detailsList.add(detail);
	request.setDetails(detailsList);
	
	//总笔数
	request.setPayTCnt("1");
	//总金额,单位分
	request.setPayTAmt("1000");
	//是否忽略错误行,1:不忽略 2:忽略
	request.setIgnoreFlag("1");
	//用途,佣金/工资
	request.setPurpose("佣金");
	//结果通知地址
	request.setNoticeUrl("http://192.168.1.111:8081/QAMOCK-Test/sell/result.htm");
	
	
	GcbUserAgcyPaymentApplyResponse response = gcbPayClient.execute(request);

	//根据响应结果,进行业务逻辑处理
	// ......
  													
									
  • 接收异步示例

Java

  
	// 汇付国际的公钥(base64编码格式)
	String base64PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
	
	// 实例化通知解析器
	GcbPayCallbackMessageParser gcbMessageParser = new DefaultGcbPayCallbackMessageParser(base64PublicKey);
	
	// 解析代发结果
	GcbUserAgcyPaymentResult result = gcbMessageParser.parse(httpServletRequest, GcbUserAgcyPaymentResult.class);
	List<GcbUserAgcyPaymentResultDetail> detailList = result.getDetailList();
	   
	//根据结果,进行业务逻辑处理
	// ......
  													
									
  • 提现结果查询示例

Java

  
	// 商户的私钥(base64编码格式)
	String base64PrivateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMpT/BKCrfkPKbMggoIQVpYL8chw8e9do+vuh5f5OsZNVm+BAtpJY+nGTBW4ggWEbtDWh4e+IsCVDzeXVDUmPO4GXro0o7QZpOVN+bo28k1x69tw65HMLTgjx3jjrQK7JdON7cqbtqWN624GVMgk5mJGu0ua+eBiOPuIBM3Re+61AgMBAAECgYEAqWvWIjHnOCzoQCSy4/KGbrKlzbA2BrgksUVVqX57Jt5PyKMBHoRh87mmsHGF/tS8boeViac/NoAa8/P2AWN5lGFl8Z9A4NlpXojA+vn7bn2fIjDzsB8s2txkmskuzzoDhUSeiPGf/HjPG7w6fl1BiHiix2xRr8Bw5wTeMJmsXQECQQDwrktdw8NP0FzmqmyFzTfz97UDsexKQfLSaFq31YydMoYlHEwsZcZhNTTBx71tni7/2eEQdVtFToAQRbEvGJBVAkEA1zTDC18DBHeGQdMwywrdc9BhbYY4a2ucc8XhRHScQzzyG4WgSFTrorLAH6QohpmFHfHm0Ws6AfDDhdQwuNTE4QJARI6hUTguLlH/5ISvHP3z7j6lBURtNknKzTyEetENmMmHhJKm8A6dj5sESB6JSuxAHwkFHxcOxJMzz27KpcutcQJAfnQNS6g3kK9e31zmJdiriXrfVMjybAReeRTEKkJO859jL9LT/MyRbReVlsIR4g1hT9gtZc6Y1j0P1pp5SpITYQJAdxwKEBXokaZwWy2gzEt3XdXBYoR5lvg/3T4GSEMBJZRmlmZpBOTbg/yYaf7lXtGUm+mZ3UZsCfJvwufit314sw==";
	
	// 汇付国际的公钥(base64编码格式)
	String base64PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
	
	// 提现结果查询服务的url(测试环境)
	String serverUrl = "https://hfgj.testpnr.com/mcs/remitQry.htm";
	
	// 实例化客户端
	GcbPayClient gcbPayClient = new DefaultGcbPayClient(serverUrl, base64PrivateKey, base64PublicKey);
	
	GcbUserAgcyPaymentQueryRequest request = new GcbUserAgcyPaymentQueryRequest();
	
	String randomNum = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
	String time = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
	//请求流水号
	request.setRequestId(randomNum);
	//请求时间,格式:yyyyMMddHHmmss
	request.setRequestTime(time);
	//会员账号,由我司提供的商户号+01,共13位数字
	request.setMerchantAcctId("1001215986501");
	//终端号
	request.setTerminalId("JHDF002");
	//提现批次号
	request.setBatchNo("20211029144956184");
	//提现明细流水号	
	request.setRemitNo("20211029144956187");
	//原批次申请日期
	request.setApplyDate("20211029");
	
	GcbUserAgcyPaymentQueryResponse response = gcbPayClient.execute(request);

	//根据响应结果,进行业务逻辑处理
	// ......
  													
											
  • 参数说明

调用参数详见 用户提现接口

余额支付?

  • 简介

商户与用户账户互转,支持从商户至用户、用户至用户、用户至商户。注意只支持同商户下的账户间交易。

  • 余额支付申请示例

Java

  
	// 商户的私钥(base64编码格式)
	String merchantPrivateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMpT/BKCrfkPKbMggoIQVpYL8chw8e9do+vuh5f5OsZNVm+BAtpJY+nGTBW4ggWEbtDWh4e+IsCVDzeXVDUmPO4GXro0o7QZpOVN+bo28k1x69tw65HMLTgjx3jjrQK7JdON7cqbtqWN624GVMgk5mJGu0ua+eBiOPuIBM3Re+61AgMBAAECgYEAqWvWIjHnOCzoQCSy4/KGbrKlzbA2BrgksUVVqX57Jt5PyKMBHoRh87mmsHGF/tS8boeViac/NoAa8/P2AWN5lGFl8Z9A4NlpXojA+vn7bn2fIjDzsB8s2txkmskuzzoDhUSeiPGf/HjPG7w6fl1BiHiix2xRr8Bw5wTeMJmsXQECQQDwrktdw8NP0FzmqmyFzTfz97UDsexKQfLSaFq31YydMoYlHEwsZcZhNTTBx71tni7/2eEQdVtFToAQRbEvGJBVAkEA1zTDC18DBHeGQdMwywrdc9BhbYY4a2ucc8XhRHScQzzyG4WgSFTrorLAH6QohpmFHfHm0Ws6AfDDhdQwuNTE4QJARI6hUTguLlH/5ISvHP3z7j6lBURtNknKzTyEetENmMmHhJKm8A6dj5sESB6JSuxAHwkFHxcOxJMzz27KpcutcQJAfnQNS6g3kK9e31zmJdiriXrfVMjybAReeRTEKkJO859jL9LT/MyRbReVlsIR4g1hT9gtZc6Y1j0P1pp5SpITYQJAdxwKEBXokaZwWy2gzEt3XdXBYoR5lvg/3T4GSEMBJZRmlmZpBOTbg/yYaf7lXtGUm+mZ3UZsCfJvwufit314sw==";
	
	// 汇付国际的公钥(base64编码格式)
	String gcbPublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
	
	// 余额支付请求url(测试环境)
	String reqUrl = "https://hfgj.testpnr.com/acctransfer/transfer.htm";
	
	// 初始化客户端
	GcbPayClient client = new DefaultGcbPayClient(reqUrl, merchantPrivateKey, gcbPublicKey);
	
	// 构建商户代发请求对象
	GcbAccTransferApplyRequest request = new GcbAccTransferApplyRequest();
	//必填,请求时间 yyyyMMddHHmmss
	request.setRequestTime(new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
	//必填,会员账号,由我司提供的商户号+01,共13位数字
	request.setMerchantAcctId("1001215986501");
	//必填,终端号,由我司提供的终端号
	request.setTerminalId("JHDF002");
	//必填,代发批次号 商户系统唯一ID
	request.setBatchNo(new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()));
	//必填,明细总笔数
	request.setPayTCnt("2");
	//必填,请求总金额 格式为实际金额扩大100倍提交。 如10000,表示100元
	request.setPayTAmt("21");
	//必填,疑似重复标志  默认1-校验
	request.setDupChkFlag("1");
	//非必填,扩展字段1
	request.setExt1("");
	//非必填,扩展字段2
	request.setExt2("");
	//必填,结果通知地址
	request.setNoticeUrl("http://xxx/notifyReceiverBg.do");
	//必填,代发明细
	request.setDetails(mockDetails());
	
	GcbAccTransferApplyResponse response = client.execute(request);

	//根据响应结果,进行业务逻辑处理
	// ......
  													
									
  • 接收异步示例

Java

  
	// 汇付国际的公钥(base64编码格式)
	String base64PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
	
	// 实例化通知解析器
	GcbPayCallbackMessageParser gcbMessageParser = new DefaultGcbPayCallbackMessageParser(base64PublicKey);
	
	// 解析代发结果
	GcbAccTransferApplyResult result = gcbMessageParser.parse(httpServletRequest, GcbAccTransferApplyResult.class);
	   
	//根据结果,进行业务逻辑处理
	// ......
  													
									
  • 余额支付结果查询示例

Java

  
	// 商户的私钥(base64编码格式)
	String merchantPrivateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMpT/BKCrfkPKbMggoIQVpYL8chw8e9do+vuh5f5OsZNVm+BAtpJY+nGTBW4ggWEbtDWh4e+IsCVDzeXVDUmPO4GXro0o7QZpOVN+bo28k1x69tw65HMLTgjx3jjrQK7JdON7cqbtqWN624GVMgk5mJGu0ua+eBiOPuIBM3Re+61AgMBAAECgYEAqWvWIjHnOCzoQCSy4/KGbrKlzbA2BrgksUVVqX57Jt5PyKMBHoRh87mmsHGF/tS8boeViac/NoAa8/P2AWN5lGFl8Z9A4NlpXojA+vn7bn2fIjDzsB8s2txkmskuzzoDhUSeiPGf/HjPG7w6fl1BiHiix2xRr8Bw5wTeMJmsXQECQQDwrktdw8NP0FzmqmyFzTfz97UDsexKQfLSaFq31YydMoYlHEwsZcZhNTTBx71tni7/2eEQdVtFToAQRbEvGJBVAkEA1zTDC18DBHeGQdMwywrdc9BhbYY4a2ucc8XhRHScQzzyG4WgSFTrorLAH6QohpmFHfHm0Ws6AfDDhdQwuNTE4QJARI6hUTguLlH/5ISvHP3z7j6lBURtNknKzTyEetENmMmHhJKm8A6dj5sESB6JSuxAHwkFHxcOxJMzz27KpcutcQJAfnQNS6g3kK9e31zmJdiriXrfVMjybAReeRTEKkJO859jL9LT/MyRbReVlsIR4g1hT9gtZc6Y1j0P1pp5SpITYQJAdxwKEBXokaZwWy2gzEt3XdXBYoR5lvg/3T4GSEMBJZRmlmZpBOTbg/yYaf7lXtGUm+mZ3UZsCfJvwufit314sw==";
	
	// 汇付国际的公钥(base64编码格式)
	String gcbPublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
	
	// 余额支付结果查询url(测试环境)
	String reqUrl = "https://hfgj.testpnr.com/acctransfer/transferQuery.htm";
	
	// 初始化客户端
	GcbPayClient client = new DefaultGcbPayClient(reqUrl, merchantPrivateKey, gcbPublicKey);
	
	// 构建商户代发请求对象
	GcbAccTransferQueryRequest request = new GcbAccTransferQueryRequest();
	//必填,会员账号,由我司提供的商户号+01,共13位数字
	request.setMerchantAcctId("1001215986501");
	//必填,终端号,由我司提供的终端号
	request.setTerminalId("JHDF002");
	String randomNum = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
	String time = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
	request.setRequestId(randomNum);
	request.setRequestTime(time);
	//必填,批次号 商户系统唯一ID
	request.setOrigbatchNo("20211029160920002");
	//必填,明细流水号
	request.setOrigtransNo("202110291609200041");
	//必填,明细总笔数
	request.setOrigApplyDate("20211029");
	
	GcbAccTransferQueryResponse response = client.execute(request);
	
	//根据响应结果,进行业务逻辑处理
	// ......
  													
											
  • 参数说明

调用参数详见 余额支付接口