入境结汇
下载地址
SDK 版本记录
版本 |
日期 |
说明 |
v1.0.1 |
2021-11-18 |
java sdk上线 |
结汇明细备案?
简介
人民币/外汇资金入境前,需要提供资金对应的订单明细。调用该接口进行订单的申报,申报成功后再从境外付款。
调用示例
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/sell/receivesell.htm";
// 实例化客户端
GcbPayClient gcbPayClient = new DefaultGcbPayClient(serverUrl, base64PrivateKey, base64PublicKey);
// 构建请求
GcbFxSettleDetailApplyRequest request = new GcbFxSettleDetailApplyRequest();
//会员账号,由我司提供的商户号+01,共13位数字
request.setMerchantId("1001215986501");
//终端号
request.setTerminalId("JHDF001");
//结汇申请批次号
request.setBatchNo(new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()));
//请求序号
request.setOrdNum("1/1");
//请求时间,格式:yyyyMMddHHmmss
request.setRequestTime(new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
//审核结果通知地址
request.setReviewUrl("http://192.168.1.111:8081/QAMOCK-Test/sell/result.htm");
//备用地址,该地址无通知返回,当前该地址值同REVIEW_URL即可
request.setResultUrl("http://192.168.1.111:8081/QAMOCK-Test/sell/result.htm");
//交易明细
GcbFxSettleDetailApplyRequestDetail detail = new GcbFxSettleDetailApplyRequestDetail();
//明细流水号
detail.setSeqId("1635421332516");
//订单编号
detail.setOrderId("1111111111");
//业务日期,格式:yyyyMMddHHmmss
detail.setOrderTime("20211028020101");
//收款方类型,P–个人,C-对公
detail.setPayeeType("P");
//收款人证件类别
detail.setPayeeIdtype("00");
//收款人证件号
detail.setPayeeIdno("320125198805233308");
//收款人名称
detail.setPayeeName("李财水");
//收款人帐号
detail.setPayeeAcct("6465767887999");
//收款银行代码或名称
detail.setBankId("CMB");
//付款币种
detail.setPayCur("USD");
//付款金额,格式为实际金额扩大100倍提交。如1000,表示10元
detail.setPayAmt("1000");
//商品描述
detail.setProductDesc("{\"customInfo\":{\"addr\":\"客户地址\",\"name\":\"客户名称\",\"tel\":\"客户联系电话\"},\"goodInfo\":[{\"cnt\":\"3\",\"name\":\"货物名称 1\",\"price\":\"12.31\"},{\"cnt\":\"1\",\"name\":\"货物名称2\",\"price\":\"100.31\"}],\"storeInfo\":{\"storeId\":\"amazon_eq3142412342\",\"storelink\": \"12010\"},\"totalCnt\":\"4\",\"cur\":\"USD\",\"totalAmt\":\"900\",\"logInfo\":{\"logCompany\":\"物流公司名称\",\"logNo\":\"物流单号\"},\"productId\":\"100200\"}");
//备注
detail.setRemark("remark");
List<GcbFxSettleDetailApplyRequestDetail> detailsList = new ArrayList<GcbFxSettleDetailApplyRequestDetail>();
detailsList.add(detail);
request.setDetails(detailsList);
//币种
request.setPayCur("USD");
//本次请求的总笔数
request.setPayTotalCnt("1");
//本次请求的总金额
request.setPayTotalAmt("1000");
//批次总笔数
request.setSumCnt("1");
//批次总金额
request.setSumAmt("1000");
//发送请求
GcbFxSettleDetailApplyResponse response = gcbPayClient.execute(request);
//根据响应结果,进行业务逻辑处理
// ......
审核结果通知示例
Java
// 汇付国际的公钥(base64编码格式)
String base64PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
// 实例化通知解析器
GcbPayCallbackMessageParser gcbMessageParser = new DefaultGcbPayCallbackMessageParser(base64PublicKey);
GcbFxSettleDetailReviewResult result = gcbMessageParser.parse(httpServletRequest, GcbFxSettleDetailReviewResult.class);
//根据响应结果,进行业务逻辑处理
// ......
参数说明
调用参数详见 结汇明细备案接口 。
结汇结果通知?
简介
跨境人民币/外汇汇入处理成功后,通知商户资金到账。
调用示例
Java
// 汇付国际的公钥(base64编码格式)
String base64PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvBaKblsfXTEAFLujPiQ3PlWL1TJd+l/ApN/16BcArl6Oo18Tb6xOCLlcFBr3xgmVokc8DP32PHAQdtmS8/Y9HziMFaf8NxTNH9whA7GobU1dmVP+tI31z1S5ZO82knNW9ghbcDwLCo251AWHg5tP4wgRCBOJS+bSuyRuAW15M/wIDAQAB";
// 实例化通知解析器
GcbPayCallbackMessageParser gcbMessageParser = new DefaultGcbPayCallbackMessageParser(base64PublicKey);
GcbFxT0SettleResult result = gcbMessageParser.parse(httpServletRequest, GcbFxT0SettleResult.class);
//根据响应结果,进行业务逻辑处理
// ......
参数说明
调用参数详见 T0结汇结果通知接口 。