diff --git a/pom.xml b/pom.xml index f555b5cac..85a9abf62 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 2.2.20 + 2.2.21 4.0.0 manage - 2.3.70 + 2.3.72 UTF-8 2.4.0 diff --git a/src/document/openapi/cn/document.yml b/src/document/openapi/cn/document.yml index fccc8a66a..110937038 100644 --- a/src/document/openapi/cn/document.yml +++ b/src/document/openapi/cn/document.yml @@ -418,6 +418,49 @@ paths: text/html: schema: type: string + /gateway/partners/{partner_code}/native_jsapi/{partner_order_id}: + put: + summary: 原生JSSDK下单 + description: 原生JSSDK允许商户在自己的微商城页面上直接拉起微信/支付宝支付,拉起方式详见微信/支付宝官方文档 + x-sort-order: 0 + parameters: + - name: partner_code + in: path + required: true + - name: partner_order_id + in: path + required: true + tags: + - JSAPI + requestBody: + content: + application/json: + schema: + allOf: + - $ref: 'components_order.yml#/orderWithChannel' + - type: object + required: + - customer_id + properties: + appid: + type: string + description: 商户公众号appid,接入微信支付必填,支付宝不需要 + customer_id: + type: string + description: 商户公众号获取的用户openid,支付宝需要获取userid + responses: + 200: + description: Order + content: + application/json: + schema: + allOf: + - $ref: 'components_order.yml#/orderBasicResponse' + - type: object + properties: + sdk_params: + type: string + description: 序列化后的json字符串,直接提交给微商城页面端作为参数发起支付 /h5_payment/partners/{partner_code}/orders/{partner_order_id}: put: summary: MobileH5下单 diff --git a/src/document/openapi/en/document.yml b/src/document/openapi/en/document.yml index e58001d0d..e575312b8 100644 --- a/src/document/openapi/en/document.yml +++ b/src/document/openapi/en/document.yml @@ -427,6 +427,49 @@ paths: text/html: schema: type: string + /gateway/partners/{partner_code}/native_jsapi/{partner_order_id}: + put: + summary: Native JSSDK order + description: Native JSSDK allows merchants to open Wechat/Alipay cashier view. For details please check Alipay/Wechat documents + x-sort-order: 0 + parameters: + - name: partner_code + in: path + required: true + - name: partner_order_id + in: path + required: true + tags: + - JSAPI + requestBody: + content: + application/json: + schema: + allOf: + - $ref: 'components_order.yml#/orderWithChannel' + - type: object + required: + - customer_id + properties: + appid: + type: string + description: Wechat official account appid, required for Wechat + customer_id: + type: string + description: Customer openid acquired by merchant's wechat official account or userid from Alipay + responses: + 200: + description: Order + content: + application/json: + schema: + allOf: + - $ref: 'components_order.yml#/orderBasicResponse' + - type: object + properties: + sdk_params: + type: string + description: serialized json parameters. which can be take as parameter while opening cashier view in Wechat/Alipay /h5_payment/partners/{partner_code}/orders/{partner_order_id}: put: summary: Create MobileH5 order diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.java index 6284d9064..dd4926da6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.java @@ -45,8 +45,6 @@ public interface RefundMapper { @AutoSql(SqlType.SELECT) JSONObject findByOutRefundId(@Param("out_refund_id") String outRefundNo); - @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "status=4 and confirm_time is not null and refund_id not in (select refund_id from pmt_transactions where refund_id is not null)") List listConfirmedRefundsWithNoTransactions(); JSONObject findRefundInfoByDay(@Param("begin") Date begin, @Param("end") Date end); diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskUploadServiceIpml.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskUploadServiceIpml.java index d24b95a2a..6b6d47c40 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskUploadServiceIpml.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskUploadServiceIpml.java @@ -1,31 +1,22 @@ package au.com.royalpay.payment.manage.riskbusiness.core.impl; -import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper; import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskFileMapper; import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; -import au.com.royalpay.payment.manage.notice.core.MailService; -import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.thymeleaf.context.Context; -import org.thymeleaf.spring5.SpringTemplateEngine; import javax.annotation.Resource; -import java.text.ParseException; import java.util.Date; -import java.util.List; @Service public class RiskUploadServiceIpml implements RiskUploadService { @@ -55,12 +46,12 @@ public class RiskUploadServiceIpml implements RiskUploadService { material.put("material_id",riskMaterialMapper.findAllMaterials(riskId).get(0).getString("material_id")); for(int i=1;i<=10;i++){ if(material.containsKey("file"+i+"_url")){ - List urls = (List)material.get("file"+i+"_url"); + JSONArray urls = material.getJSONArray("file" + i + "_url"); if (urls == null || urls.isEmpty()) continue; - for(String url:urls){ + for(Object url:urls){ JSONObject file = new JSONObject(); - file.put("file_url",url); + file.put("file_url",url.toString()); file.put("file_type",i); file.put("material_id",material.getString("material_id")); riskFileMapper.save(file); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml index b03e0d00d..e0f911fc8 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml @@ -758,20 +758,12 @@ diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml index 0bc54e7fb..ee43e6e60 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml @@ -128,4 +128,8 @@ order by create_time desc + \ No newline at end of file diff --git a/src/test/java/au/com/royalpay/payment/manage/valid/TestJodaFormat.java b/src/test/java/au/com/royalpay/payment/manage/valid/TestJodaFormat.java index dc877a3c6..0205c7a92 100644 --- a/src/test/java/au/com/royalpay/payment/manage/valid/TestJodaFormat.java +++ b/src/test/java/au/com/royalpay/payment/manage/valid/TestJodaFormat.java @@ -1,5 +1,7 @@ package au.com.royalpay.payment.manage.valid; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; @@ -17,4 +19,29 @@ public class TestJodaFormat { String dateStr = formatter.print(new DateTime(new Date())); System.out.println(dateStr); } + + @Test + public void testSubmitMaterial() { + + JSONObject material = new JSONObject(); + + material.put("file1_url",new JSONArray(){{ + add("https://open.yeepay.com/docs/v2/products/cbp/apis/options__rest__v1.0__kj__fe__query/index.html"); + add("https://www.baidu.com"); + }}); + + for(int i=1;i<=10;i++){ + if(material.containsKey("file"+i+"_url")){ + JSONArray urls = material.getJSONArray("file" + i + "_url"); + if (urls == null || urls.isEmpty()) + continue; + for(Object url:urls){ + JSONObject file = new JSONObject(); + file.put("file_url",url); + file.put("file_type",i); + } + } + } + + } }