| | |
| | | @PostMapping("/payOrder") |
| | | @ApiOperation(value = "课程模块--支付订单") |
| | | public R<Map<String, Object>> payOrder(@RequestBody TCourseOrder courseOrder) { |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TAppUser appUser = appUserService.getById(userId); |
| | | // String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // TAppUser appUser = appUserService.getById(userId); |
| | | TCourseOrder courseOrder1 = courseOrderService.getById(courseOrder.getId()); |
| | | if(!userId.equals(courseOrder1.getAppUserId())){ |
| | | return R.fail("无权限操作"); |
| | | } |
| | | // if(!userId.equals(courseOrder1.getAppUserId())){ |
| | | // return R.fail("无权限操作"); |
| | | // } |
| | | courseOrder1.setOrderNumber(OrderNos.getDid()); |
| | | courseOrderService.updateById(courseOrder1); |
| | | Map<String, Object> result = wxV3Pay.jsApi(courseOrder1.getOrderNumber(), courseOrder1.getPayMoney().multiply(BigDecimal.valueOf(100)).longValue(), appUser.getOpenId(),"购买课程",""); |
| | | Map<String, Object> result = wxV3Pay.jsApi(courseOrder1.getOrderNumber(), courseOrder1.getPayMoney().multiply(BigDecimal.valueOf(100)).longValue(), "oz71-1_OevadwmESB_IFAW7PucWY","购买课程",""); |
| | | return R.ok(result); |
| | | } |
| | | |
| | |
| | | payment: |
| | | wx: |
| | | # 微信appid |
| | | appId: wxe91f1af7638aa5dd |
| | | appId: wx618aa69186bf2ed6 |
| | | # 微信商户号 |
| | | mchId: 1678345627 |
| | | mchId: 1733623796 |
| | | # 秘钥 |
| | | secretId: a787e1a462715604e0c9528b6d8960d1 |
| | | secretId: d4af107e0b11236c1db24c1453f28bb3 |
| | | v3: |
| | | # 加签串 |
| | | apiKey: E10ADC3949BA59ABBE56E057F20F883E |
| | | apiKey: GZPkka0vgfzjhgAKg6E2PxKkKOKkC24c |
| | | # 加签证书地址 |
| | | privateKeyPath: E:\qiyeweixin\WXWork\1688857859704927\Cache\File\2025-11\333\apiclient_key.pem |
| | | privateKeyPath: E:\qiyeweixin\WXWork\1688857859704927\Cache\File\2025-12\1733623796_20251202_cert\apiclient_key.pem |
| | | # 微信支付公钥id |
| | | publicKeyId: |
| | | publicKeyId: PUB_KEY_ID_0117336237962025120100192279000801 |
| | | # 微信支付公钥证书 |
| | | publicKeyPath: E:\qiyeweixin\WXWork\1688857859704927\Cache\File\2025-11\333\apiclient_cert.pem |
| | | publicKeyPath: E:\qiyeweixin\WXWork\1688857859704927\Cache\File\2025-12\pub_key.pem |
| | | # 证书序列号 |
| | | mchSerialNo: 6C90982EFB55341700A70A33CF8BED58938FB0E2 |
| | | mchSerialNo: 5ED4C99FE5657DA2579BE5E7AE4255C9468627D9 |
| | | # 支付成功回调地址 |
| | | notifyPayUrl: http://221.182.45.100:9100/api/wx/pay/notify |
| | | # 支付退款回调地址 |
| | |
| | | "/t-large-user/pageListLarge","/t-large-volunteer/pageListLarge", |
| | | "/pension/getAssistedDiningList", |
| | | "/pension/getAssistedDiningDetail", |
| | | "/statistics/**" |
| | | "/statistics/**","/course/**" |
| | | ).permitAll() |
| | | // 静态资源,可匿名访问 |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() |
| | |
| | | */ |
| | | private String publicKeyId; |
| | | /** |
| | | * 微信支付公钥证书 apiclient_cert.pem |
| | | * 微信支付公钥证书 pub_key.pem |
| | | */ |
| | | private String publicKeyPath; |
| | | /** |
| | |
| | | */ |
| | | public static PublicKey loadPublicKeyFromString(String keyString) { |
| | | try { |
| | | keyString = keyString.replace("-----BEGIN CERTIFICATE-----", "") |
| | | .replace("-----END CERTIFICATE-----", "") |
| | | keyString = keyString.replace("-----BEGIN PUBLIC KEY-----", "") |
| | | .replace("-----END PUBLIC KEY-----", "") |
| | | .replaceAll("\\s+", ""); |
| | | return KeyFactory.getInstance("RSA").generatePublic( |
| | | new X509EncodedKeySpec(Base64.getDecoder().decode(keyString))); |
| | |
| | | request.outTradeNo = tradeNo; |
| | | // request.timeExpire = "2018-06-08T10:34:56+08:00"; |
| | | request.attach = attach; |
| | | request.notifyUrl = this.config.getCallBackUrl(); |
| | | request.notifyUrl = this.config.getV3().getNotifyPayUrl(); |
| | | request.goodsTag = "WXG"; |
| | | request.supportFapiao = false; |
| | | request.amount = new JsapiPrepay.CommonAmountInfo(); |