From 0d5be1372c7ab2f360b4e21ab6db2bbf4ca0234f Mon Sep 17 00:00:00 2001 From: Chopper Date: Tue, 12 Oct 2021 15:25:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E8=A7=A3=E5=86=B3H5=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=AE=9D=E6=94=AF=E4=BB=98=E6=97=A0=E6=B3=95=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/modules/payment/kit/Payment.java | 11 +++++++++++ .../payment/kit/plugin/alipay/AliPayPlugin.java | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/Payment.java b/framework/src/main/java/cn/lili/modules/payment/kit/Payment.java index 0e7c067d..6c995cdc 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/Payment.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/Payment.java @@ -132,6 +132,17 @@ public interface Payment { return api + "/buyer/cashier/callback/" + paymentMethodEnum.name(); } + /** + * 支付回调地址 + * + * @param api api地址 + * @param paymentMethodEnum 支付类型 + * @return 回调地址 + */ + default String aliCallback(String api, PaymentMethodEnum paymentMethodEnum,String params) { + return api + "/buyer/cashier/callback/" + paymentMethodEnum.name()+"?passback_params="+params; + } + /** * 支付异步通知地址 * diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java index af4f43e7..3365b6cb 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java @@ -93,7 +93,7 @@ public class AliPayPlugin implements Payment { payModel.setProductCode("QUICK_WAP_PAY"); try { log.info("支付宝H5支付:{}", JSONUtil.toJsonStr(payModel)); - AliPayRequest.wapPay(response, payModel, callbackUrl(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY), + AliPayRequest.wapPay(response, payModel, aliCallback(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY, URLEncoder.createAll().encode(BeanUtil.formatKeyValuePair(payParam), StandardCharsets.UTF_8)), notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY)); } catch (Exception e) { log.error("H5支付异常", e);