Merge remote-tracking branch 'origin/develop' into develop

master
dalong306 4 years ago
commit e170d4f90f

@ -5,11 +5,11 @@
<parent> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>2.2.20</version> <version>2.2.21</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.3.70</version> <version>2.3.72</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>

@ -418,6 +418,49 @@ paths:
text/html: text/html:
schema: schema:
type: string 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}: /h5_payment/partners/{partner_code}/orders/{partner_order_id}:
put: put:
summary: MobileH5下单 summary: MobileH5下单

@ -427,6 +427,49 @@ paths:
text/html: text/html:
schema: schema:
type: string 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}: /h5_payment/partners/{partner_code}/orders/{partner_order_id}:
put: put:
summary: Create MobileH5 order summary: Create MobileH5 order

@ -45,8 +45,6 @@ public interface RefundMapper {
@AutoSql(SqlType.SELECT) @AutoSql(SqlType.SELECT)
JSONObject findByOutRefundId(@Param("out_refund_id") String outRefundNo); 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<JSONObject> listConfirmedRefundsWithNoTransactions(); List<JSONObject> listConfirmedRefundsWithNoTransactions();
JSONObject findRefundInfoByDay(@Param("begin") Date begin, @Param("end") Date end); JSONObject findRefundInfoByDay(@Param("begin") Date begin, @Param("end") Date end);

@ -1,31 +1,22 @@
package au.com.royalpay.payment.manage.riskbusiness.core.impl; 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.RiskEventMapper;
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskFileMapper; 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.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.RiskProcessLogService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; 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 com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.ParseException;
import java.util.Date; import java.util.Date;
import java.util.List;
@Service @Service
public class RiskUploadServiceIpml implements RiskUploadService { 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")); material.put("material_id",riskMaterialMapper.findAllMaterials(riskId).get(0).getString("material_id"));
for(int i=1;i<=10;i++){ for(int i=1;i<=10;i++){
if(material.containsKey("file"+i+"_url")){ if(material.containsKey("file"+i+"_url")){
List<String> urls = (List<String>)material.get("file"+i+"_url"); JSONArray urls = material.getJSONArray("file" + i + "_url");
if (urls == null || urls.isEmpty()) if (urls == null || urls.isEmpty())
continue; continue;
for(String url:urls){ for(Object url:urls){
JSONObject file = new JSONObject(); JSONObject file = new JSONObject();
file.put("file_url",url); file.put("file_url",url.toString());
file.put("file_type",i); file.put("file_type",i);
file.put("material_id",material.getString("material_id")); file.put("material_id",material.getString("material_id"));
riskFileMapper.save(file); riskFileMapper.save(file);

@ -160,11 +160,11 @@ settle:
- RPAY_SVC_CARD - RPAY_SVC_CARD
- RPAY_SVC_DIRECTDEBIT - RPAY_SVC_DIRECTDEBIT
logging: logging:
level: level:
au: au:
com: com:
royalpay: royalpay:
payment: debug payment: debug

@ -758,20 +758,12 @@
</select> </select>
<select id="listOrdersWithNoTransactions" resultType="com.alibaba.fastjson.JSONObject"> <select id="listOrdersWithNoTransactions" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT
o.order_id,
o.channel
SELECT FROM pmt_orders o
o.order_id, left join pmt_transactions t on t.order_id=t.order_id and t.transaction_type='Credit'
o.channel where t.order_id=null and o.status >= 5 AND o.customer_payment_amount > 0
FROM pmt_orders o
WHERE o.order_id NOT IN (
SELECT DISTINCT order_id
FROM pmt_transactions
WHERE transaction_type = 'Credit') AND o.status >= 5 AND o.customer_payment_amount > 0
]]> ]]>
</select> </select>

@ -128,4 +128,8 @@
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
<select id="listConfirmedRefundsWithNoTransactions" resultType="com.alibaba.fastjson.JSONObject">
select r.refund_id,r.order_id from pmt_refunds r left join pmt_transactions t on t.refund_id=r.refund_id
where r.status=4 and confirm_time is not null and t.refund_id is null
</select>
</mapper> </mapper>

@ -180,6 +180,8 @@
<p><label class="control-label" style="cursor: pointer">Payer Card Information</label></p> <p><label class="control-label" style="cursor: pointer">Payer Card Information</label></p>
</div> </div>
<div ng-if="showPayerCardInfo"> <div ng-if="showPayerCardInfo">
<p class="tradeCardInfo"><label style="padding-right: 20%;">Card Holder Name: </label>
{{order.name}}</p>
<p class="tradeCardInfo"><label style="padding-right: 20%;">Card Bank: </label> <p class="tradeCardInfo"><label style="padding-right: 20%;">Card Bank: </label>
{{order.card_bank}}</p> {{order.card_bank}}</p>
<p class="tradeCardInfo"><label style="padding-right: 20%;">Card Type: </label> <p class="tradeCardInfo"><label style="padding-right: 20%;">Card Type: </label>

@ -55,6 +55,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.pagination = resp.data.pagination; $scope.pagination = resp.data.pagination;
}); });
}; };
$scope.linkButton = function (obj) { $scope.linkButton = function (obj) {
var partner = angular.copy(obj); var partner = angular.copy(obj);
partner.link = true; partner.link = true;
@ -153,12 +154,36 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}); });
}; };
$scope.pass = function (obj) { $scope.pass = function (partner) {
$uibModal.open({
$http.get('/sys/partners/init/merchant_code').then(function (response) {
partner.client_moniker = response.data.partner_code;
console.log('partner.client_moniker',partner.client_moniker)
console.log('partner',partner)
$scope.merchantCodeChecked = true;
$scope.merchantIsValid = true;
$uibModal.open({
templateUrl: '/static/payment/partner/templates/partner_application_pass.html',
controller: 'passApplicationCtrl',
resolve: {
partner: partner
}
}).result.then(function () {
commonDialog.alert({
title: 'Success',
content: 'Pass Successfully ! 您成功建立了新的商户,请及时完善信息。',
type: 'success'
});
// $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true});
})
});
/*$uibModal.open({
templateUrl: '/static/payment/partner/templates/partner_application_pass.html', templateUrl: '/static/payment/partner/templates/partner_application_pass.html',
controller: 'passApplicationCtrl', controller: 'passApplicationCtrl',
resolve: { resolve: {
partner: obj partner: obj,
isPass:true
} }
}).result.then(function () { }).result.then(function () {
commonDialog.alert({ commonDialog.alert({
@ -167,7 +192,10 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
type: 'success' type: 'success'
}); });
// $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true}); // $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true});
}) })*/
}; };
$scope.updateRemark = function () { $scope.updateRemark = function () {
var obj = angular.copy($scope.partner); var obj = angular.copy($scope.partner);
@ -177,6 +205,8 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}]); }]);
app.controller('passApplicationCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) { app.controller('passApplicationCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) {
$scope.partner = angular.copy(partner); $scope.partner = angular.copy(partner);
$scope.merchantCodeChecked = false;
$scope.merchantIsValid = false;
$scope.submit = function (form) { $scope.submit = function (form) {
if (form.$invalid) { if (form.$invalid) {
angular.forEach(form, function (item, key) { angular.forEach(form, function (item, key) {
@ -198,6 +228,28 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}); });
//$rootScope.partner_application = $scope.client; //$rootScope.partner_application = $scope.client;
}; };
$scope.initMerchantCode=function(){
$http.get('/sys/partners/init/merchant_code').then(function (response) {
$scope.partner.client_moniker = response.data.partner_code;
console.log('refresh',$scope.partner.client_moniker)
$scope.merchantCodeChecked = true;
$scope.merchantIsValid = true;
});
};
$scope.checkMerchantCodeIsValid = function (code) {
if (code.length != 4) {
$scope.merchantCodeChecked = false;
$scope.merchantIsValid = false;
return;
}
$http.get('/sys/partners/init/check_code_isvalid', {params: {clientMoniker: code}}).then(function (response) {
$scope.merchantIsValid = response.data;
$scope.merchantCodeChecked = true;
});
};
$scope.link = function (form) { $scope.link = function (form) {
if (form.$invalid) { if (form.$invalid) {
angular.forEach(form, function (item, key) { angular.forEach(form, function (item, key) {

@ -7,13 +7,20 @@
<form name="partnerForm" novalidate> <form name="partnerForm" novalidate>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':partnerForm.client_moniker.$invalid && partnerForm.client_moniker.$dirty}"> ng-class="{'has-error':partnerForm.client_moniker.$invalid && partnerForm.client_moniker.$dirty}">
<label class="control-label col-sm-6" for="short-id-input">Partner Code(4 Letters or <label class="control-label col-sm-4" for="short-id-input">* Partner Code(4 Letters or
Numbers)</label> Numbers)</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control text-uppercase" ng-model="partner.client_moniker" <input ng-if="!partner.link" class="form-control text-uppercase" ng-model="partner.client_moniker"
type="text" type="text"
name="client_moniker" name="client_moniker"
id="short-id-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/"> id="short-id-pass-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/">
<input ng-if="partner.link" class="form-control text-uppercase"
ng-model="partner.client_moniker"
type="text"
name="client_moniker"
id="short-id-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/"
ng-change="checkMerchantCodeIsValid(partner.client_moniker)">
<p class="small text-info">No further changeable!</p> <p class="small text-info">No further changeable!</p>
<div ng-messages="partnerForm.client_moniker.$error" <div ng-messages="partnerForm.client_moniker.$error"
ng-if="partnerForm.client_moniker.$dirty"> ng-if="partnerForm.client_moniker.$dirty">
@ -23,6 +30,11 @@
Numbers are allowed</p> Numbers are allowed</p>
</div> </div>
</div> </div>
<a ng-if="!partner.link" style="display: inline-block" role="button" ng-click="initMerchantCode(partner)"><i class="fa fa-refresh" title="Refreshes the partner code"></i></a>
<span ng-if="!partner.link&&merchantCodeChecked">
<i ng-if="merchantIsValid" class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none;padding-left: 20px"></i>
<i ng-if="!merchantIsValid" class="text-danger fa fa-close" style="float: none;padding-left: 20px"></i>
</span>
</div> </div>
</form> </form>
</div> </div>

@ -1,5 +1,7 @@
package au.com.royalpay.payment.manage.valid; 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.DateTime;
import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
@ -17,4 +19,29 @@ public class TestJodaFormat {
String dateStr = formatter.print(new DateTime(new Date())); String dateStr = formatter.print(new DateTime(new Date()));
System.out.println(dateStr); 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);
}
}
}
}
} }

Loading…
Cancel
Save