This commit is contained in:
parent
2da959a011
commit
082ae24242
|
|
@ -8,6 +8,7 @@ import com.bonus.canteen.core.pay.util.AlipayConfig;
|
||||||
import com.bonus.canteen.core.pay.dto.UpOrder;
|
import com.bonus.canteen.core.pay.dto.UpOrder;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -25,7 +26,7 @@ public class PayCotroller {
|
||||||
AlipayTradePagePayRequest alipayRequest;
|
AlipayTradePagePayRequest alipayRequest;
|
||||||
|
|
||||||
@RequestMapping("pay")
|
@RequestMapping("pay")
|
||||||
public void pay(UpOrder order, HttpServletResponse response) throws AlipayApiException, IOException {
|
public void pay(@RequestBody UpOrder order, HttpServletResponse response) throws AlipayApiException, IOException {
|
||||||
alipayRequest.setReturnUrl(AlipayConfig.return_url);
|
alipayRequest.setReturnUrl(AlipayConfig.return_url);
|
||||||
alipayRequest.setNotifyUrl(AlipayConfig.notify_url);
|
alipayRequest.setNotifyUrl(AlipayConfig.notify_url);
|
||||||
alipayRequest.setBizContent(
|
alipayRequest.setBizContent(
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ public class AlipayConfig {
|
||||||
// 支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
|
// 支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
|
||||||
public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkqpPYMDEBTiLgH08AnVYMH1WfHlB5dZC8+/mRq/4aHmvKpGdRgeE11EylhVLsm2N5ryNYI6THgwQpL0jJ9g3lTaq4+KzR8LkJlBbyFrnaflB/3AtNQugg59f77eMSjHx4cTKbLWtyRfxNR2QK6AjBLkMH2+v3GL/4dn0aGml9fcN0/+/cL4xLH8g8HJ1DE+MGx6cJGQhuE7eQqsUkmm/Bs7ElbXfOFHWhLFOAgZ/98Ieeog5JDnewGMl4yqyytFIPcv2/VDlb46MmnZciwXYmZh5W1B9ltmO6LNv/Jj0itWB1ObTGzKJf9WQDG2Xq38JqFm0TttJAKxYb95ZQGZnmwIDAQAB";
|
public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkqpPYMDEBTiLgH08AnVYMH1WfHlB5dZC8+/mRq/4aHmvKpGdRgeE11EylhVLsm2N5ryNYI6THgwQpL0jJ9g3lTaq4+KzR8LkJlBbyFrnaflB/3AtNQugg59f77eMSjHx4cTKbLWtyRfxNR2QK6AjBLkMH2+v3GL/4dn0aGml9fcN0/+/cL4xLH8g8HJ1DE+MGx6cJGQhuE7eQqsUkmm/Bs7ElbXfOFHWhLFOAgZ/98Ieeog5JDnewGMl4yqyytFIPcv2/VDlb46MmnZciwXYmZh5W1B9ltmO6LNv/Jj0itWB1ObTGzKJf9WQDG2Xq38JqFm0TttJAKxYb95ZQGZnmwIDAQAB";
|
||||||
// 服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
|
// 服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
|
||||||
public static String notify_url = "http://aa7xmz.natappfree.cc/alipay/notify/getnotify";
|
public static String notify_url = "http://13866134935.gnway.cc:80/smart-canteen/alipay/notify/getnotify";
|
||||||
// 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问,//标红的域名为内网穿透工具生成的域名,没启动一次穿透工具,生成的域名都不一样,所有启动一次都需要进行修改
|
// 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问,//标红的域名为内网穿透工具生成的域名,没启动一次穿透工具,生成的域名都不一样,所有启动一次都需要进行修改
|
||||||
public static String return_url = "http://aa7xmz.natappfree.cc/alipay/return/getreturn";
|
public static String return_url = "http://13866134935.gnway.cc:80/smart-canteen/alipay/return/getreturn";
|
||||||
// 支付宝网关
|
// 支付宝网关
|
||||||
public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
|
public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
|
||||||
// 签名方式
|
// 签名方式
|
||||||
public static String SIGNTYPE = "RSA2";
|
public static String SIGNTYPE = "RSA2";
|
||||||
// 字符编码格式
|
// 字符编码格式
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue