diff --git a/pay-java-fuiou/document/Fuiou Cross-border Payment Gateway API.doc b/pay-java-fuiou/document/Fuiou Cross-border Payment Gateway API.doc new file mode 100644 index 0000000..f034a07 Binary files /dev/null and b/pay-java-fuiou/document/Fuiou Cross-border Payment Gateway API.doc differ diff --git a/pay-java-fuiou/document/富友支付网关商户端开发文档 -跨境支付.doc b/pay-java-fuiou/document/富友支付网关商户端开发文档 -跨境支付.doc new file mode 100644 index 0000000..26191bf Binary files /dev/null and b/pay-java-fuiou/document/富友支付网关商户端开发文档 -跨境支付.doc differ diff --git a/pay-java-fuiou/document/富友支付网关商户端开发文档.doc b/pay-java-fuiou/document/富友支付网关商户端开发文档.doc new file mode 100644 index 0000000..3e9dd7e Binary files /dev/null and b/pay-java-fuiou/document/富友支付网关商户端开发文档.doc differ diff --git a/pay-java-fuiou/document/富友支付网关商户端示例程序/富友支付网关商户端示例程序.zip b/pay-java-fuiou/document/富友支付网关商户端示例程序/富友支付网关商户端示例程序.zip new file mode 100644 index 0000000..3e56a28 Binary files /dev/null and b/pay-java-fuiou/document/富友支付网关商户端示例程序/富友支付网关商户端示例程序.zip differ diff --git a/pay-java-fuiou/document/富友跨境电商网关商户端开发文档(带海关数据报送).doc b/pay-java-fuiou/document/富友跨境电商网关商户端开发文档(带海关数据报送).doc new file mode 100644 index 0000000..592f89a Binary files /dev/null and b/pay-java-fuiou/document/富友跨境电商网关商户端开发文档(带海关数据报送).doc differ diff --git a/pay-java-fuiou/document/富友跨境电商网关商户端示例程序/java/PayCustomsGate_test.war b/pay-java-fuiou/document/富友跨境电商网关商户端示例程序/java/PayCustomsGate_test.war new file mode 100644 index 0000000..e49e608 Binary files /dev/null and b/pay-java-fuiou/document/富友跨境电商网关商户端示例程序/java/PayCustomsGate_test.war differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0000000000.gif b/pay-java-fuiou/document/银行及富友LOGO/0000000000.gif new file mode 100644 index 0000000..c5916c7 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0000000000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0801000000.gif b/pay-java-fuiou/document/银行及富友LOGO/0801000000.gif new file mode 100644 index 0000000..2454746 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0801000000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0801020000.gif b/pay-java-fuiou/document/银行及富友LOGO/0801020000.gif new file mode 100644 index 0000000..8f7a5c9 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0801020000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0801030000.gif b/pay-java-fuiou/document/银行及富友LOGO/0801030000.gif new file mode 100644 index 0000000..13927e5 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0801030000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0801040000.gif b/pay-java-fuiou/document/银行及富友LOGO/0801040000.gif new file mode 100644 index 0000000..1906713 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0801040000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0801050000.gif b/pay-java-fuiou/document/银行及富友LOGO/0801050000.gif new file mode 100644 index 0000000..d2e9cf1 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0801050000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803010000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803010000.gif new file mode 100644 index 0000000..2644025 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803010000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803020000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803020000.gif new file mode 100644 index 0000000..6a4d7ee Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803020000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803030000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803030000.gif new file mode 100644 index 0000000..23e3e92 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803030000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/080303000C.gif b/pay-java-fuiou/document/银行及富友LOGO/080303000C.gif new file mode 100644 index 0000000..d437530 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/080303000C.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803040000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803040000.gif new file mode 100644 index 0000000..9d916fa Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803040000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803050000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803050000.gif new file mode 100644 index 0000000..3722afc Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803050000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803060000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803060000.gif new file mode 100644 index 0000000..9f1ab15 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803060000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803070000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803070000.gif new file mode 100644 index 0000000..0af871d Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803070000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803080000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803080000.gif new file mode 100644 index 0000000..9714a4e Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803080000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803090000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803090000.gif new file mode 100644 index 0000000..5546579 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803090000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803100000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803100000.gif new file mode 100644 index 0000000..d44da3f Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803100000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803114560.gif b/pay-java-fuiou/document/银行及富友LOGO/0803114560.gif new file mode 100644 index 0000000..b6e93dc Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803114560.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803160000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803160000.gif new file mode 100644 index 0000000..6120567 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803160000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0803170000.gif b/pay-java-fuiou/document/银行及富友LOGO/0803170000.gif new file mode 100644 index 0000000..97e6f66 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0803170000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0804031000.gif b/pay-java-fuiou/document/银行及富友LOGO/0804031000.gif new file mode 100644 index 0000000..585304f Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0804031000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0804243010.gif b/pay-java-fuiou/document/银行及富友LOGO/0804243010.gif new file mode 100644 index 0000000..123f614 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0804243010.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0804400000.gif b/pay-java-fuiou/document/银行及富友LOGO/0804400000.gif new file mode 100644 index 0000000..681490e Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0804400000.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0804403600.gif b/pay-java-fuiou/document/银行及富友LOGO/0804403600.gif new file mode 100644 index 0000000..681490e Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0804403600.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/0804437010.gif b/pay-java-fuiou/document/银行及富友LOGO/0804437010.gif new file mode 100644 index 0000000..b3807f4 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/0804437010.gif differ diff --git a/pay-java-fuiou/document/银行及富友LOGO/富友支付.png b/pay-java-fuiou/document/银行及富友LOGO/富友支付.png new file mode 100644 index 0000000..2867049 Binary files /dev/null and b/pay-java-fuiou/document/银行及富友LOGO/富友支付.png differ diff --git a/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/api/FuiouPayService.java b/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/api/FuiouPayService.java index f968c2d..def9b9d 100644 --- a/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/api/FuiouPayService.java +++ b/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/api/FuiouPayService.java @@ -2,7 +2,6 @@ package in.egan.pay.fuiou.api;/** * Created by Fuzx on 2017/1/16 0016. */ -import com.alibaba.fastjson.JSONObject; import in.egan.pay.common.api.BasePayService; import in.egan.pay.common.api.PayConfigStorage; import in.egan.pay.common.api.RequestExecutor; @@ -11,7 +10,6 @@ import in.egan.pay.common.bean.PayOrder; import in.egan.pay.common.bean.PayOutMessage; import in.egan.pay.common.bean.result.PayError; import in.egan.pay.common.exception.PayErrorException; -import in.egan.pay.common.util.XML; import in.egan.pay.common.util.sign.SignUtils; import in.egan.pay.common.util.str.StringUtils; import in.egan.pay.fuiou.utils.SimplePostRequestExecutor; @@ -52,22 +50,31 @@ public class FuiouPayService extends BasePayService { return null; } - + /** + * 回调校验 + * @param params 回调回来的参数集 + * @return + */ @Override public boolean verify(Map params) { - // TODO 2017/2/9 17:24 author: egan 需要校验签名,签名通过后,再校验订单的真实(根据单号查询对应的订单) if (!"0000".equals(params.get("order_pay_code"))) { log.debug(String.format("富友支付异常:order_pay_code=%s,错误原因=%s,参数集=%s", params.get("order_pay_code"), params.get("order_pay_error"), params)); return false; } try { - return getSignVerify(params, params.get("md5")) && "0000".equals(verifyUrl(params.get("order_id")));//返回参数校验 和 重新请求订单检查是否真实支付成功 + return getSignVerify(params, params.get("md5")) && "0000".equals(verifyUrl(params.get("order_id")));//返回参数校验 和 重新请求订单检查数据是否合法 } catch (PayErrorException e) { e.printStackTrace(); } return false; } + /** + * 校验回调参数是否合法 + * @param params 参数集 + * @param returnSign + * @return + */ @Override public boolean getSignVerify(Map params, String returnSign) { LinkedHashSet keySet = new LinkedHashSet<>(); @@ -96,6 +103,12 @@ public class FuiouPayService extends BasePayService { return false; } + /** + * 发起请求校验订单是否支付成功 + * @param order_id + * @return + * @throws PayErrorException + */ @Override public String verifyUrl(String order_id) throws PayErrorException { // LinkedHashMap param = new LinkedHashMap(); @@ -137,6 +150,11 @@ public class FuiouPayService extends BasePayService { throw new RuntimeException("富友支付服务端异常,超出重试次数"); } + /** + * 对支付请求参数进行加密,排序 + * @param order 支付订单 + * @return + */ @Override public Map orderInfo(PayOrder order) { LinkedHashMap parameters = getOrderInfo(order); @@ -163,11 +181,23 @@ public class FuiouPayService extends BasePayService { return parameters; } + /** + * 对内容进行加密 + * @param content 需要签名的内容 + * @param characterEncoding 字符编码 + * @return + */ @Override public String createSign(String content, String characterEncoding) { return SignUtils.valueOf(payConfigStorage.getSignType().toUpperCase()).createSign(content, "|" + payConfigStorage.getSecretKey(), characterEncoding); } + /** + * 将参数拼凑成String + * @param parameterMap 请求参数 + * @param is 请求流 + * @return + */ @Override public Map getParameter2Map(Map parameterMap, InputStream is) { Map params = new TreeMap(); @@ -243,35 +273,4 @@ public class FuiouPayService extends BasePayService { } - /** - * 支付结果查询(直接返回) - *

- * 返回结果例子 - * - * 错误代码(0000表示成功 其他失败)错误中文描述商户订单号订单状态(‘00’ – 订单已生成(初始状态) ‘01’ – 订单已撤消 ‘02’ – 订单已合并 ‘03’ – 订单已过期 ‘04’ – 订单已确认(等待支付) ‘05’ – 订单支付失败 ‘11’ – 订单已支付 ‘18’ – 已发货 ‘19’ – 已确认收货)富友流水号保留字段md5 - *

- * md5为plain域的内容+商户密钥做md5,不包括plain标签 - * 以下是MD5的内容 - * 错误代码(0000表示成功 其他失败)错误中文描述商户订单号订单状态(‘00’ – 订单已生成(初始状态) ‘01’ – 订单已撤消 ‘02’ – 订单已合并 ‘03’ – 订单已过期 ‘04’ – 订单已确认(等待支付) ‘05’ – 订单支付失败 ‘11’ – 订单已支付 ‘18’ – 已发货 ‘19’ – 已确认收货)富友流水号保留字段商户密钥 - * - * @param order_id - * @return - */ - public JSONObject vaildatePayResult(String order_id) { - LinkedHashMap param = new LinkedHashMap(); - param.put("mchnt_cd", payConfigStorage.getPartner()); - param.put("order_id", order_id); - param.put("md5", createSign(SignUtils.parameters2MD5Str(param, "|"), payConfigStorage.getInputCharset())); - try { - String result = execute(new SimplePostRequestExecutor(), fuiouSmpAQueryGate, param); - JSONObject object = XML.toJSONObject(result); - return object; - } catch (Exception e) { - e.printStackTrace(); - } - - return null; - } - - } diff --git a/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/bean/FuiouCurType.java b/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/bean/FuiouCurType.java index 705a53d..f16dc63 100644 --- a/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/bean/FuiouCurType.java +++ b/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/bean/FuiouCurType.java @@ -22,6 +22,7 @@ public enum FuiouCurType implements CurType { AUD("澳大利亚元"); private String name; + private int index; private FuiouCurType(String name) { this.name = name; diff --git a/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/utils/SimplePostRequestExecutor.java b/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/utils/SimplePostRequestExecutor.java index 902025d..15b0b89 100644 --- a/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/utils/SimplePostRequestExecutor.java +++ b/pay-java-fuiou/src/main/java/in/egan/pay/fuiou/utils/SimplePostRequestExecutor.java @@ -59,7 +59,7 @@ public class SimplePostRequestExecutor implements RequestExecutor"+responseContent); +// System.out.println("直接返回的查询结果-->"+responseContent); // responseContent = responseContent.replace("","").replace("","").replace("","").replace("",""); JSONObject jsonObject = XML.toJSONObject(responseContent);//包含md5 JSONObject plain = XML.toJSONObject(""+jsonObject.getString("plain")+"");//"plain" -> "5002验证签名失败"