master
kira 6 years ago
commit 33bca80450

@ -106,60 +106,7 @@
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在 * @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*/ */
/**
* @api {PUT} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id} 创建H5支付单
* @apiName NewMobileH5Pay
* @apiGroup MobileH5
* @apiVersion 1.0.0
* @apiDescription
* <b>注意微信H5支付接口必须单独申请腾讯批复后方可使用有需要的商户请联系RoyalPay客服支付宝无此限制</b><br>
* H5支付适用场景为移动端App或者手机自带浏览器进行支付用户下单后浏览器跳转至微信支付页面并自动拉起微信/支付宝客户端完成支付<br>
* 返回值包括跳转支付地址跳转支付页需要带上签名信息
* 货币类型如果是CNY注意通过汇率转换后不得低于0.01AUD否则订单可以创建成功但支付时会报金额不合法错误<br>
* <img src="img/h5_api_payment.jpg">
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String=Alipay,Wechat} channel 支付渠道大小写敏感
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
* @apiParam (JSON) {String} operator 操作人员标识
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code SUCCESS表示创建订单成功EXISTS表示订单已存在
* @apiSuccess {String} partner_code 商户编码
* @apiSuccess {String} channel 支付渠道
* @apiSuccess {String} full_name 商户注册全名
* @apiSuccess {String} partner_name 商户名称
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {String} pay_url 跳转URL
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
*
*/
/**
* @api {GET} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id}/pay H5支付跳转页
* @apiName MobileH5Pay
* @apiDescription 必须先调用创建H5支付订单接口再进行跳转
* 建议在用户回调到对应页时通过后台查询订单状态接口确认订单的支付状态
* @apiVersion 1.0.0
* @apiGroup MobileH5
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求已预先创建
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect 必填支付成功后跳转页面回调时会带上签名参数用于校验
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*/
/** /**
* @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} 创建JSAPI订单 * @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} 创建JSAPI订单

@ -109,62 +109,7 @@
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist * @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/ */
/**
* @api {PUT} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id} Create H5 Payment
* @apiName NewMobileH5Pay
* @apiGroup MobileH5
* @apiVersion 1.0.0
* @apiDescription
* <b>WarningH5 Payment socket requires application separately and requires agreement from Tencent. Merchants who needs this socket please contact RoyalPay first.
* Alipay has no limit at the moment.</b><br>
* H5 Payment is used for payment in Webpage or App on mobile outside WeChat or Alipay App. The browser would redirect to a webpage from WeChat or Alipay and call the App to finish the payment.<br>
* Return value contains a payment page. Partners shall guide users to redirect to this page. Sign params are required.
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.<br>
* <img src="img/h5_api_payment.jpg">
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD currency
* @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} channel Payment channel
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id.
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {GET} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id}/pay H5 Payment Page
* @apiName MobileH5Pay
* @apiDescription This page mush be called after payment order has been created.
* When jumping back to redirection URL, it is recommended to call the order query API to make sure the payment has succeeded.
* @apiVersion 1.0.0
* @apiGroup MobileH5
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. It shall have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when payment succeeded. Contain sign parameters for validation.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/** /**
* @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} Create JSAPI Payment Order * @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} Create JSAPI Payment Order

@ -17,6 +17,7 @@ import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.Date; import java.util.Date;
@ -76,6 +77,20 @@ public class ManualServiceimpl implements ManualService {
cleanDays = wechatRate.getIntValue("c_clean_days"); cleanDays = wechatRate.getIntValue("c_clean_days");
} }
int finalCleanDays = cleanDays; int finalCleanDays = cleanDays;
modifyClientRates(finalCleanDays,clientRates,client_id,p.getString("client_moniker"));
});
});
logger.info("end doing client postpone");
}
@Transactional
public void modifyClientRates(int finalCleanDays,List<JSONObject> clientRates,int client_id,String client_moniker) {
Date now = new Date();
Date tomorrow = DateUtils.addDays(now, 1);
Date yearTomorrow = DateUtils.addYears(tomorrow, 1);
clientRates.forEach(o -> { clientRates.forEach(o -> {
JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name")); JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name"));
record.remove("client_rate_id"); record.remove("client_rate_id");
@ -93,10 +108,6 @@ public class ManualServiceimpl implements ManualService {
} }
}); });
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, p.getString("client_moniker"), "tax_in_surcharge", false)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, client_moniker, "tax_in_surcharge", false));
});
});
logger.info("end doing client postpone");
} }
} }

@ -1576,6 +1576,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
@Transactional
public void newConfigRate(JSONObject manager, String clientMoniker, JSONObject config) { public void newConfigRate(JSONObject manager, String clientMoniker, JSONObject config) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
@ -1636,6 +1637,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
@Transactional
public void modifyRateConfig(JSONObject manager, String clientMoniker, int rateId, ClientRateConfig config) { public void modifyRateConfig(JSONObject manager, String clientMoniker, int rateId, ClientRateConfig config) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
@ -3195,6 +3197,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
@Transactional
public void setSkipClearing(JSONObject account, String clientMoniker, Boolean skip_clearing) { public void setSkipClearing(JSONObject account, String clientMoniker, Boolean skip_clearing) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {

Loading…
Cancel
Save