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

master
dalong306 4 years ago
commit e170d4f90f

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

@ -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下单

@ -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

@ -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<JSONObject> listConfirmedRefundsWithNoTransactions();
JSONObject findRefundInfoByDay(@Param("begin") Date begin, @Param("end") Date end);

@ -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<String> urls = (List<String>)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);

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

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

@ -128,4 +128,8 @@
</where>
order by create_time desc
</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>

@ -180,6 +180,8 @@
<p><label class="control-label" style="cursor: pointer">Payer Card Information</label></p>
</div>
<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>
{{order.card_bank}}</p>
<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.linkButton = function (obj) {
var partner = angular.copy(obj);
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'})
});
};
$scope.pass = function (obj) {
$uibModal.open({
$scope.pass = function (partner) {
$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',
controller: 'passApplicationCtrl',
resolve: {
partner: obj
partner: obj,
isPass:true
}
}).result.then(function () {
commonDialog.alert({
@ -167,7 +192,10 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
type: 'success'
});
// $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true});
})
})*/
};
$scope.updateRemark = function () {
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) {
$scope.partner = angular.copy(partner);
$scope.merchantCodeChecked = false;
$scope.merchantIsValid = false;
$scope.submit = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
@ -198,6 +228,28 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
});
//$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) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {

@ -7,13 +7,20 @@
<form name="partnerForm" novalidate>
<div class="form-group"
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>
<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"
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>
<div ng-messages="partnerForm.client_moniker.$error"
ng-if="partnerForm.client_moniker.$dirty">
@ -23,6 +30,11 @@
Numbers are allowed</p>
</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>
</form>
</div>
@ -35,4 +47,4 @@
<button type="button" class="btn btn-danger" ng-click="$dismiss()">Cancel</button>
<button type="button" ng-if="!partner.link" class="btn btn-success" ng-click="submit(partnerForm)">PASS</button>
<button type="button" ng-if="partner.link" class="btn btn-success" ng-click="link(partnerForm)">Link</button>
</div>
</div>

@ -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);
}
}
}
}
}

Loading…
Cancel
Save