Merge branch 'develop'

# Conflicts:
#	pom.xml
master
yixian 5 years ago
commit 0a426e4e7e

@ -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.1.44</version> <version>2.1.47</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.3.1</version> <version>2.3.2</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.2.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.2.0</jib-maven-plugin.version>

@ -540,7 +540,17 @@ paths:
domestic_only: domestic_only:
type: boolean type: boolean
default: false default: false
description: 是否只允许本国卡。由于境内境外卡支付手续费差异巨大,可在此限制。 description: |
是否只允许本国卡。由于境内境外卡支付手续费差异巨大,可在此限制。
**当商户开启消费者支付手续费功能而international_only提交了false时当前参数自动置为true。**
international_only:
type: boolean
default: false
description: |
是否只允许国际卡。当商户开启消费者支付手续费功能需要提交当前参数为true才可允许国际卡支付同时此订单将只允许国际卡支付。
**因此商户需要在支付页面提供本地卡和国际卡两个支付入口!**
当domestic_only=true的时候当前参数无效。
disable_credit_card: disable_credit_card:
type: boolean type: boolean
default: false default: false

@ -554,7 +554,18 @@ paths:
domestic_only: domestic_only:
type: boolean type: boolean
default: false default: false
description: whether only domestic cards can pay. due to there is huge difference on surcharge rate between domestic cards and international cards. merchants can add a limit on the order. description: |
Whether only domestic cards can pay. due to there is huge difference on surcharge rate between domestic cards and international cards.
Merchants can add a limit on the order.
**Note: If merchant enabled auto attach surcharge on orders, and international_only is false, this parameter will automatically set to true**
international_only:
type: boolean
default: false
description: |
If set this parameter to true, this order will refuse domestic cards. It is useful when merchant enabled auto attach surcharge to orders.
Then is required to set this value as true to enable international cards. This also means customers should choose use domestic cards or international cards first on merchants' page
And if domestic_only param is true, this param will be ignored.
disable_credit_card: disable_credit_card:
type: boolean type: boolean
default: false default: false
@ -610,14 +621,16 @@ paths:
put: put:
summary: Create Card Order summary: Create Card Order
description: | description: |
商户可在页面引入https://channel.rpayplus.com/channel/v1/view/card_input_frame.js Input https://channel.rpayplus.com/channel/v1/view/card_input_frame.js in merchant's webpage.
并通过回调取得key_id和secret信息并将其作为卡信息提交给royalpay直接完成下单支付。 After called commit, it will return `key_id` and `secret` parameter asyncronized by callback.
Post these parameter to royalpay and finish payment directly.
js引用案例 js Example
``` ```
let cardInputContainer = document.getElementById('card-input-area');//预先准备放置卡输入界面的container let cardInputContainer = document.getElementById('card-input-area');//a container prepared to put the card input frame in.
let cardInput = new CardInputFrame(cardInputContainer);//创建frame对象 let cardInput = new CardInputFrame(cardInputContainer);//create frame object
//设置iframe的样式参数 //setting iframe style
cardInput.frameStyle = { cardInput.frameStyle = {
width: '100%', width: '100%',
height: '400px', height: '400px',
@ -625,20 +638,22 @@ paths:
borderRadius: '10px' borderRadius: '10px'
}; };
cardInput.onError = function(msg){ cardInput.onError = function(msg){
//卡输入界面返回错误信息时进行展示 //if the input card message has mistake, will call this method and pass the error detail here
}; };
cardInput.onReady = function(){ cardInput.onReady = function(){
//iframe加载完毕的触发事件 //iframe loaded event
}; };
cardInput.onSuccess = function(secretData){ cardInput.onSuccess = function(secretData){
//成功取得加密卡信息回调 //success get encrypted card informations
//secretData: {'key_id':'','secret':''} //secretData: {'key_id':'','secret':''}
}; };
cardInput.show();//开始加载iframe cardInput.show();//start loading iframe
//通过外部事件触发卡输入界面提交注意卡输入界面没有按钮必须通过外部触发提交事件。并回调到onSuccess回调函数。 //call commit method when customer clicked pay button so that callbacks will be triggered
cardInput.commit(); cardInput.commit();
``` ```
**Note: This API do not allow customers pay for surcharge**
tags: tags:
- CardPayment - CardPayment
parameters: parameters:
@ -663,18 +678,20 @@ paths:
properties: properties:
key_id: key_id:
type: string type: string
description: 卡输入界面回调得到的key_id description: card input frame returned key_id
card_info: card_info:
type: string type: string
description: 卡输入界面回调得到的secret description: card input frame returned secret
domestic_only: domestic_only:
type: boolean type: boolean
default: false default: false
description: 是否只允许本国卡。由于境内境外卡支付手续费差异巨大,可在此限制。 description: |
Whether only domestic cards can pay. due to there is huge difference on surcharge rate between domestic cards and international cards.
Merchants can add a limit on the order.
disable_credit_card: disable_credit_card:
type: boolean type: boolean
default: false default: false
description: 如果希望禁止消费者使用信用卡支付可传入true description: Pass true if want to refuse credit cards.
customer: customer:
$ref: 'components_order.yml#/cardCustomerParam' $ref: 'components_order.yml#/cardCustomerParam'
responses: responses:
@ -686,10 +703,10 @@ paths:
$ref: 'components_order.yml#/orderBasicResponse' $ref: 'components_order.yml#/orderBasicResponse'
/micropay/partners/{partner_code}/orders/{partner_order_id}: /micropay/partners/{partner_code}/orders/{partner_order_id}:
put: put:
summary: 付款码下单 summary: Retail Passive Payment Order
description: | description: |
线下支付订单接口用于带有扫码设备的收银终端进行对接,商户输入金额后要求客户出示支付码,用扫码枪扫码后将扫码内容和金额一并提交并完成支付操作。 Retail Passive Payment is used for cashier terminals which can scan BarCode or QRCode. Shop staff input the payment amount and ask customers for their payment code,
线下支付订单接口现已兼容微信、支付宝通道。可根据付款码自动识别交易渠道。 then system send price and payment code to server and finish the payment. Retail Passive Payment now support both Alipay and WeChat
<img src="img/Retail_cn.png"> <img src="img/Retail_cn.png">
tags: tags:
- RetailPay - RetailPay
@ -715,10 +732,10 @@ paths:
properties: properties:
device_id: device_id:
type: string type: string
description: 扫码设备id description: ID of the device which sends the request
auth_code: auth_code:
type: string type: string
description: 付款码 description: The Payment QR Code scanned from customer's WeChat Wallet.
responses: responses:
200: 200:
description: Result description: Result
@ -728,9 +745,11 @@ paths:
$ref: 'components_order.yml#/orderStatus' $ref: 'components_order.yml#/orderStatus'
/retail_qrcode/partners/{partner_code}/orders/{partner_order_id}: /retail_qrcode/partners/{partner_code}/orders/{partner_order_id}:
put: put:
summary: 线下QRCode支付单 summary: Retail Active Payment Order
description: | description: |
线下QRCode支付用于对接无扫码设备的收银终端下单后得到二维码地址自行生成二维码图片后展示在收银终端屏幕上并由用户使用对应支付客户端进行扫码支付。 线下QRCode现已同时兼容支付宝、微信客户端进行支付 Retail Active Payment is used for cashier terminals which cannot scan Barcode or QRCode. Get the Code url after create the order,
convert this url to a QRCode and ask customers use their app to scan this QRCode then finish the payment.
Retail Active Payment now support Alipay, WeChat
<img src="img/RetailQR_cn.png"> <img src="img/RetailQR_cn.png">
tags: tags:
- RetailPay - RetailPay
@ -755,7 +774,7 @@ paths:
properties: properties:
device_id: device_id:
type: string type: string
description: 收银设备id description: ID of the device which sends the request.
responses: responses:
200: 200:
description: Order description: Order
@ -768,13 +787,13 @@ paths:
properties: properties:
code_url: code_url:
type: string type: string
description: 付款码字符串,商户可自行生成二维码 # todo description: QR Code string. Partners can create the payment QR Code according to this value.
/alipay/partners/{partner_code}/orders/{partner_order_id}: /alipay/partners/{partner_code}/orders/{partner_order_id}:
put: put:
summary: 支付宝WEB订单下单 summary: Alipay WEB Order
description: | description: |
创建订单后跳转到返回的pay_url需附加签名参数和redirect参数随后进入支付宝支付页面完成支付 Use for Alipay Payment in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. Then enter Alipay page to finish payment.
该接口现仅支持支付宝。 Alipay Channel Only.
tags: tags:
- AlipayOnline - AlipayOnline
parameters: parameters:
@ -803,10 +822,11 @@ paths:
properties: properties:
pay_url: pay_url:
type: string type: string
description: Payment page URL加签后传递给前端并跳转至当前URL让消费者完成支付 description: Payment page URL. redirect to the url with signature parameters.
/cb_bankpay/partners/{partner_code}/orders/{partner_order_id}: /cb_bankpay/partners/{partner_code}/orders/{partner_order_id}:
put: put:
summary: 网银快捷支付下单 summary: CB BankPay Order
description: Use for CB BankPay in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param.
tags: tags:
- CB Bank - CB Bank
parameters: parameters:
@ -831,10 +851,10 @@ paths:
properties: properties:
product_name: product_name:
type: string type: string
description: 商品名称 description: production name
gateway_type: gateway_type:
type: integer type: integer
description: '网关类型8: H5网关9PC网关' description: 'Gateway Require 8: H5 gateway,9: PC gateway'
enum: enum:
- 8 - 8
- 9 - 9
@ -850,10 +870,13 @@ paths:
properties: properties:
pay_url: pay_url:
type: string type: string
description: Payment page URL加签后传递给前端并跳转至当前URL让消费者完成支付 description: Payment page URL. redirect to the url with signature parameters.
/gateway/partners/{partner_code}/app_orders/{partner_order_id}: /gateway/partners/{partner_code}/app_orders/{partner_order_id}:
put: put:
summary: SDK下单 summary: SDK Order
description: |
Used for mobile Apps calling Wechat payment with Wechat SDK. Call this api to create order and get param string for SDK calling.
Call SDK api with the param to start payment and get payment result from Wechat app It is strongly advised to request RoyalPay order query Api to confirm that the order has been paid in order to cancelling order by system at the same time.
tags: tags:
- SDK Payment - SDK Payment
parameters: parameters:
@ -877,23 +900,23 @@ paths:
properties: properties:
channel: channel:
type: string type: string
description: 支付渠道,大小写敏感 description: Payment channel, required, case sensitive
enum: enum:
- Wechat - Wechat
- Alipay - Alipay
system: system:
type: string type: string
description: 客户端操作类型,支付宝选填,微信不需要 description: OS type of client app, optional for Alipay, not required for Wechat
enum: enum:
- android - android
- iphone - iphone
- ipad - ipad
version: version:
type: string type: string
description: 客户端版本号,支付宝选填,微信不需要 description: client app version, optional for Alipay, not required for Wechat
appid: appid:
type: string type: string
description: 微信必填开发者平台appid description: wechat appid, required for Wechat, not required for Alipay
responses: responses:
200: 200:
description: Order description: Order
@ -906,11 +929,13 @@ paths:
properties: properties:
sdk_params: sdk_params:
type: string type: string
description: json字符串可直接传递给SDK端发起支付 description: param string for calling SDK
/gateway/partners/{partner_code}/channel_exchange_rate: /gateway/partners/{partner_code}/channel_exchange_rate:
get: get:
summary: 渠道汇率查询 summary: Channel Exchange Rates
description: 获取当前各渠道AUD兑CNY汇率值(1AUD=?CNY),该汇率仅做参考,以实际成交汇率为准 description: |
Get current exchange rate from AUD to CNY provided by WeChat and Alipay(AUD 1=CNY ?).
This exchange rate shown is for reference only, please refer to the real time exchange rate when processing the actual transaction.
tags: tags:
- PublicApi - PublicApi
parameters: parameters:
@ -928,28 +953,29 @@ paths:
properties: properties:
return_code: return_code:
type: string type: string
description: 状态码 description: Execution result
example: example:
SUCCESS SUCCESS
wechat_rate: wechat_rate:
type: number type: number
description: 微信当前汇率 description: Wechat exchange rate
example: example:
4.41111 4.41111
alipay_retail_rate: alipay_retail_rate:
type: number type: number
description: 支付宝线下接口汇率 description: Alipay retail exchange rate
example: example:
4.411111 4.411111
alipay_online_rate: alipay_online_rate:
type: number type: number
description: 支付宝线上汇率 description: Alipay online exchange rate
example: example:
4.411111 4.411111
/gateway/partners/{partner_code}/orders/{partner_order_id}/refunds/{partner_refund_id}: /gateway/partners/{partner_code}/orders/{partner_order_id}/refunds/{partner_refund_id}:
put: put:
summary: 发起退款 summary: Refund Order
description: 一笔支付订单可以分多次退款,退款总金额不得超过实际支付金额,退款币种与支付订单一致 description: |
One payment order can create more than one refund orders. Total amount of all refund orders must be less than or equal to the actual paid amount and the currency of refund order is the same as the payment order.
tags: tags:
- QRCode - QRCode
- JSAPI - JSAPI
@ -967,11 +993,11 @@ paths:
- name: partner_order_id - name: partner_order_id
in: path in: path
required: true required: true
description: 需要退款订单的单号 description: Payment order id in merchant's system
- name: partner_refund_id - name: partner_refund_id
in: path in: path
required: true required: true
description: 退款单号 description: Refund id in merchant's system
requestBody: requestBody:
content: content:
application/json: application/json:
@ -982,10 +1008,10 @@ paths:
properties: properties:
fee: fee:
type: integer type: integer
description: 退款金额,单位是货币最小单位,单个订单退款单金额总和不能超过用户支付金额 description: 退Refund amount. Use base unit of the currency. Total amount of all refund orders must be less than actual paid amount.
device_id: device_id:
type: string type: string
description: 操作设备id description: ID of the device which sends the request
responses: responses:
200: 200:
description: Refund description: Refund
@ -994,7 +1020,7 @@ paths:
schema: schema:
$ref: 'components_order.yml#/refundStatus' $ref: 'components_order.yml#/refundStatus'
get: get:
summary: 查询退款 summary: Check Refund Status
tags: tags:
- QRCode - QRCode
- JSAPI - JSAPI
@ -1012,11 +1038,11 @@ paths:
- name: partner_order_id - name: partner_order_id
in: path in: path
required: true required: true
description: 订单的单号 description: Payment order id in merchant's system
- name: partner_refund_id - name: partner_refund_id
in: path in: path
required: true required: true
description: 退款单号 description: Refund id in merchant's system
responses: responses:
200: 200:
description: Refund Status description: Refund Status
@ -1026,10 +1052,13 @@ paths:
$ref: 'components_order.yml#/refundStatus' $ref: 'components_order.yml#/refundStatus'
/gateway/partners/{partner_code}/transactions: /gateway/partners/{partner_code}/transactions:
get: get:
summary: 查询流水 summary: Check Transactions
description: | description: |
本接口将列出商户当日所有流水,包括所有接口(含非网关接口)支付通道的付款、RoyalPay优惠补贴、退款、 退款失败补正、系统补正、营销账户转入转出等,不含清算信息 This Api will list all transactions for current merchant in the day, containing all payment methods(include no gateway methods) and all payment channels such as payment,
注意一笔付款订单或退款订单均可能对应多条流水记录 RoyalPay discount cashback, refunds, credit for failure refunds, system pay back,
cashback account income/outcome, etc. Settlement transactions will not be contained.
**Note: A payment order or refund order can contains several transaction records**
tags: tags:
- PublicApi - PublicApi
parameters: parameters:
@ -1043,7 +1072,7 @@ paths:
type: string type: string
in: query in: query
required: true required: true
description: 账单日期,'yyyyMMdd'格式GMT+10只能查今天以前的账单 description: Transaction date. Format as 'yyyyMMdd', GMT+10. Only transaction before today can be query
example: 20200315 example: 20200315
responses: responses:
200: 200:
@ -1065,13 +1094,13 @@ paths:
SUCCESS SUCCESS
transaction_count: transaction_count:
type: integer type: integer
description: 流水条数 description: transactions number
order_count: order_count:
type: integer type: integer
description: 付款条数 description: credit number
refund_count: refund_count:
type: integer type: integer
description: 退款条数 description: debit number
transactions: transactions:
type: array type: array
items: items:
@ -1086,10 +1115,13 @@ paths:
description: target settlement date, maybe delay due to holidays and bank issues(yyyy-MM-dd) description: target settlement date, maybe delay due to holidays and bank issues(yyyy-MM-dd)
/gateway/partners/{partner_code}/settlements: /gateway/partners/{partner_code}/settlements:
get: get:
summary: 查看清算详情 summary: Check Settlements
description: | description: |
本接口将列出商户查询日期清算的所有流水,包括所有接口(含非网关接口)支付通道的付款、RoyalPay优惠补贴、退款、 退款失败补正、系统补正、营销账户转入转出等 This Api will list all transactions with the settlement this day, containing all payment methods(include no gateway methods)
注意一笔付款订单或退款订单均可能对应多条流水记录 and all payment channels such as payment, RoyalPay discount cashback, refunds, credit for failure refunds,
system pay back, cashback account income/outcome, etc.
**Note: A payment order or refund order can contains several transaction records**
tags: tags:
- PublicApi - PublicApi
parameters: parameters:
@ -1102,7 +1134,7 @@ paths:
format: date format: date
pattern: yyyyMMdd pattern: yyyyMMdd
type: string type: string
description: 清算日期,'yyyyMMdd'格式GMT+10只能查今天以前 description: Settle date. Format as 'yyyyMMdd' ,GMT+10. Only settlement before today can be query
required: true required: true
responses: responses:
200: 200:
@ -1119,56 +1151,58 @@ paths:
SUCCESS SUCCESS
result_code: result_code:
type: string type: string
description: 业务Execute Result description: Process Result
example: example:
SUCCESS SUCCESS
settle_from: settle_from:
type: string type: string
format: date format: date
description: 订单起始日期yyyyMMdd description: 'Transaction date from, yyyyMMdd'
settle_to: settle_to:
type: string type: string
format: date format: date
description: 订单截止日期:yyyyMMdd description: Transaction date to, yyyyMMdd
settle_days: settle_days:
type: string type: string
description: 清算周期 description: Settle delay
example: example:
T+2 T+2
transaction_count: transaction_count:
type: integer type: integer
description: 流水条数 description: transaction record count
order_count: order_count:
type: integer type: integer
description: 付款条数 description: credit count
refund_count: refund_count:
type: integer type: integer
description: 退款条数 description: debit count
total_credit: total_credit:
type: integer type: integer
description: 入账总金额(AUD分) description: total credit fee(AUD cent)
total_debits: total_debits:
type: integer type: integer
description: 支出总金额(AUD分) description: total debit fee(AUD cent)
total_surcharge: total_surcharge:
type: integer type: integer
description: 手续费总额(AUD分) description: Total surcharge(AUD cent)
total_transfer: total_transfer:
type: integer type: integer
description: 打款总额(AUD分) description: Total transfer amount(AUD cent)
transactions: transactions:
type: array type: array
items: items:
$ref: 'components_order.yml#/transactionItem' $ref: 'components_order.yml#/transactionItem'
/notify: /notify:
post: post:
summary: 到账通知 summary: Order Paid Notify
description: | description: |
若订单创建时提供了notify_url系统会在用户支付成功后向这个地址主动发送支付成功状态推送请求方式为POST If notify_url is provided when order is created. System will post request to this url when the payment succeeds.
与服务器API不同推送校验参数会包含在json内商户系统应该验证校验参数确定来源正确后再次进行订单接口查询确认订单支付状态再进行后续操作。 Request method is POST. Different from Server APIs, sign parameters will be included in json entity.
商户系统收到请求后应按要求返回参数若RoyalPay未收到合法参数视为商户未接收成功推送动作首次触发会重试3次随后24小时内每10分钟推送一次直到返回200状态码。 Partner system shall valid them to prevent fake requests. Partner system shall response with correct parameters.
商户系统应当能够处理收到的重复请求。 If RoyalPay did not receive valid response, system will regard as receiving failed and retry the notification.
商户系统收到通知后以防万一应调用主动查询接口确认订单状态。 System will retry up to3 times. Partner system shall be able to handle the repeated requests.
**It is recommended to actively call the query API to confirm the payment status after receiving the push, so as to prevent other third parties from forging the push!**
tags: tags:
- SDK Payment - SDK Payment
- CB Bank - CB Bank
@ -1188,53 +1222,53 @@ paths:
time: time:
type: integer type: integer
format: int64 format: int64
description: UTC时间戳 description: UTC timestamp in millis
nonce_str: nonce_str:
type: string type: string
description: 随机字符串 description: Random string
sign: sign:
type: string type: string
description: 签名 description: Sign
partner_order_id: partner_order_id:
type: string type: string
description: 商户单号 description: Partner order id
channel_order_id: channel_order_id:
type: string type: string
description: 渠道方交易单号 description: PayChannel(Alipay、Wechat) Transaction Trade No
order_id: order_id:
type: string type: string
description: RoyalPay订单号 description: RoyalPay order id
total_fee: total_fee:
type: integer type: integer
description: 订单金额,单位是最小货币单位 description: Order amount
real_fee: real_fee:
type: integer type: integer
description: 支付金额,单位是最小货币单位 description: Actual paid amount
rate: rate:
type: number type: number
description: 交易时使用的汇率,1AUD=?CNY description: Exchange Rate used while trading. 1AUD=?CNY
currency: currency:
type: string type: string
description: 币种,AUD description: Currency, AUD
channel: channel:
type: string type: string
description: 交易渠道 description: Payment Channel Alipay, AlipayOnline, Wechat
create_time: create_time:
type: string type: string
format: 'date-time' format: 'date-time'
pattern: yyyy-MM-dd HH:mm:ss pattern: yyyy-MM-dd HH:mm:ss
description: 订单创建时间,格式为'yyyy-MM-dd HH:mm:ss'GMT+10 description: Time when order is created, which is formatted in 'yyyy-MM-dd HH:mm:ss', GMT+10
pay_time: pay_time:
type: string type: string
format: 'date-time' format: 'date-time'
pattern: yyyy-MM-dd HH:mm:ss pattern: yyyy-MM-dd HH:mm:ss
description: 订单支付时间,格式为'yyyy-MM-dd HH:mm:ss'GMT+10 description: Time when order is paid, which is formatted in 'yyyy-MM-dd HH:mm:ss', GMT+10.
responses: responses:
200: 200:
description: OK description: OK
/customs/partners/{partner_code}/declare/report/{client_report_id}: /customs/partners/{partner_code}/declare/report/{client_report_id}:
put: put:
summary: 创建报关单 summary: Create Custom Declare
tags: tags:
- Custom - Custom
parameters: parameters:
@ -1252,37 +1286,37 @@ paths:
properties: properties:
order_id: order_id:
type: string type: string
description: 商户支付订单号,要求同一商户唯一 description: Partner order id
custom: custom:
type: string type: string
description: 海关编号 * [渠道海关编号](https://www.royalpay.com.au/downloads/CustomsNO.xlsx) description: Customs No. * [Channel Custom No](https://www.royalpay.com.au/downloads/CustomsNO.xlsx)
mch_custom_id: mch_custom_id:
type: string type: string
description: 商户在海关备案的编号 description: Customs record id of merchant
mch_custom_name: mch_custom_name:
type: string type: string
description: 商户海关备案名称 description: Customs record name of merchant
sub_order: sub_order:
type: array type: array
description: 子订单(拆单) description: Child orders(If split order required)
items: items:
type: object type: object
properties: properties:
sub_order_no: sub_order_no:
type: string type: string
description: 商户子订单号 description: Sub order no
fee_type: fee_type:
type: string type: string
description: 币种代码 description: currency
default: CNY default: CNY
enum: enum:
- CNY - CNY
order_fee: order_fee:
type: number type: number
description: 子订单金额,单位是元 description: Sub order price. unit is Yuan
transport_fee: transport_fee:
type: number type: number
description: 子订单物流金额,单位是元 description: Sub order transport fee. unit is Yuan
responses: responses:
200: 200:
description: Custom description: Custom
@ -1291,7 +1325,7 @@ paths:
schema: schema:
$ref: 'components_order.yml#/customInfo' $ref: 'components_order.yml#/customInfo'
get: get:
summary: 查询报关单 summary: Query Custom Report
tags: tags:
- Custom - Custom
parameters: parameters:
@ -1310,8 +1344,8 @@ paths:
$ref: 'components_order.yml#/customInfo' $ref: 'components_order.yml#/customInfo'
/customs/partners/{partner_code}/redeclare/report/{client_report_id}: /customs/partners/{partner_code}/redeclare/report/{client_report_id}:
put: put:
summary: 重新提交报关单 summary: Redeclare Custom Report
description: 用于重新提交未报关成功的报关单 description: Used to resubmit the attachment information of the order required by the merchant.
tags: tags:
- Custom - Custom
parameters: parameters:
@ -1334,31 +1368,34 @@ components:
type: apiKey type: apiKey
in: query in: query
name: nonce_str name: nonce_str
description: 随机字符串 description: Random String
time: time:
type: apiKey type: apiKey
in: query in: query
name: time name: time
description: 带毫秒的Unix时间戳务必检查服务器时间和时区配置。计算服务器上的UTC时间是否匹配真实UTC时间即可。允许误差±5分钟 description: |
Unix Timestamp with millis. It is recommended to check your server time and timezone configuration.
You can calculate the UTC time according your server time & timezone and check if it was correct.
sign: sign:
type: apiKey type: apiKey
in: query in: query
name: sign name: sign
description: | description: |
商户签约后会分配得到一个partner_code和credential_code用于签名其中partner_code随请求传递credential_code务必自行存储不得外泄仅作为签名参数。 After merchants signed contract. They will get a `partner_code` and `credential_code` to make signatures.
`partner_code` is passed with requests. `credential_code` must be store safe in merchant side. it only used to make signatures.
每次请求都必须加入签名信息作为请求校验。校验参数全部以Query Param参数的方式附加在URL后面顺序不分先后。 Each requests must add sign parameters as authentication. Sign params will tailed after request url as query param. And no sort is required.
签名过程: Signature progress:
1. 连接生成签名的原始字符串需要4个参数使用&连接,无需转码 1. Create origin string for validation. required 4 parameters and connect them with &. Translating is not required.
> valid_string=partner_code&time&nonce_str&credential_code > valid_string=partner_code&time&nonce_str&credential_code
2. 使用SHA256对valid_string进行签名并转换为小写字符串 2. Use SHA256 to sign valid_string and get lowercased hex string
> sign=hex(sha256(valid_string)).toLowerCase() > sign=hex(sha256(valid_string)).toLowerCase()
3. 在请求中将签名使用的time, nonce_str和生成的sign作为query参数发送 3. Pass used `time`, `nonce_str` and generated `sign` as query parameter in requests.
> 签名测试地址:https://mpay.royalpay.com.au/sign_test.html > Signature test address: https://mpay.royalpay.com.au/sign_test.html

@ -46,7 +46,7 @@ public interface CleanService {
void settlementXlsx(Date date, HttpServletResponse response) throws IOException; void settlementXlsx(Date date, HttpServletResponse response) throws IOException;
List<JSONObject> getXlsx(Date dt, String bank, List<JSONObject> logs) throws IOException; List<JSONObject> getXlsx(Date dt, List<JSONObject> logs) throws IOException;
List<JSONObject> getSettleLogs(Date dt, List<String> clearIds); List<JSONObject> getSettleLogs(Date dt, List<String> clearIds);

@ -435,28 +435,17 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
} }
@Override @Override
public List<JSONObject> getXlsx(Date dt, String bank, List<JSONObject> logs) throws IOException { public List<JSONObject> getXlsx(Date dt, List<JSONObject> logs) throws IOException {
List<JSONObject> result = new ArrayList<>(); List<JSONObject> result = new ArrayList<>();
int fileIndex = 1; for (JSONObject log : logs) {
if (logs.size() > 1) { List<JSONObject> details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id"));
for (JSONObject log : logs) { List<String> banks = details.stream().map(detail -> detail.getString("settle_bank")).distinct().collect(Collectors.toList());
String filename = "Merchant_Settlement_Info_" + DateFormatUtils.format(dt, "yyyyMMdd") + "_" + fileIndex + ".xlsx"; for (String bank : banks) {
JSONObject file = new JSONObject(); String filename = String.format("Merchant_Setlement_Info_%s_%s.xlsx", bank, DateFormatUtils.format(log.getDate("operate_time"), "yyyyMMddHHmmss"));
file.put("name", filename);
List<JSONObject> details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id"));
details = mergeBatchSettleClients(details);
file.put("byteArr", generateSettleXlsxFile(dt, details, bank));
result.add(file);
fileIndex++;
}
} else {
for (JSONObject log : logs) {
String filename = "Merchant_Settlement_Info_" + DateFormatUtils.format(dt, "yyyyMMdd") + ".xlsx";
JSONObject file = new JSONObject(); JSONObject file = new JSONObject();
file.put("name", filename); file.put("name", filename);
List<JSONObject> details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id")); List<JSONObject> mergedDetails = mergeBatchSettleClients(details.stream().filter(detail -> bank.equals(detail.getString("settle_bank"))).collect(Collectors.toList()));
details = mergeBatchSettleClients(details); file.put("byteArr", generateSettleXlsxFile(dt, mergedDetails, bank));
file.put("byteArr", generateSettleXlsxFile(dt, details, bank));
result.add(file); result.add(file);
} }
} }
@ -1373,7 +1362,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
List<JSONObject> attachList = new ArrayList<>(); List<JSONObject> attachList = new ArrayList<>();
JSONObject attach1 = new JSONObject(); JSONObject attach1 = new JSONObject();
List<JSONObject> clearLogs = getSettleLogs(date, clearIds); List<JSONObject> clearLogs = getSettleLogs(date, clearIds);
List<JSONObject> xlsxFileList = getXlsx(date, "CBA", clearLogs); List<JSONObject> xlsxFileList = getXlsx(date, clearLogs);
if (xlsxFileList.size() > 1) { if (xlsxFileList.size() > 1) {
fileName1 += ".zip"; fileName1 += ".zip";
attach1.put("content", Base64.encodeBase64String(getZipByteArr(xlsxFileList))); attach1.put("content", Base64.encodeBase64String(getZipByteArr(xlsxFileList)));
@ -1439,7 +1428,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
ExtParamsUtils.getExtParamsValue(log.getString("plan_detail"), ExtParamsUtils.getExtParamsValue(log.getString("plan_detail"),
detail -> StringUtils.defaultIfEmpty(detail.getString("remark"), detail.getString("plan_id"))))) detail -> StringUtils.defaultIfEmpty(detail.getString("remark"), detail.getString("plan_id")))))
.collect(Collectors.joining(",")); .collect(Collectors.joining(","));
sendTaskFinishMessages(ManagerRole.FINANCIAL_STAFF, "清算文件已发送清算方:"+detailDescription, "发送清算通知"); sendTaskFinishMessages(ManagerRole.FINANCIAL_STAFF, "清算文件已发送清算方:" + detailDescription, "发送清算通知");
if (autoMarkSent) { if (autoMarkSent) {
if (!clearIds.isEmpty()) { if (!clearIds.isEmpty()) {
clearingLogMapper.lockSettlementsById(clearLogs.stream().map(log -> log.getString("clearing_id")).collect(Collectors.toList())); clearingLogMapper.lockSettlementsById(clearLogs.stream().map(log -> log.getString("clearing_id")).collect(Collectors.toList()));

@ -20,6 +20,9 @@ public interface ClientRateMapper {
List<JSONObject> listClientRates(@Param("client_id") int clientId, @Param("rate_name") String rateName); List<JSONObject> listClientRates(@Param("client_id") int clientId, @Param("rate_name") String rateName);
@AutoSql(SqlType.SELECT)
JSONObject findRateByRateId(@Param("client_rate_id") String rateId);
@AutoSql(SqlType.INSERT) @AutoSql(SqlType.INSERT)
void saveRate(JSONObject rateConfig); void saveRate(JSONObject rateConfig);
@ -39,23 +42,22 @@ public interface ClientRateMapper {
@Param("clean_days") Integer cleanDays, @Param("rate_name") String rateName); @Param("clean_days") Integer cleanDays, @Param("rate_name") String rateName);
List<JSONObject> latestConfig(@Param("client_id") int client_id, @Param("rate_name") String rate_name);
List<JSONObject> latestConfig(@Param("client_id")int client_id,@Param("rate_name") String rate_name);
//Task //Task
List<JSONObject> maxChannelExpiryTime(@Param("client_id")int client_id,@Param("rate_name")String rate_name); List<JSONObject> maxChannelExpiryTime(@Param("client_id") int client_id, @Param("rate_name") String rate_name);
List<JSONObject> getAllExpiry(@Param("expiry_date")Date expiry_date); List<JSONObject> getAllExpiry(@Param("expiry_date") Date expiry_date);
List<JSONObject> getAllClientRateExpiryMerchants(); List<JSONObject> getAllClientRateExpiryMerchants();
void postponeMerchantRateByClientId(int clientId); void postponeMerchantRateByClientId(int clientId);
JSONObject latestChannelCleanDays(@Param("rate_name")String rate_name, @Param("client_id")int client_id); JSONObject latestChannelCleanDays(@Param("rate_name") String rate_name, @Param("client_id") int client_id);
JSONObject latestCardChannelCleanDays(@Param("rate_name")String rate_name, @Param("client_id")int client_id); JSONObject latestCardChannelCleanDays(@Param("rate_name") String rate_name, @Param("client_id") int client_id);
JSONObject latestExpiryConfig(@Param("client_id")int client_id,@Param("rate_name") String rate_name); JSONObject latestExpiryConfig(@Param("client_id") int client_id, @Param("rate_name") String rate_name);
} }

@ -86,19 +86,17 @@ public interface ClientManager {
void checkAndSendInitEmail(JSONObject manager, String clientMoniker); void checkAndSendInitEmail(JSONObject manager, String clientMoniker);
void sendOpenEmail(final JSONObject client, String username, String pwd);
// void sendInitEmail(JSONObject account,JSONObject client, String username, String pwd);
void markApproveEmailSendStatus(String clientMoniker, JSONObject manager); void markApproveEmailSendStatus(String clientMoniker, JSONObject manager);
void checkEmailStatus(); void checkEmailStatus();
void newCheckEmailStatus();
@Transactional @Transactional
void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow); void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow);
@Transactional
void modifyUPayProfile(JSONObject manager, String clientMoniker, String profileKey, boolean allow);
@Transactional @Transactional
void switchChannelPermission(JSONObject manager, String clientMoniker, String channel, boolean allow); void switchChannelPermission(JSONObject manager, String clientMoniker, String channel, boolean allow);
@ -176,7 +174,7 @@ public interface ClientManager {
List<JSONObject> listSubClients(JSONObject manager, String clientMoniker); List<JSONObject> listSubClients(JSONObject manager, String clientMoniker);
JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker,String searchText, int page); JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker, String searchText, int page);
List<JSONObject> listSubClients(int clientId); List<JSONObject> listSubClients(int clientId);
@ -210,6 +208,7 @@ public interface ClientManager {
/** /**
* Id * Id
*
* @param clientMoniker * @param clientMoniker
* @param client_type * @param client_type
* @param client_ids * @param client_ids
@ -253,9 +252,9 @@ public interface ClientManager {
void revertClient(String clientMoniker, JSONObject manager); void revertClient(String clientMoniker, JSONObject manager);
void updateClientIdInfo(String clientMoniker,JSONObject params, JSONObject manager); void updateClientIdInfo(String clientMoniker, JSONObject params, JSONObject manager);
void updateMWRiskInfoByClient(String clientMoniker,JSONObject params, JSONObject manager); void updateMWRiskInfoByClient(String clientMoniker, JSONObject params, JSONObject manager);
JSONObject getAuthFiles(JSONObject manager, String clientMoniker); JSONObject getAuthFiles(JSONObject manager, String clientMoniker);
@ -287,7 +286,7 @@ public interface ClientManager {
List<JSONObject> uploadKycFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo); List<JSONObject> uploadKycFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo);
List<JSONObject> uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo,String fileType); List<JSONObject> uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo, String fileType);
List<JSONObject> uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); List<JSONObject> uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo);
@ -307,6 +306,7 @@ public interface ClientManager {
/** /**
* *
*
* @param clientMoniker * @param clientMoniker
* @param manager * @param manager
*/ */
@ -392,7 +392,7 @@ public interface ClientManager {
void getAggregateCardAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception; void getAggregateCardAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception;
void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal,String promotionalEffectiveDate,int promotionalPeriod) throws Exception; void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal,String rateid,HttpServletResponse httpResponse);
void getNewAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception; void getNewAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception;
@ -587,7 +587,7 @@ public interface ClientManager {
boolean getMergeSettleStatus(JSONObject client); boolean getMergeSettleStatus(JSONObject client);
void changeExtParams(String clientMoniker,JSONObject manager, JSONObject params); void changeExtParams(String clientMoniker, JSONObject manager, JSONObject params);
RPayMerchantEntity applyMWMerchantId(String clientMoniker, JSONObject manager); RPayMerchantEntity applyMWMerchantId(String clientMoniker, JSONObject manager);

@ -1,19 +1,21 @@
package au.com.royalpay.payment.manage.merchants.core; package au.com.royalpay.payment.manage.merchants.core;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation;
/** /**
* Create by yixian at 2018-04-12 16:24 * Create by yixian at 2018-04-12 16:24
*/ */
public interface ClientModifySupport { public interface ClientModifySupport {
void processModify(ClientModifyOperation modify);
void processClientModify(ClientModify clientModify); void processClientModify(ClientModify clientModify);
void processClientConfigModify(ClientConfigModify clientConfigModify); void processClientConfigModify(ClientModify clientConfigModify);
void processClientConfigModify(ClientConfigModify clientConfigModify, boolean onlyModifyConfig); void processClientConfigModify(ClientModify clientConfigModify, boolean onlyModifyConfig);
void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify); void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify);
} }

@ -33,14 +33,20 @@ import au.com.royalpay.payment.manage.gateway.core.GatewayMerchantApply;
import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum; import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl; import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.log.*; import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper;
import au.com.royalpay.payment.manage.mappers.log.LogClientSubMerchantIdMapper;
import au.com.royalpay.payment.manage.mappers.payment.CommonSubMerchantIdMapper; import au.com.royalpay.payment.manage.mappers.payment.CommonSubMerchantIdMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper; import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper; import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper;
import au.com.royalpay.payment.manage.mappers.system.*; import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.merchants.beans.*; import au.com.royalpay.payment.manage.merchants.beans.*;
import au.com.royalpay.payment.manage.merchants.core.*; import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.impls.*; import au.com.royalpay.payment.manage.merchants.entity.impls.*;
import au.com.royalpay.payment.manage.merchants.enums.UPayAuthFileEnum; import au.com.royalpay.payment.manage.merchants.enums.UPayAuthFileEnum;
import au.com.royalpay.payment.manage.notice.core.MailService; import au.com.royalpay.payment.manage.notice.core.MailService;
@ -102,6 +108,9 @@ import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.Font;
import org.dom4j.Element; import org.dom4j.Element;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -109,13 +118,11 @@ import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.context.MessageSource;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
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.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -138,7 +145,6 @@ import java.security.InvalidParameterException;
import java.security.KeyPair; import java.security.KeyPair;
import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey; import java.security.interfaces.RSAPublicKey;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.List; import java.util.List;
import java.util.*; import java.util.*;
@ -195,16 +201,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private OrgMapper orgMapper; private OrgMapper orgMapper;
@Resource @Resource
private LogSettleMailMapper logSettleMailMapper;
@Resource
private CommoditiesMapper commoditiesMapper;
@Resource
private ActClientInvitationCodeMapper actClientInvitationCodeMapper; private ActClientInvitationCodeMapper actClientInvitationCodeMapper;
@Resource @Resource
private MailService mailService; private MailService mailService;
// todo 作用
@Resource
private ClientComplyValidator[] validators;
@Resource @Resource
private ClientModifySupport clientModifySupport; private ClientModifySupport clientModifySupport;
@ -260,8 +259,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private ClientContractService clientContractService; private ClientContractService clientContractService;
@Resource @Resource
private MessageSource messageSource;
@Resource
private ClientsOperationLogMapper clientsOperationLogMapper; private ClientsOperationLogMapper clientsOperationLogMapper;
@Resource @Resource
private LogClientSubMerchantIdMapper logClientSubMerchantIdMapper; private LogClientSubMerchantIdMapper logClientSubMerchantIdMapper;
@ -321,6 +318,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private RPayMerchantMapper rPayMerchantMapper; private RPayMerchantMapper rPayMerchantMapper;
@Resource @Resource
private SysClientUpayProfileMapper sysClientUpayProfileMapper; private SysClientUpayProfileMapper sysClientUpayProfileMapper;
DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy");
@Resource @Resource
@ -1310,73 +1308,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
} }
@Override
public void sendOpenEmail(final JSONObject client, String username, String pwd) {
JSONObject model = new JSONObject();
model.put("username", username);
model.put("password", pwd);
model.put("client_moniker", client.getString("client_moniker"));
model.put("contact_person", client.getString("contact_person"));
model.put("credential_code", client.getString("credential_code"));
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
// todo Velocity
Context ctx = new Context();
ctx.setVariable("bds", bds);
ctx.setVariable("short_name", client.getString("short_name"));
ctx.setVariable("password", pwd);
ctx.setVariable("username", username);
ctx.setVariable("client_moniker", client.getString("client_moniker"));
ctx.setVariable("contact_person", client.getString("contact_person"));
ctx.setVariable("credential_code", client.getString("credential_code"));
final String content = thymeleaf.process("mail/new_client_notice", ctx);
// final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm",
// "utf-8", model);
ctx.setVariable("password", "*****");
final String contentBd = thymeleaf.process("mail/new_client_notice", ctx);
final List<String> mailTos = new ArrayList<>();
String mailTo = client.getString("contact_email");
if (StringUtils.isEmpty(mailTo)) {
throw new EmailException("Client Contact Email is invalid");
}
mailTos.add(mailTo);
JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id"));
if (clientLegal != null && StringUtils.isNotBlank(clientLegal.getString("email"))) {
mailTos.add(clientLegal.getString("email"));
}
final List<String> emails = new ArrayList<>();
for (JSONObject bd : bds) {
String email = bd.getString("email");
if (StringUtils.isNotEmpty(email)) {
emails.add(email);
}
}
new Thread() {
@Override
public void run() {
try {
String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", StringUtils.join(mailTos, ","), "", content);
mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", emails.isEmpty() ? "" : StringUtils.join(emails, ","),
"", contentBd);
JSONObject clientUpdate = new JSONObject();
clientUpdate.put("client_id", client.getIntValue("client_id"));
clientUpdate.put("approve_email_send", 3);
clientUpdate.put("approve_email_id", emailId);
clientMapper.update(clientUpdate);
} catch (Exception e) {
JSONObject clientUpdate = new JSONObject();
clientUpdate.put("client_id", client.getIntValue("client_id"));
clientUpdate.put("approve_email_send", 0);
clientUpdate.put("approve_email_id", null);
clientMapper.update(clientUpdate);
throw new EmailException("Email Sending Failed", e);
}
}
}.start();
}
public void sendInitEmail(final JSONObject client, String username, String pwd, boolean isUpayAuditPass) { public void sendInitEmail(final JSONObject client, String username, String pwd, boolean isUpayAuditPass) {
logger.debug("sending email after comply"); logger.debug("sending email after comply");
JSONObject model = new JSONObject(); JSONObject model = new JSONObject();
@ -1386,7 +1317,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
model.put("contact_person", client.getString("contact_person")); model.put("contact_person", client.getString("contact_person"));
model.put("credential_code", client.getString("credential_code")); model.put("credential_code", client.getString("credential_code"));
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
// todo Velocity
Context ctx = new Context(); Context ctx = new Context();
ctx.setVariable("bds", bds); ctx.setVariable("bds", bds);
ctx.setVariable("short_name", client.getString("short_name")); ctx.setVariable("short_name", client.getString("short_name"));
@ -1395,10 +1325,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
ctx.setVariable("client_moniker", client.getString("client_moniker")); ctx.setVariable("client_moniker", client.getString("client_moniker"));
ctx.setVariable("contact_person", client.getString("contact_person")); ctx.setVariable("contact_person", client.getString("contact_person"));
ctx.setVariable("credential_code", client.getString("credential_code")); ctx.setVariable("credential_code", client.getString("credential_code"));
ctx.setVariable("card_approving", isUpayAuditPass);
final String content = thymeleaf.process("mail/new_client_notice", ctx); final String content = thymeleaf.process("mail/new_client_notice", ctx);
// final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm",
// "utf-8", model);
ctx.setVariable("password", "*****"); ctx.setVariable("password", "*****");
final String contentBd = thymeleaf.process("mail/new_client_notice", ctx); final String contentBd = thymeleaf.process("mail/new_client_notice", ctx);
final List<String> mailTos = new ArrayList<>(); final List<String> mailTos = new ArrayList<>();
@ -1457,32 +1386,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}.start(); }.start();
} }
/**
* public void sendInitEmail(JSONObject account, final JSONObject client, String username, String pwd) {
* logger.debug("sending email after comply"); JSONObject model = new JSONObject(); model.put("username", username);
* model.put("password", pwd); model.put("client_moniker", client.getString("client_moniker"));
* model.put("contact_person", client.getString("contact_person")); model.put("credential_code",
* client.getString("credential_code")); List<JSONObject> bds =
* clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); // todo Velocity Context
* ctx = new Context(); ctx.setVariable("bds", bds); ctx.setVariable("password", pwd); ctx.setVariable("username",
* username); ctx.setVariable("client_moniker", client.getString("client_moniker"));
* ctx.setVariable("contact_person", client.getString("contact_person")); ctx.setVariable("credential_code",
* client.getString("credential_code")); ctx.setVariable("short_name", client.getString("short_name")); final String
* content = thymeleaf.process("mail/new_client_notice", ctx); // final String content =
* VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm", // "utf-8", model); final String
* mailTo = client.getString("contact_email"); if (StringUtils.isEmpty(mailTo)) { throw new EmailException("Client
* Contact Email is invalid"); } final Set<String> emails = new HashSet<>(); for (JSONObject bd : bds) { String
* email = bd.getString("email"); if (StringUtils.isNotEmpty(email)) { emails.add(email); } } new Thread() {
*
* @Override public void run() { try { SendMail sendMail = new SendMail(); Set<String> to = new HashSet<>();
* to.add(mailTo); sendMail.setFrom("info@mail.royalpay.com.au"); sendMail.setMailTos(to);
* sendMail.setMailCcs(emails); sendMail.setTitle("Your RoyalPay Cross-border Payment has been set up");
* sendMail.setContent(content); sendMail.setTags(tags); JSONObject mailResult =
* mailGunService.sendMail(sendMail); clientModifySupport.processClientModify(new EmailModify(account,
* client.getString("client_moniker"), 3, mailResult.getString("mail_id"))); } catch (Exception e) {
* clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 0,
* null)); throw new EmailException("Email Sending Failed", e); } } }.start(); }
*/
public void sendAuthInitEmail(JSONObject account, final JSONObject client) { public void sendAuthInitEmail(JSONObject account, final JSONObject client) {
logger.debug("sending email after comply about a new partner opening by quick access"); logger.debug("sending email after comply about a new partner opening by quick access");
@ -1588,48 +1491,27 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public void newCheckEmailStatus() { public void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow) {
List<JSONObject> clients = clientMapper.listClientsWithEmailNotVerify(); JSONObject client = getClientInfoByMoniker(clientMoniker);
for (JSONObject client : clients) { if (client == null) {
try { throw new InvalidShortIdException();
String emailId = client.getString("approve_email_id");
JSONObject status = mailSendMapper.find(emailId, client.getString("contact_email"));
if (status != null) {
int statusNo = status.getIntValue("status");
logger.debug("get mail status:" + emailId + "--" + statusNo);
int mailStatus = 3;
switch (statusNo) {
case 1:
mailStatus = 1;
break;
case 2:
mailStatus = 2;
break;
}
updateClientApproveEmailStatus(mailStatus, null, client.getString("client_moniker"));
} else {
logger.debug("get mail status:" + emailId + "-- none");
// updateClientApproveEmailStatus(client.getIntValue("client_id"), 0);
}
} catch (Exception e) {
logger.error("check email status failed", e);
}
} }
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, permissionKey, allow));
} }
@Override @Override
public void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow) { @Transactional
public void modifyUPayProfile(JSONObject manager, String clientMoniker, String profileKey, boolean allow) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, permissionKey, allow)); clientModifySupport.processModify(new CustomSwitchModify(manager, clientMoniker, profileKey, allow, cli -> {
JSONObject upayProfileInfo = sysClientUpayProfileMapper.findInfo(client.getInteger("client_id")); JSONObject profileUpdate = new JSONObject();
if (upayProfileInfo != null) { profileUpdate.put(profileKey, allow);
upayProfileInfo.put(permissionKey, allow); profileUpdate.put("client_id", cli.getIntValue("client_id"));
sysClientUpayProfileMapper.update(upayProfileInfo); sysClientUpayProfileMapper.update(profileUpdate);
} }));
} }
@Override @Override
@ -1730,7 +1612,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject account = clientAccountMapper.findById(accountId); JSONObject account = clientAccountMapper.findById(accountId);
if (clientMoniker != null) { if (clientMoniker != null) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
Assert.notNull(client);
//父商户全局管理子商户时候,跳过 //父商户全局管理子商户时候,跳过
if (account.getIntValue("client_id") != client.getIntValue("client_id")) { if (account.getIntValue("client_id") != client.getIntValue("client_id")) {
//登录用户所属商户 //登录用户所属商户
@ -1853,7 +1734,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override @Override
public void togglePayNotice(JSONObject account, String clientMoniker, boolean enable) { public void togglePayNotice(JSONObject account, String clientMoniker, boolean enable) {
JSONObject partner = getClientInfoByMoniker(clientMoniker); JSONObject partner = getClientInfoByMoniker(clientMoniker);
Assert.notNull(partner);
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "enable_pay_notice", enable)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "enable_pay_notice", enable));
clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id"));
} }
@ -2065,11 +1945,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
config.getDoubleValue("rate_value"), config.getInteger("clean_days"), channel).isEmpty()) { config.getDoubleValue("rate_value"), config.getInteger("clean_days"), channel).isEmpty()) {
return; return;
} }
List<JSONObject> existRate = clientRateMapper.listCurrentClientRates(clientId, config.getDate("active_time"), channel);
for (JSONObject rateLog : existRate) {
rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1));
clientRateMapper.updateConfig(rateLog);
}
if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))) { if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))) {
JSONObject extRateParams = new JSONObject() {{ JSONObject extRateParams = new JSONObject() {{
put("domestic_rate_value", config.getBigDecimal("rate_value")); put("domestic_rate_value", config.getBigDecimal("rate_value"));
@ -3102,12 +2977,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override @Override
@Transactional @Transactional
public void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal, String promotionalEffectiveDate, int promotionalPeriod) throws ParseException { public void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal, String rateid, HttpServletResponse httpResponse) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker); JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
exportPromotionalOfferPDF(clientMoniker, manager, promotionalEffectiveDate, promotionalPeriod); exportPromotionalOfferPDF(clientMoniker, manager, rateid, httpResponse);
} }
@Override @Override
@ -3142,7 +3017,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("clean_days", p.getString("clean_days")); client.put("clean_days", p.getString("clean_days"));
} else if ("Alipay".equals(rate_name)) { } else if ("Alipay".equals(rate_name)) {
client.put("alipay_rate", p.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); client.put("alipay_rate", p.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}else if ("AlipayOnline".equals(rate_name)) { } else if ("AlipayOnline".equals(rate_name)) {
client.put("alipay_online_rate", p.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); client.put("alipay_online_rate", p.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
} }
}); });
@ -7127,7 +7002,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(clientId); JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(clientId);
//装在数据 //装在数据
JSONObject info = new JSONObject(); JSONObject info = new JSONObject();
info.put("down_date", convertDateEnglish(new Date()));//下载文件日期 info.put("down_date", formatter.print(new DateTime()));//下载文件日期
info.put("bussiness_name", (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " " + client.getString("abn"));//商圈类型 info.put("bussiness_name", (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " " + client.getString("abn"));//商圈类型
info.put("partner_address", client.getString("address"));//商家店铺地址 info.put("partner_address", client.getString("address"));//商家店铺地址
info.put("partner_country", client.getString("country"));//国家 info.put("partner_country", client.getString("country"));//国家
@ -7139,7 +7014,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
info.put("annual_rate", cardAnnualRate);//年费率 info.put("annual_rate", cardAnnualRate);//年费率
info.put("cost_per_transaction", clientRate.getString("transaction_fee"));//每次交易成本 info.put("cost_per_transaction", clientRate.getString("transaction_fee"));//每次交易成本
info.put("domestic_fee", cardRate.getString("domestic_rate_value"));//国内服务费 info.put("domestic_fee", cardRate.getString("domestic_rate_value"));//国内服务费
info.put("international_fee", cardRate.getString("overseas_rate_value"));//国际服务费 info.put("international_fee", upayProfileInfo.getBoolean("enable_international_card") ? cardRate.getString("overseas_rate_value") : "-");//国际服务费
BigDecimal reserve = (upayProfileInfo.getBigDecimal("expected_card_revenue").multiply(new BigDecimal(0.005)).setScale(0, RoundingMode.HALF_UP)); BigDecimal reserve = (upayProfileInfo.getBigDecimal("expected_card_revenue").multiply(new BigDecimal(0.005)).setScale(0, RoundingMode.HALF_UP));
info.put("account_reserve", reserve.compareTo(new BigDecimal(200)) <= 0 ? new BigDecimal(200).toPlainString() : reserve.toPlainString());//账户储备金 info.put("account_reserve", reserve.compareTo(new BigDecimal(200)) <= 0 ? new BigDecimal(200).toPlainString() : reserve.toPlainString());//账户储备金
//银行账号信息 //银行账号信息
@ -7150,15 +7025,25 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return info; return info;
} }
private void exportPromotionalOfferPDF(String clientMoniker, JSONObject manager, String promotionalEffectiveDate, int promotionalPeriod) throws ParseException { private void exportPromotionalOfferPDF(String clientMoniker, JSONObject manager, String rateid, HttpServletResponse httpResponse) {
Date date = DateUtils.parseDate(promotionalEffectiveDate, "yyyy-MM-dd"); httpResponse.setContentType("application/pdf");
JSONObject info = convertPromotionalOfferInfo(clientMoniker, convertDateEnglish(date), promotionalPeriod); httpResponse.setHeader("content-disposition", "attachment;filename=" + clientMoniker + "_PROMOTIONAL_OFFER_" + new Date() + ".pdf");
String pdfPath = this.getClass().getClassLoader().getResource("").getPath() + "/templates/pdf/promotional_offer.pdf"; JSONObject info = convertPromotionalOfferInfo(clientMoniker, rateid);
String pdfPath = Objects.requireNonNull(this.getClass().getClassLoader().getResource("")).getPath() + "templates/pdf/promotional_offer.pdf";
String fileName = clientMoniker + "_Promotional_Offer.pdf"; String fileName = clientMoniker + "_Promotional_Offer.pdf";
publishExcelCardPDFFile(clientMoniker, manager, fileName, pdfPath, info, PROMOTIONAL_OFFER_FILE); try (ServletOutputStream sos = httpResponse.getOutputStream()) {
File file = new File(fileName);
PdfUtils pdu = new PdfUtils();
pdu.setTemplatePdfPath(pdfPath);
pdu.setPdfTemplate(info);
ByteArrayOutputStream bos = pdu.templetPdfBos(file);
sos.write(bos.toByteArray());
} catch (Exception e) {
throw new ServerErrorException();
}
} }
private JSONObject convertPromotionalOfferInfo(String clientMoniker, String promotionalEffectiveDate, int promotionalPeriod) { private JSONObject convertPromotionalOfferInfo(String clientMoniker, String rateid) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
@ -7168,15 +7053,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new BadRequestException("The merchant failed the audit!"); throw new BadRequestException("The merchant failed the audit!");
} }
int clientId = client.getInteger("client_id"); int clientId = client.getInteger("client_id");
JSONObject clientRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "rpaypmt_card"); JSONObject currentRate = clientRateMapper.findRateByRateId(rateid);
if (clientRate == null) { if (currentRate == null) {
throw new BadRequestException("rpaypmt_card rate Not configured"); throw new BadRequestException("rpaypmt_card rate Not configured");
} }
JSONObject cardRate = clientRate.getJSONObject("ext_rates"); JSONObject cardRate = currentRate.getJSONObject("ext_rates");
JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(clientId); JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(clientId);
JSONObject upayProfileInfo = sysClientUpayProfileMapper.findInfo(clientId);
JSONObject info = new JSONObject(); JSONObject info = new JSONObject();
info.put("down_date", convertDateEnglish(new Date()));//下载文件日期 info.put("down_date", formatter.print(new DateTime()));//下载文件日期
info.put("bussiness_name", (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " " + client.getString("abn"));//商圈类型 info.put("bussiness_name", (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " " + client.getString("abn"));//商圈类型
info.put("partner_address", client.getString("address"));//商家店铺地址 info.put("partner_address", client.getString("address"));//商家店铺地址
info.put("partner_country", client.getString("country"));//国家 info.put("partner_country", client.getString("country"));//国家
@ -7184,9 +7069,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
info.put("partner_bussiness_name", client.getString("business_name"));//商户商用名称 info.put("partner_bussiness_name", client.getString("business_name"));//商户商用名称
info.put("legal_bussiness", legalInfo.getString("representative_person") + " AS " + (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " ABN " + client.getString("abn"));//拼接规则:法人名 AS 商用名称 ABD 编码 info.put("legal_bussiness", legalInfo.getString("representative_person") + " AS " + (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " ABN " + client.getString("abn"));//拼接规则:法人名 AS 商用名称 ABD 编码
info.put("domestic_fee", cardRate.getString("domestic_rate_value"));//国内服务费 info.put("domestic_fee", cardRate.getString("domestic_rate_value"));//国内服务费
info.put("international_fee", cardRate.getString("overseas_rate_value"));//国际服务费 info.put("international_fee", upayProfileInfo.getBoolean("enable_international_card") ? cardRate.getString("overseas_rate_value") : "-");//国际服务费
info.put("promotional_effective_date", promotionalEffectiveDate); info.put("promotional_effective_date", formatter.print(currentRate.getDate("active_time").getTime()));
info.put("promotional_period", promotionalPeriod); info.put("promotional_period", formatter.print(currentRate.getDate("expiry_time").getTime()));
return info; return info;
} }
@ -7225,16 +7110,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
} }
private String convertDateEnglish(Date date) {
String[] months = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Spt", "Oct", "Nov", "Dec"};
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
return day + " " + months[month] + " " + year;
}
private void importCardAgreeFile(String clientMoniker, JSONObject manager, String sourceFile, String fileLabel) { private void importCardAgreeFile(String clientMoniker, JSONObject manager, String sourceFile, String fileLabel) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {

@ -5,11 +5,10 @@ import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper; import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -34,26 +33,36 @@ public class ClientModifySupportImpl implements ClientModifySupport {
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
@Override @Override
public void processClientModify(ClientModify modify) { public void processModify(ClientModifyOperation modify) {
int clientId = modify.doModify(merchantInfoProvider, clientMapper,mongoTemplate); int clientId = modify.processModify(merchantInfoProvider, mongoTemplate);
clientInfoCacheSupport.clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
public void processClientConfigModify(ClientConfigModify clientConfigModify) { public void processClientModify(ClientModify modify) {
int clientId =clientConfigModify.doModify(merchantInfoProvider, clientConfigMapper,clientMapper,mongoTemplate); processModify(modify.setModifyConsumer(modifyObj -> clientMapper.update(modifyObj)));
clientInfoCacheSupport.clearClientCache(clientId);
} }
@Override @Override
public void processClientConfigModify(ClientConfigModify clientConfigModify,boolean onlyModifyConfig) { public void processClientConfigModify(ClientModify clientConfigModify) {
int clientId =clientConfigModify.doModify(merchantInfoProvider, clientConfigMapper,clientMapper,mongoTemplate,onlyModifyConfig); processModify(clientConfigModify.setModifyConsumer(modifyObj -> {
clientInfoCacheSupport.clearClientConfigCache(clientId); clientMapper.update(modifyObj);
clientConfigMapper.update(modifyObj);
}));
}
@Override
public void processClientConfigModify(ClientModify clientConfigModify, boolean onlyModifyConfig) {
processModify(clientConfigModify.setModifyConsumer(modifyObj -> {
if (!onlyModifyConfig) {
clientMapper.update(modifyObj);
}
clientConfigMapper.update(modifyObj);
}));
} }
@Override @Override
public void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify) { public void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify) {
int clientId =clientGatewaySignModify.doModify(merchantInfoProvider, merchantSignInfoMapper,mongoTemplate); processModify(clientGatewaySignModify.setMerchantSignInfoMapper(merchantSignInfoMapper));
clientInfoCacheSupport.clearClientCache(clientId);
} }
} }

@ -1,78 +1,39 @@
package au.com.royalpay.payment.manage.merchants.entity; package au.com.royalpay.payment.manage.merchants.entity;
import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper; import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper;
import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.function.Consumer;
import java.util.stream.Collectors;
/** /**
* Create by yixian at 2018-04-12 16:19 * Create by yixian at 2018-04-12 16:19
*/ */
public abstract class ClientGatewaySignModify { public abstract class ClientGatewaySignModify extends ClientModifyOperation {
private JSONObject account; private MerchantSignInfoMapper merchantSignInfoMapper;
private String clientMoniker;
public ClientGatewaySignModify(JSONObject account, String clientMoniker) { public ClientGatewaySignModify(JSONObject account, String clientMoniker) {
this.account = account; super(account, clientMoniker);
this.clientMoniker = clientMoniker;
} }
protected abstract String business(); protected abstract String business();
protected abstract JSONObject getModifyResult(); protected abstract JSONObject getModifyResult();
@Transactional @Override
public int doModify(MerchantInfoProvider merchantInfoProvider, MerchantSignInfoMapper merchantSignInfoMapper, MongoTemplate mongoTemplate) { protected Consumer<JSONObject> getModifyProcess() {
JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker); return client -> {
JSONObject clientGatewaySign = merchantSignInfoMapper.findClientSign(clientMoniker); JSONObject modifyResult = getModifyResult();
JSONObject modifyResult = getModifyResult(); modifyResult.put("client_moniker", getClientMoniker());
try { modifyResult.put("last_update_by", getAccount().getString("account_id"));
saveModifyHistory(clientGatewaySign, modifyResult, mongoTemplate); modifyResult.put("last_update_date", new Date());
}catch (Exception e){ merchantSignInfoMapper.update(modifyResult);
};
}
int clientId = client.getIntValue("client_id");
modifyResult.put("client_moniker", clientMoniker);
modifyResult.put("last_update_by", account.getString("account_id"));
modifyResult.put("last_update_date", new Date());
merchantSignInfoMapper.update(modifyResult);
return clientId;
} }
private void saveModifyHistory(JSONObject clientGatewaySign, JSONObject modifyResult, MongoTemplate mongoTemplate) { public ClientGatewaySignModify setMerchantSignInfoMapper(MerchantSignInfoMapper merchantSignInfoMapper) {
if (account == null) { this.merchantSignInfoMapper = merchantSignInfoMapper;
return; return this;
}
ClientConfigLog clientConfigLog = new ClientConfigLog();
clientConfigLog.setId(IdUtil.getId());
clientConfigLog.setBusiness(business());
clientConfigLog.setClientId(clientGatewaySign.getIntValue("client_id"));
boolean isPartner = true;
if (StringUtils.isNotEmpty(account.getString("account_id"))) {
isPartner = true;
}
if (StringUtils.isNotEmpty(account.getString("manager_id"))) {
isPartner = false;
}
clientConfigLog.setUserType(isPartner ? "Merchant" : "Manager");
clientConfigLog.setCreateTime(new Date());
clientConfigLog.setNewData(modifyResult.toJSONString());
clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id"));
Map<String, Object> beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, clientGatewaySign::get));
clientConfigLog.setOriginData(JSON.toJSONString(beforeModify));
clientConfigLog.setUserName(isPartner ? account.getString("display_name") : account.getString("display_name"));
mongoTemplate.save(clientConfigLog);
} }
} }

@ -1,77 +1,32 @@
package au.com.royalpay.payment.manage.merchants.entity; package au.com.royalpay.payment.manage.merchants.entity;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import java.util.function.Consumer;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* Create by yixian at 2018-04-12 16:19 * Create by yixian at 2018-04-12 16:19
*/ */
public abstract class ClientModify { public abstract class ClientModify extends ClientModifyOperation {
private JSONObject account; private Consumer<JSONObject> modifyConsumer;
private String clientMoniker;
public ClientModify(JSONObject account, String clientMoniker) { public ClientModify(JSONObject account, String clientMoniker) {
this.account = account; super(account, clientMoniker);
this.clientMoniker = clientMoniker;
} }
protected abstract String business(); @Override
protected Consumer<JSONObject> getModifyProcess() {
protected abstract JSONObject getModifyResult(); return client -> {
JSONObject modifyResult = getModifyResult();
@Transactional int clientId = client.getIntValue("client_id");
public int doModify(MerchantInfoProvider merchantInfoProvider, ClientMapper clientMapper, MongoTemplate mongoTemplate) { modifyResult.put("client_id", clientId);
JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker); modifyConsumer.accept(modifyResult);
JSONObject modifyResult = getModifyResult(); };
try {
saveModifyHistory(client, modifyResult, mongoTemplate);
}catch (Exception e){
}
int clientId = client.getIntValue("client_id");
modifyResult.put("client_id", clientId);
clientMapper.update(modifyResult);
return clientId;
} }
private void saveModifyHistory(JSONObject client, JSONObject modifyResult, MongoTemplate mongoTemplate) { public ClientModify setModifyConsumer(Consumer<JSONObject> modifyConsumer) {
if (account == null) { this.modifyConsumer = modifyConsumer;
return; return this;
}
ClientConfigLog clientConfigLog = new ClientConfigLog();
clientConfigLog.setId(IdUtil.getId());
clientConfigLog.setBusiness(business());
clientConfigLog.setClientId(client.getIntValue("client_id"));
boolean isPartner = true;
if (StringUtils.isNotEmpty(account.getString("account_id"))) {
isPartner = true;
}
if (StringUtils.isNotEmpty(account.getString("manager_id"))) {
isPartner = false;
}
clientConfigLog.setUserType(isPartner ? "Merchant" : "Manager");
clientConfigLog.setCreateTime(new Date());
clientConfigLog.setNewData(modifyResult.toJSONString());
clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id"));
Map<String, Object> beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, client::get));
clientConfigLog.setOriginData(JSON.toJSONString(beforeModify));
clientConfigLog.setUserName(isPartner ? account.getString("display_name") : account.getString("display_name"));
mongoTemplate.save(clientConfigLog);
} }
} }

@ -1,32 +1,26 @@
package au.com.royalpay.payment.manage.merchants.entity; package au.com.royalpay.payment.manage.merchants.entity;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog; import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.utils.id.IdUtil; import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* Create by yixian at 2018-04-12 16:19 * Create by davep at 2020-05-12 14:32
*/ */
public abstract class ClientConfigModify { public abstract class ClientModifyOperation {
private final JSONObject account;
private JSONObject account; private final String clientMoniker;
private String clientMoniker;
public ClientConfigModify(JSONObject account, String clientMoniker) { protected ClientModifyOperation(JSONObject account, String clientMoniker) {
this.account = account; this.account = account;
this.clientMoniker = clientMoniker; this.clientMoniker = clientMoniker;
} }
@ -35,36 +29,21 @@ public abstract class ClientConfigModify {
protected abstract JSONObject getModifyResult(); protected abstract JSONObject getModifyResult();
public int doModify(MerchantInfoProvider merchantInfoProvider, ClientConfigMapper clientConfigMapper, ClientMapper clientMapper, MongoTemplate mongoTemplate) { protected abstract Consumer<JSONObject> getModifyProcess();
JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker);
JSONObject modifyResult = getModifyResult();
try {
saveModifyHistory(client, modifyResult, mongoTemplate);
}catch (Exception e){
} public int processModify(MerchantInfoProvider merchantInfoProvider, MongoTemplate mongoTemplate) {
int clientId = client.getIntValue("client_id"); JSONObject client = merchantInfoProvider.getClientInfoByMoniker(getClientMoniker());
modifyResult.put("client_id", clientId);
clientConfigMapper.update(modifyResult);
clientMapper.update(modifyResult);
return clientId;
}
public int doModify(MerchantInfoProvider merchantInfoProvider, ClientConfigMapper clientConfigMapper, ClientMapper clientMapper, MongoTemplate mongoTemplate,boolean onlyModifyConfig) {
JSONObject clientConfig = merchantInfoProvider.getClientConfigInfoByMoniker(clientMoniker);
JSONObject modifyResult = getModifyResult(); JSONObject modifyResult = getModifyResult();
try { try {
saveModifyHistory(clientConfig, modifyResult, mongoTemplate); saveModifyHistory(client, modifyResult, mongoTemplate);
}catch (Exception e){ } catch (Exception e) {
} }
int clientId = clientConfig.getIntValue("client_id"); getModifyProcess().accept(client);
modifyResult.put("client_id", clientId); return client.getIntValue("client_id");
clientConfigMapper.update(modifyResult);
return clientId;
} }
private void saveModifyHistory(JSONObject client, JSONObject modifyResult,MongoTemplate mongoTemplate) { protected void saveModifyHistory(JSONObject client, JSONObject modifyResult, MongoTemplate mongoTemplate) {
if (account == null) { if (account == null) {
return; return;
} }
@ -86,7 +65,15 @@ public abstract class ClientConfigModify {
clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id")); clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id"));
Map<String, Object> beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, client::get)); Map<String, Object> beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, client::get));
clientConfigLog.setOriginData(JSON.toJSONString(beforeModify)); clientConfigLog.setOriginData(JSON.toJSONString(beforeModify));
clientConfigLog.setUserName(isPartner ? account.getString("display_name") : account.getString("display_name")); clientConfigLog.setUserName(account.getString("display_name"));
mongoTemplate.insert(clientConfigLog); mongoTemplate.insert(clientConfigLog);
} }
public JSONObject getAccount() {
return account;
}
public String getClientMoniker() {
return clientMoniker;
}
} }

@ -1,17 +1,17 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class CBBankPaypadVersionModify extends ClientConfigModify { public class CBBankPaypadVersionModify extends ClientModify {
private String cbbank_paypad_version; private String cbbankPaypadVersion;
public CBBankPaypadVersionModify(JSONObject account, String clientMoniker, String paypad_version) { public CBBankPaypadVersionModify(JSONObject account, String clientMoniker, String paypad_version) {
super(account, clientMoniker); super(account, clientMoniker);
this.cbbank_paypad_version = paypad_version; this.cbbankPaypadVersion = paypad_version;
} }
@Override @Override
@ -23,7 +23,7 @@ public class CBBankPaypadVersionModify extends ClientConfigModify {
@Override @Override
protected JSONObject getModifyResult() { protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject(); JSONObject modify = new JSONObject();
modify.put("cbbank_paypad_version", cbbank_paypad_version); modify.put("cbbank_paypad_version", cbbankPaypadVersion);
return modify; return modify;
} }
} }

@ -1,30 +1,29 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class ClearDaysModify extends ClientConfigModify { public class ClearDaysModify extends ClientModify {
private int settle_hour; private int settleHour;
public ClearDaysModify(JSONObject account, String clientMoniker, int settle_hour) { public ClearDaysModify(JSONObject account, String clientMoniker, int settleHour) {
super(account, clientMoniker); super(account, clientMoniker);
this.settle_hour = settle_hour; this.settleHour = settleHour;
} }
@Override @Override
protected String business() { protected String business() {
return "修改商户清算截止时间为:"+settle_hour; return "修改商户清算截止时间为:" + settleHour;
} }
@Override @Override
protected JSONObject getModifyResult() { protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject(); JSONObject modify = new JSONObject();
modify.put("settle_hour", settle_hour); modify.put("settle_hour", settleHour);
return modify; return modify;
} }
} }

@ -1,19 +1,18 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class CredentialCodeModify extends ClientConfigModify { public class CredentialCodeModify extends ClientModify {
private String credential_code; private String credentialCode;
public CredentialCodeModify(JSONObject account, String clientMoniker, String credential_code) { public CredentialCodeModify(JSONObject account, String clientMoniker, String credentialCode) {
super(account, clientMoniker); super(account, clientMoniker);
this.credential_code = credential_code; this.credentialCode = credentialCode;
} }
@Override @Override
@ -24,7 +23,7 @@ public class CredentialCodeModify extends ClientConfigModify {
@Override @Override
protected JSONObject getModifyResult() { protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject(); JSONObject modify = new JSONObject();
modify.put("credential_code", credential_code); modify.put("credential_code", credentialCode);
return modify; return modify;
} }
} }

@ -0,0 +1,43 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientModifyOperation;
import com.alibaba.fastjson.JSONObject;
import java.util.function.Consumer;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class CustomSwitchModify extends ClientModifyOperation {
private final String key;
private final boolean value;
private final Consumer<JSONObject> modifyProcess;
public CustomSwitchModify(JSONObject account, String clientMoniker, String key, boolean value, Consumer<JSONObject> modifyProcess) {
super(account, clientMoniker);
this.key = key;
this.value = value;
this.modifyProcess = modifyProcess;
}
@Override
protected String business() {
return (value ? "开启 " : "关闭 ") + key;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put(key, value);
return modify;
}
@Override
protected Consumer<JSONObject> getModifyProcess() {
return modifyProcess;
}
}

@ -1,7 +1,6 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -9,24 +8,24 @@ import java.math.BigDecimal;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class CustomerSurchargeRateModify extends ClientConfigModify { public class CustomerSurchargeRateModify extends ClientModify {
private BigDecimal customer_surcharge_rate; private BigDecimal customerSurchargeRate;
public CustomerSurchargeRateModify(JSONObject account, String clientMoniker, BigDecimal customer_surcharge_rate) { public CustomerSurchargeRateModify(JSONObject account, String clientMoniker, BigDecimal customerSurchargeRate) {
super(account, clientMoniker); super(account, clientMoniker);
this.customer_surcharge_rate = customer_surcharge_rate; this.customerSurchargeRate = customerSurchargeRate;
} }
@Override @Override
protected String business() { protected String business() {
return "修改商户客户手续费率为:"+customer_surcharge_rate; return "修改商户客户手续费率为:" + customerSurchargeRate;
} }
@Override @Override
protected JSONObject getModifyResult() { protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject(); JSONObject modify = new JSONObject();
modify.put("customer_surcharge_rate", customer_surcharge_rate); modify.put("customer_surcharge_rate", customerSurchargeRate);
return modify; return modify;
} }
} }

@ -1,7 +1,6 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -9,24 +8,24 @@ import java.math.BigDecimal;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class EmailSendStandByModify extends ClientConfigModify { public class EmailSendStandByModify extends ClientModify {
private BigDecimal max_order_amount; private BigDecimal maxOrderAmount;
public EmailSendStandByModify(JSONObject account, String clientMoniker, BigDecimal max_order_amount) { public EmailSendStandByModify(JSONObject account, String clientMoniker, BigDecimal maxOrderAmount) {
super(account, clientMoniker); super(account, clientMoniker);
this.max_order_amount = max_order_amount; this.maxOrderAmount = maxOrderAmount;
} }
@Override @Override
protected String business() { protected String business() {
return "修改商户最大订单额为:"+max_order_amount; return "修改商户最大订单额为:" + maxOrderAmount;
} }
@Override @Override
protected JSONObject getModifyResult() { protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject(); JSONObject modify = new JSONObject();
modify.put("max_order_amount", max_order_amount); modify.put("max_order_amount", maxOrderAmount);
return modify; return modify;
} }
} }

@ -1,7 +1,6 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -9,24 +8,24 @@ import java.math.BigDecimal;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class MaxOrderAmountModify extends ClientConfigModify { public class MaxOrderAmountModify extends ClientModify {
private BigDecimal max_order_amount; private BigDecimal maxOrderAmount;
public MaxOrderAmountModify(JSONObject account, String clientMoniker, BigDecimal max_order_amount) { public MaxOrderAmountModify(JSONObject account, String clientMoniker, BigDecimal maxOrderAmount) {
super(account, clientMoniker); super(account, clientMoniker);
this.max_order_amount = max_order_amount; this.maxOrderAmount = maxOrderAmount;
} }
@Override @Override
protected String business() { protected String business() {
return "修改商户最大订单额为:"+max_order_amount; return "修改商户最大订单额为:" + maxOrderAmount;
} }
@Override @Override
protected JSONObject getModifyResult() { protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject(); JSONObject modify = new JSONObject();
modify.put("max_order_amount", max_order_amount); modify.put("max_order_amount", maxOrderAmount);
return modify; return modify;
} }
} }

@ -1,19 +1,18 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class OrderExpiryModify extends ClientConfigModify { public class OrderExpiryModify extends ClientModify {
private String order_expiry_config; private String orderExpiryConfig;
public OrderExpiryModify(JSONObject account, String clientMoniker, String order_expiry_config) { public OrderExpiryModify(JSONObject account, String clientMoniker, String orderExpiryConfig) {
super(account, clientMoniker); super(account, clientMoniker);
this.order_expiry_config = order_expiry_config; this.orderExpiryConfig = orderExpiryConfig;
} }
@Override @Override
@ -24,7 +23,7 @@ public class OrderExpiryModify extends ClientConfigModify {
@Override @Override
protected JSONObject getModifyResult() { protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject(); JSONObject modify = new JSONObject();
modify.put("order_expiry_config", order_expiry_config); modify.put("order_expiry_config", orderExpiryConfig);
return modify; return modify;
} }
} }

@ -1,18 +1,17 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class PaypadVersionModify extends ClientConfigModify { public class PaypadVersionModify extends ClientModify {
private String paypad_version; private String paypadVersion;
public PaypadVersionModify(JSONObject account, String clientMoniker, String paypad_version) { public PaypadVersionModify(JSONObject account, String clientMoniker, String paypadVersion) {
super(account, clientMoniker); super(account, clientMoniker);
this.paypad_version = paypad_version; this.paypadVersion = paypadVersion;
} }
@Override @Override
@ -24,7 +23,7 @@ public class PaypadVersionModify extends ClientConfigModify {
@Override @Override
protected JSONObject getModifyResult() { protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject(); JSONObject modify = new JSONObject();
modify.put("paypad_version", paypad_version); modify.put("paypad_version", paypadVersion);
return modify; return modify;
} }
} }

@ -1,23 +1,22 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class RefundAuditModify extends ClientConfigModify { public class RefundAuditModify extends ClientModify {
private boolean enable; private boolean enable;
public RefundAuditModify(JSONObject account, String clientMoniker, boolean enable) { public RefundAuditModify(JSONObject account, String clientMoniker, boolean enable) {
super( account, clientMoniker); super(account, clientMoniker);
this.enable = enable; this.enable = enable;
} }
@Override @Override
protected String business() { protected String business() {
return (enable?"打开":"关闭")+"refund_audit"; return (enable ? "打开" : "关闭") + "refund_audit";
} }
@Override @Override

@ -1,13 +1,12 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class RefundPWDModify extends ClientConfigModify { public class RefundPWDModify extends ClientModify {
private String refund_pwd; private String refund_pwd;
private String refund_pwd_salt; private String refund_pwd_salt;

@ -1,30 +1,29 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class SettleHourModify extends ClientConfigModify { public class SettleHourModify extends ClientModify {
private Integer settle_hour; private Integer settleHour;
public SettleHourModify(JSONObject account, String clientMoniker, Integer settle_hour) { public SettleHourModify(JSONObject account, String clientMoniker, Integer settleHour) {
super(account, clientMoniker); super(account, clientMoniker);
this.settle_hour = settle_hour; this.settleHour = settleHour;
} }
@Override @Override
protected String business() { protected String business() {
return "修改商户清算截止时间为:"+settle_hour; return "修改商户清算截止时间为:" + settleHour;
} }
@Override @Override
protected JSONObject getModifyResult() { protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject(); JSONObject modify = new JSONObject();
modify.put("settle_hour", settle_hour); modify.put("settle_hour", settleHour);
return modify; return modify;
} }
} }

@ -1,6 +1,5 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;

@ -1,6 +1,5 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;

@ -1,15 +1,14 @@
package au.com.royalpay.payment.manage.merchants.entity.impls; package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/** /**
* Create by yixian at 2018-04-12 16:43 * Create by yixian at 2018-04-12 16:43
*/ */
public class SwitchPermissionModify extends ClientConfigModify { public class SwitchPermissionModify extends ClientModify {
private String key; private final String key;
private boolean value; private final boolean value;
public SwitchPermissionModify(JSONObject account, String clientMoniker, String key, boolean value) { public SwitchPermissionModify(JSONObject account, String clientMoniker, String key, boolean value) {
super(account, clientMoniker); super(account, clientMoniker);
@ -19,8 +18,7 @@ public class SwitchPermissionModify extends ClientConfigModify {
@Override @Override
protected String business() { protected String business() {
return (value ? "开启 " : "关闭 ") + key;
return (value?"开启 ":"关闭 ")+key;
} }
@Override @Override

@ -56,7 +56,7 @@ public class PartnerManageController {
} }
@RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET,produces = "application/json") @RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET, produces = "application/json")
public JSONObject initMerchantCode() { public JSONObject initMerchantCode() {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("partner_code", clientManager.initMerchantCode()); result.put("partner_code", clientManager.initMerchantCode());
@ -311,7 +311,7 @@ public class PartnerManageController {
@ManagerMapping(value = "/{clientMoniker}/selectBillVersion", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) @ManagerMapping(value = "/{clientMoniker}/selectBillVersion", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void selectBillVersion(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void selectBillVersion(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.selectBillCodeVersion(manager, clientMoniker, pass.getString("version")); clientManager.selectBillCodeVersion(manager, clientMoniker, pass.getString("version"));
} }
/** /**
@ -527,10 +527,10 @@ public class PartnerManageController {
} }
@ManagerMapping(value = "/{clientMoniker}/sub_clients/page", method = RequestMethod.GET) @ManagerMapping(value = "/{clientMoniker}/sub_clients/page", method = RequestMethod.GET)
public JSONObject listSubClientsByPage(@PathVariable String clientMoniker,@RequestParam(defaultValue = "1") int page, public JSONObject listSubClientsByPage(@PathVariable String clientMoniker, @RequestParam(defaultValue = "1") int page,
@RequestParam(required = false) String searchText, @RequestParam(required = false) String searchText,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.listSubClientsByPage(manager, clientMoniker,searchText,page); return clientManager.listSubClientsByPage(manager, clientMoniker, searchText, page);
} }
//创建子商户 //创建子商户
@ -596,8 +596,8 @@ public class PartnerManageController {
*/ */
@ManagerMapping(value = "/{clientMoniker}/file/source_card_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) @ManagerMapping(value = "/{clientMoniker}/file/source_card_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT})
public JSONObject getSourceCardAgreeAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, public JSONObject getSourceCardAgreeAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
@RequestParam("fileName") String fileName){ @RequestParam("fileName") String fileName) {
return clientManager.getSourceCardAgreeFiles(clientMoniker,manager,fileName); return clientManager.getSourceCardAgreeFiles(clientMoniker, manager, fileName);
} }
@ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) @ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
@ -618,13 +618,13 @@ public class PartnerManageController {
@ManagerMapping(value = "/{clientMoniker}/mw_file", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) @ManagerMapping(value = "/{clientMoniker}/mw_file", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void uploadMWAuthFiles(@PathVariable String clientMoniker, @RequestBody ClientMWAuthFilesInfo filesInfo, public void uploadMWAuthFiles(@PathVariable String clientMoniker, @RequestBody ClientMWAuthFilesInfo filesInfo,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.uploadMWAuthFilesManager(manager, clientMoniker, filesInfo); clientManager.uploadMWAuthFilesManager(manager, clientMoniker, filesInfo);
} }
@ManagerMapping(value = "/{clientMoniker}/kycFile", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) @ManagerMapping(value = "/{clientMoniker}/kycFile", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void uploadKycFiles(@PathVariable String clientMoniker, @RequestBody ClientKycFilesInfo filesInfo, public void uploadKycFiles(@PathVariable String clientMoniker, @RequestBody ClientKycFilesInfo filesInfo,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.uploadKycFiles(manager, clientMoniker, filesInfo); clientManager.uploadKycFiles(manager, clientMoniker, filesInfo);
} }
@ -646,6 +646,7 @@ public class PartnerManageController {
/** /**
* BD * BD
*
* @param clientMoniker * @param clientMoniker
* @param manager * @param manager
*/ */
@ -661,6 +662,7 @@ public class PartnerManageController {
/** /**
* *
*
* @param clientMoniker * @param clientMoniker
* @param manager * @param manager
*/ */
@ -686,6 +688,7 @@ public class PartnerManageController {
/** /**
* *
*
* @param clientMoniker * @param clientMoniker
* @param manager * @param manager
* @throws Exception * @throws Exception
@ -697,14 +700,18 @@ public class PartnerManageController {
/** /**
* *
*
* @param clientMoniker * @param clientMoniker
* @param manager * @param manager
* @throws Exception * @throws Exception
*/ */
@ManagerMapping(value = "/{clientMoniker}/export/aggregate/card_promotiona_agree_pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) @GetMapping(value = "/{clientMoniker}/export/aggregate/card_promotion_agree_pdf")
public void exportAggregateCardPromotionaAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, public void exportAggregateCardPromotionaAgreeFile(@PathVariable String clientMoniker,
@RequestParam("date") String promotionalEffectiveDate,@RequestParam("period") int promotionalPeriod) throws Exception { @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
clientManager.getAggregateCardPromotionaAgreeFile(clientMoniker, manager, false,promotionalEffectiveDate,promotionalPeriod); @RequestParam("rateid") String rateid,
HttpServletResponse httpResponse
) {
clientManager.getAggregateCardPromotionaAgreeFile(clientMoniker, manager, false, rateid, httpResponse);
} }
@ManagerMapping(value = "/{clientMoniker}/temp/export/pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/temp/export/pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
@ -724,6 +731,7 @@ public class PartnerManageController {
/** /**
* BD * BD
*
* @param clientMoniker * @param clientMoniker
* @param manager * @param manager
*/ */
@ -755,8 +763,8 @@ public class PartnerManageController {
@GetMapping(value = "/{clientMoniker}/lists_settlements/excel") @GetMapping(value = "/{clientMoniker}/lists_settlements/excel")
@ReadOnlyConnection @ReadOnlyConnection
public void excelSettlements(@PathVariable String clientMoniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,HttpServletResponse response){ public void excelSettlements(@PathVariable String clientMoniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse response) {
clientManager.excelSettlementLog(manager, clientMoniker, query,response); clientManager.excelSettlementLog(manager, clientMoniker, query, response);
} }
@ManagerMapping(value = "/{clientMoniker}/requireCustinfo", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) @ManagerMapping(value = "/{clientMoniker}/requireCustinfo", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
@ -805,6 +813,7 @@ public class PartnerManageController {
public List<JSONObject> listRpaySubMerchantIdApplys(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public List<JSONObject> listRpaySubMerchantIdApplys(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.listRpaySubMerchantIdApplys(manager, clientMoniker); return clientManager.listRpaySubMerchantIdApplys(manager, clientMoniker);
} }
@ManagerMapping(value = "/{clientMoniker}/sub_apply", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) @ManagerMapping(value = "/{clientMoniker}/sub_apply", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public String subMerchantApplication(@PathVariable String clientMoniker, @RequestBody SubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public String subMerchantApplication(@PathVariable String clientMoniker, @RequestBody SubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.subMerchantApplication(clientMoniker, subMerchantIdApply, manager); return clientManager.subMerchantApplication(clientMoniker, subMerchantIdApply, manager);
@ -932,51 +941,54 @@ public class PartnerManageController {
/** /**
* *
*
* @param clientMoniker * @param clientMoniker
* @return * @return
*/ */
@ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public JSONObject getClientIncrementalService(@PathVariable String clientMoniker){ public JSONObject getClientIncrementalService(@PathVariable String clientMoniker) {
return clientManager.partnerIncrementalService(clientMoniker); return clientManager.partnerIncrementalService(clientMoniker);
} }
/** /**
* / * /
*
* @param clientMoniker * @param clientMoniker
* @param incrementalService * @param incrementalService
*/ */
@ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public void updateClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker,@RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ public void updateClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker, @RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.changePartnerIncrementalService(clientMoniker,incrementalService,manager); clientManager.changePartnerIncrementalService(clientMoniker, incrementalService, manager);
} }
/** /**
* / * /
*
* @param clientMoniker * @param clientMoniker
* @param incrementalService * @param incrementalService
*/ */
@ManagerMapping(value = "/{clientMoniker}/incremental_service/status", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/incremental_service/status", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public void switchClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker,@RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ public void switchClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker, @RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.changeSwitchIncrementalService(clientMoniker,incrementalService,manager); clientManager.changeSwitchIncrementalService(clientMoniker, incrementalService, manager);
} }
@ManagerMapping(value = "/{clientMoniker}/ext_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/ext_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public void changeClientExtConfigs(@PathVariable("clientMoniker")String clientMoniker, public void changeClientExtConfigs(@PathVariable("clientMoniker") String clientMoniker,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
@RequestBody JSONObject params){ @RequestBody JSONObject params) {
clientManager.changeExtParams(clientMoniker,manager,params); clientManager.changeExtParams(clientMoniker, manager, params);
} }
@ManagerMapping(value = "/{clientMoniker}/applyMWMerchantId",method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/applyMWMerchantId", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public RPayMerchantEntity applyMWMerchantId(@PathVariable("clientMoniker")String clientMoniker, public RPayMerchantEntity applyMWMerchantId(@PathVariable("clientMoniker") String clientMoniker,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.applyMWMerchantId(clientMoniker,manager); return clientManager.applyMWMerchantId(clientMoniker, manager);
} }
@ManagerMapping(value = "/{clientMoniker}/queryMWMerchantIdStatus",method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/queryMWMerchantIdStatus", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public RPayMerchantEntity queryMWMerchantIdStatus(@PathVariable("clientMoniker")String clientMoniker, public RPayMerchantEntity queryMWMerchantIdStatus(@PathVariable("clientMoniker") String clientMoniker,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.queryMWMerchantIdStatus(clientMoniker,manager); return clientManager.queryMWMerchantIdStatus(clientMoniker, manager);
} }
@ManagerMapping(value = "/{clientMoniker}/query/mw_info", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) @ManagerMapping(value = "/{clientMoniker}/query/mw_info", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
@ -986,11 +998,12 @@ public class PartnerManageController {
/** /**
* / * /
*
* @param clientMoniker * @param clientMoniker
*/ */
@ManagerMapping(value = "/{clientMoniker}/payment_card_permission", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/payment_card_permission", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public void switchInternationalCard(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ public void switchInternationalCard(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchPermission(manager, clientMoniker, "enable_international_card", pass.getBooleanValue("allow")); clientManager.modifyUPayProfile(manager, clientMoniker, "enable_international_card", pass.getBooleanValue("allow"));
} }
} }

@ -12,7 +12,10 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper; import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper; import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper; import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.payment.*; import au.com.royalpay.payment.manage.mappers.payment.AustracDataMapper;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.RefundMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.*; import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.organizations.core.OrgManager; import au.com.royalpay.payment.manage.organizations.core.OrgManager;
@ -56,7 +59,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.ui.Model; import org.springframework.ui.Model;
@ -88,8 +90,6 @@ public class TradeLogServiceImpl implements TradeLogService {
@Resource @Resource
private RefundMapper refundMapper; private RefundMapper refundMapper;
@Resource @Resource
private RefundAuditionMapper refundAuditionMapper;
@Resource
private ClientAccountMapper clientAccountMapper; private ClientAccountMapper clientAccountMapper;
@Resource @Resource
private ClientManager clientManager; private ClientManager clientManager;
@ -116,8 +116,6 @@ public class TradeLogServiceImpl implements TradeLogService {
@Resource @Resource
private ClearingLogMapper clearingLogMapper; private ClearingLogMapper clearingLogMapper;
@Resource @Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private OrgManager orgManager; private OrgManager orgManager;
@Resource @Resource
private ClientMapper clientMapper; private ClientMapper clientMapper;

@ -3,13 +3,13 @@ spring:
master: master:
host: 192.168.0.84:3306 host: 192.168.0.84:3306
jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
password: rpayplus password: rpayplus123
schema-name: royalpay schema-name: royalpay
username: root username: root
slave: slave:
host: 192.168.0.84:3306 host: 192.168.0.84:3306
jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
password: rpayplus password: rpayplus123
schema-name: royalpay schema-name: royalpay
username: root username: root
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource

@ -952,7 +952,7 @@
INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1 INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1
AND so.type = 0 AND so.type = 0
AND so.citypartner = 1 AND so.commission = 1 AND so.citypartner = 1 AND so.commission = 1
AND year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND year(t.create_time) = #{year} AND month(t.create_time) = #{month}
AND t.channel != 'Settlement' AND t.channel != 'System' AND t.system_generate = 0 AND t.channel != 'Settlement' AND t.channel != 'System' AND t.system_generate = 0
ORDER BY t.client_id asc ORDER BY t.client_id asc
]]> ]]>

@ -5,6 +5,14 @@
<p style="font-family: Avenir-Light;font-size: 1rem;color: #2A2A2A;letter-spacing: 0;">I'm happy to let you know <p style="font-family: Avenir-Light;font-size: 1rem;color: #2A2A2A;letter-spacing: 0;">I'm happy to let you know
that your RoyalPay Cross-border Payment account has been set up.<br> that your RoyalPay Cross-border Payment account has been set up.<br>
很高兴通知您贵司RoyalPay跨境全支付已经开通</p> 很高兴通知您贵司RoyalPay跨境全支付已经开通</p>
<p style="font-family: Avenir-Light;font-size: 1rem;color: #2A2A2A;letter-spacing: 0;" th:if="${card_approving}">I'm
happy to let you know
Congratulations, you have passed the compliance review and be granted a RoyalPay account.
You can start to do IT integration. At the same time, please contact BD regarding the invoice of security
deposit. We will set up your account live in the production environment after receiving the security deposit
from your company.
<br>
恭喜您已通过 CardPayment 合规审核,您可开始做IT对接. 请联系BD沟通支付保证金事宜。我司会在收到贵司提交的保证金后开启您的 CardPayment 权限。</p>
<p style="font-family: Avenir-Light;font-size: 1rem;color: #2A2A2A;letter-spacing: 0;">Please kindly log on the <p style="font-family: Avenir-Light;font-size: 1rem;color: #2A2A2A;letter-spacing: 0;">Please kindly log on the
website below to manage your accounts and transactions:<br> website below to manage your accounts and transactions:<br>
@ -94,7 +102,7 @@
Store to download APP for IOSwhich helps check your payment receiving records.</p> Store to download APP for IOSwhich helps check your payment receiving records.</p>
<p style="font-family: PingFang-SC-Medium;font-size: 1rem;color: #000000;letter-spacing: 0;"> <p style="font-family: PingFang-SC-Medium;font-size: 1rem;color: #000000;letter-spacing: 0;">
您可以在APP Store里搜索"<a style="color: #FF6600;text-decoration: none" 您可以在APP Store里搜索"<a style="color: #FF6600;text-decoration: none"
href="https://itunes.apple.com/app/royalpay/id1049566852?l=en&mt=8">RoyalPay</a>"下载royalpay的app来进行收款和接收到账提醒等。 href="https://itunes.apple.com/app/royalpay/id1049566852?l=en&mt=8">RoyalPay</a>"下载royalpay的app来进行收款和接收到账提醒等。
</p> </p>
<p><img style="width: 100%" src="https://mpay.royalpay.com.au/static/images/App_banner.png"> <br> <p><img style="width: 100%" src="https://mpay.royalpay.com.au/static/images/App_banner.png"> <br>
</p> </p>
@ -154,7 +162,8 @@
<div style="display: flex;justify-content: space-around"> <div style="display: flex;justify-content: space-around">
<div style="font-family: Avenir-Medium;font-size: 1rem;color: #888888;"> <div style="font-family: Avenir-Medium;font-size: 1rem;color: #888888;">
<div style="">Email:<br/><a style="color: #888888;text-decoration: none" href="mailto:info@royalpay.com.au">info@royalpay.com.au</a></div> <div style="">Email:<br/><a style="color: #888888;text-decoration: none" href="mailto:info@royalpay.com.au">info@royalpay.com.au</a>
</div>
<div style="margin-top: 1rem;">Tel:<br/>1300 10 77 50</div> <div style="margin-top: 1rem;">Tel:<br/>1300 10 77 50</div>
<div style="margin-top: 1rem;">Level 14, 383 Kent Street, Sydney NSW 2000</div> <div style="margin-top: 1rem;">Level 14, 383 Kent Street, Sydney NSW 2000</div>
<div style="margin-top: 1rem;">Tunnel Show Pty Ltd trading as RoyalPay</div> <div style="margin-top: 1rem;">Tunnel Show Pty Ltd trading as RoyalPay</div>
@ -173,10 +182,7 @@
</div> </div>
<div style="width: 100%;height: 0.1rem;background: #F9E6D8;margin-top: 2rem;margin-bottom: 2rem;"></div> <div style="width: 100%;height: 0.1rem;background: #F9E6D8;margin-top: 2rem;margin-bottom: 2rem;"></div>
</div> </div>
</html> </html>

File diff suppressed because it is too large Load Diff

@ -1317,13 +1317,13 @@
<label> <label>
<input type="checkbox" checked disabled <input type="checkbox" checked disabled
id="approving-check"> id="approving-check">
Australia Credit Card Payment|澳大利亚信用卡支付 AU Credit Card | AU 信用卡支付
</label> </label>
</span> </span>
<span class="checkbox-inline"> <span class="checkbox-inline">
<label> <label>
<input type="checkbox" ng-model="partner.enable_international_card"> <input type="checkbox" ng-model="partner.enable_international_card">
International Credit Card Payment|国际信用卡支付 Intl Credit Card|国际信用卡
</label> </label>
</span> </span>
</div> </div>

@ -1,5 +1,5 @@
<style> <style>
.bank-input{ .bank-input {
width: 95%; width: 95%;
float: left; float: left;
} }
@ -17,7 +17,9 @@
<div class="form-group" ng-if="partner.surcharge_mode=='distributed'"> <div class="form-group" ng-if="partner.surcharge_mode=='distributed'">
<label class="col-sm-4">手续费账户余额</label> <label class="col-sm-4">手续费账户余额</label>
<div class="col-sm-6" style="font-size: 25px"> <div class="col-sm-6" style="font-size: 25px">
<p>{{surcharge.balance|currency:'AUD'}}<i class="fa fa-bars" style="font-size: 15px;color: #3c8dbc;cursor: pointer;padding-left: 15px" ng-click="surchargeAccountDetail()"></i></p> <p>{{surcharge.balance|currency:'AUD'}}<i class="fa fa-bars"
style="font-size: 15px;color: #3c8dbc;cursor: pointer;padding-left: 15px"
ng-click="surchargeAccountDetail()"></i></p>
</div> </div>
</div> </div>
<div class="form-group" ng-if="partner.surcharge_mode=='distributed'"> <div class="form-group" ng-if="partner.surcharge_mode=='distributed'">
@ -32,10 +34,12 @@
<div class="col-sm-6"> <div class="col-sm-6">
<p> <p>
<span ng-if="partner.surcharge_mode=='balance'">balance <span ng-if="partner.surcharge_mode=='balance'">balance
<i class="fa fa-sort" style="color: #3c8dbc;cursor: pointer" ng-click="switchSurchargeMode()"></i> <i class="fa fa-sort" style="color: #3c8dbc;cursor: pointer"
ng-click="switchSurchargeMode()"></i>
</span> </span>
<span ng-if="partner.surcharge_mode=='distributed'">distributed <span ng-if="partner.surcharge_mode=='distributed'">distributed
<i class="fa fa-sort" style="color: #3c8dbc;cursor: pointer" ng-click="switchSurchargeMode()"></i> <i class="fa fa-sort" style="color: #3c8dbc;cursor: pointer"
ng-click="switchSurchargeMode()"></i>
</span> </span>
<p class="text-info"> <p class="text-info">
<i class="fa fa-info"></i>启用到收支分离(distributed)模式,将使消费者支付手续费模式失效<br> <i class="fa fa-info"></i>启用到收支分离(distributed)模式,将使消费者支付手续费模式失效<br>
@ -87,33 +91,38 @@
<label class="col-sm-4">Settle Hour</label> <label class="col-sm-4">Settle Hour</label>
<div class="col-sm-6"> <div class="col-sm-6">
<select ng-model="partner.settle_hour" class="form-control" <select ng-model="partner.settle_hour" class="form-control"
ng-options="hour.value as hour.label for hour in settleHours" ng-change="settleHourConfig()"></select> ng-options="hour.value as hour.label for hour in settleHours"
ng-change="settleHourConfig()"></select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="swiftcode_input">Swift Code</label> <label class="col-sm-4" for="swiftcode_input">Swift Code</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
<input class="form-control bank-input" ng-model="bankaccount.swift_code" id="swiftcode_input" required ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.swift_code" id="swiftcode_input"
required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="bsb_no_input">BSB No</label> <label class="col-sm-4" for="bsb_no_input">BSB No</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true" ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.bsb_no" id="bsb_no_input" required <input class="form-control bank-input" ng-model="bankaccount.bsb_no" id="bsb_no_input" required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
<div class="col-sm-2" ng-if="bankCtrl.edit"> <div class="col-sm-2" ng-if="bankCtrl.edit">
<a class="btn btn-success" role="button" ng-click="getBankInfo(bankaccount.bsb_no)"><i <a class="btn btn-success" role="button" ng-click="getBankInfo(bankaccount.bsb_no)"><i
class="fa fa-eye"ng-if="$root.complianceCheck.bankAccount"></i>search</a> class="fa fa-eye" ng-if="$root.complianceCheck.bankAccount"></i>search</a>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="bank_input">Bank</label> <label class="col-sm-4" for="bank_input">Bank</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.bank" id="bank_input" required <input class="form-control bank-input" ng-model="bankaccount.bank" id="bank_input" required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
@ -121,7 +130,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="city_input">City</label> <label class="col-sm-4" for="city_input">City</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.city" id="city_input" required <input class="form-control bank-input" ng-model="bankaccount.city" id="city_input" required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
@ -129,7 +139,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="address_input">Address</label> <label class="col-sm-4" for="address_input">Address</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.address" id="address_input" required <input class="form-control bank-input" ng-model="bankaccount.address" id="address_input" required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
@ -137,7 +148,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="system_input">System</label> <label class="col-sm-4" for="system_input">System</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.system" id="system_input" required <input class="form-control bank-input" ng-model="bankaccount.system" id="system_input" required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
@ -145,7 +157,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="postcode_input">Postcode</label> <label class="col-sm-4" for="postcode_input">Postcode</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.postcode" id="postcode_input" required <input class="form-control bank-input" ng-model="bankaccount.postcode" id="postcode_input" required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
@ -153,7 +166,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="state_input">State</label> <label class="col-sm-4" for="state_input">State</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.state" id="state_input" required <input class="form-control bank-input" ng-model="bankaccount.state" id="state_input" required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
@ -161,7 +175,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="branch_input">Branch</label> <label class="col-sm-4" for="branch_input">Branch</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.branch" id="branch_input" required <input class="form-control bank-input" ng-model="bankaccount.branch" id="branch_input" required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
@ -169,15 +184,18 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="account_no_input">Account No</label> <label class="col-sm-4" for="account_no_input">Account No</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
<input class="form-control bank-input" ng-model="bankaccount.account_no" id="account_no_input" required ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" ng-model="bankaccount.account_no" id="account_no_input"
required
ng-readonly="!bankCtrl.edit"> ng-readonly="!bankCtrl.edit">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4" for="account_name_input">Account Name</label> <label class="col-sm-4" for="account_name_input">Account Name</label>
<div class="col-sm-6"> <div class="col-sm-6">
<i class="fa fa-check-square-o check-i" aria-hidden="true"ng-if="$root.complianceCheck.bankAccount"></i> <i class="fa fa-check-square-o check-i" aria-hidden="true"
ng-if="$root.complianceCheck.bankAccount"></i>
<input class="form-control bank-input" maxlength="50" ng-model="bankaccount.account_name" <input class="form-control bank-input" maxlength="50" ng-model="bankaccount.account_name"
id="account_name_input" required ng-readonly="!bankCtrl.edit"> id="account_name_input" required ng-readonly="!bankCtrl.edit">
</div> </div>
@ -203,18 +221,39 @@
<i class="fa fa-plus"></i></a> <i class="fa fa-plus"></i></a>
</h3> </h3>
<ul class="nav nav-pills margin-bottom"> <ul class="nav nav-pills margin-bottom">
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='Wechat'}"><a role="button" ng-click="bankCtrl.rate_name='Wechat'">Wechat</a></li> <li role="presentation" ng-class="{active:bankCtrl.rate_name=='Wechat'}"><a role="button"
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='Alipay'}"><a role="button" ng-click="bankCtrl.rate_name='Alipay'">Alipay(Retail)</a></li> ng-click="bankCtrl.rate_name='Wechat'">Wechat</a>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='AlipayOnline'}"><a role="button" ng-click="bankCtrl.rate_name='AlipayOnline'">Alipay(Online)</a></li> </li>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='Bestpay'}"><a role="button" ng-click="bankCtrl.rate_name='Bestpay'">Bestpay</a></li> <li role="presentation" ng-class="{active:bankCtrl.rate_name=='Alipay'}"><a role="button"
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='jd'}"><a role="button" ng-click="bankCtrl.rate_name='jd'">JDpay</a></li> ng-click="bankCtrl.rate_name='Alipay'">Alipay(Retail)</a>
</li>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='AlipayOnline'}"><a role="button"
ng-click="bankCtrl.rate_name='AlipayOnline'">Alipay(Online)</a>
</li>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='Bestpay'}"><a role="button"
ng-click="bankCtrl.rate_name='Bestpay'">Bestpay</a>
</li>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='jd'}"><a role="button"
ng-click="bankCtrl.rate_name='jd'">JDpay</a>
</li>
<!--<li role="presentation" ng-class="{active:bankCtrl.rate_name=='hf'}"><a role="button" ng-click="bankCtrl.rate_name='hf'">HFpay</a></li>--> <!--<li role="presentation" ng-class="{active:bankCtrl.rate_name=='hf'}"><a role="button" ng-click="bankCtrl.rate_name='hf'">HFpay</a></li>-->
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='Rpay'}"><a role="button" ng-click="bankCtrl.rate_name='Rpay'">Rpay+</a></li> <li role="presentation" ng-class="{active:bankCtrl.rate_name=='Rpay'}"><a role="button"
ng-click="bankCtrl.rate_name='Rpay'">Rpay+</a>
</li>
<!--<li role="presentation" ng-class="{active:bankCtrl.rate_name=='Yeepay'}"><a role="button" ng-click="bankCtrl.rate_name='Yeepay'">Yeepay</a></li>--> <!--<li role="presentation" ng-class="{active:bankCtrl.rate_name=='Yeepay'}"><a role="button" ng-click="bankCtrl.rate_name='Yeepay'">Yeepay</a></li>-->
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='CB_BankPay'}"><a role="button" ng-click="bankCtrl.rate_name='CB_BankPay'" ng-if="sysconfig.active_channels.indexOf('CB_BankPay')!=-1">CB_BankPay</a></li> <li role="presentation" ng-class="{active:bankCtrl.rate_name=='CB_BankPay'}"><a role="button"
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='rpaypmt_card'}"><a role="button" ng-click="bankCtrl.rate_name='rpaypmt_card'">Card Payment</a></li> ng-click="bankCtrl.rate_name='CB_BankPay'"
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='rpaypmt_dd'}"><a role="button" ng-click="bankCtrl.rate_name='rpaypmt_dd'">Direct Debit</a></li> ng-if="sysconfig.active_channels.indexOf('CB_BankPay')!=-1">CB_BankPay</a>
<a id="addCardPaymentRate" class="btn btn-warning" style="float: right" type="button" ng-click="newCardPaymentRates()" ng-if="(partner.card_rate_editable && ('100'|withRole)) || ('11'|withRole)" > </li>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='rpaypmt_card'}"><a role="button"
ng-click="bankCtrl.rate_name='rpaypmt_card'">Card
Payment</a></li>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='rpaypmt_dd'}"><a role="button"
ng-click="bankCtrl.rate_name='rpaypmt_dd'">Direct
Debit</a></li>
<a id="addCardPaymentRate" class="btn btn-warning" style="float: right" type="button"
ng-click="newCardPaymentRates()"
ng-if="(partner.card_rate_editable && ('100'|withRole)) || ('11'|withRole)">
Add Card Payment Rates Add Card Payment Rates
</a> </a>
</ul> </ul>
@ -229,11 +268,13 @@
<th>Transaction Fee</th> <th>Transaction Fee</th>
<th>Active Time</th> <th>Active Time</th>
<th>Expire Time</th> <th>Expire Time</th>
<th ng-if="bankCtrl.rate_name=='Wechat' || bankCtrl.rate_name=='rpaypmt_card' ||bankCtrl.rate_name=='rpaypmt_dd'">Clean Days</th> <th ng-if="bankCtrl.rate_name=='Wechat' || bankCtrl.rate_name=='rpaypmt_card' ||bankCtrl.rate_name=='rpaypmt_dd'">
Clean Days
</th>
<th>Update Time</th> <th>Update Time</th>
<th>Operator</th> <th>Operator</th>
<th>Remark</th> <th>Remark</th>
<th>Operation</th> <th style="text-align: center">Operation</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -242,21 +283,32 @@
<td ng-bind="rate.rate_name"></td> <td ng-bind="rate.rate_name"></td>
<td ng-if="bankCtrl.rate_name!='rpaypmt_card'" ng-bind="rate.rate_value + ' %'"></td> <td ng-if="bankCtrl.rate_name!='rpaypmt_card'" ng-bind="rate.rate_value + ' %'"></td>
<td ng-if="bankCtrl.rate_name=='rpaypmt_card'" ng-bind="rate.rate_value + ' %'"></td> <td ng-if="bankCtrl.rate_name=='rpaypmt_card'" ng-bind="rate.rate_value + ' %'"></td>
<td ng-if="bankCtrl.rate_name=='rpaypmt_card'" ng-bind="rate.ext_rates.overseas_rate_value + ' %'"></td> <td ng-if="bankCtrl.rate_name=='rpaypmt_card'"
ng-bind="rate.ext_rates.overseas_rate_value + ' %'"></td>
<td ng-bind="'$ '+rate.transaction_fee"></td> <td ng-bind="'$ '+rate.transaction_fee"></td>
<td ng-bind="rate.active_time|date:'yyyy-MM-dd'"></td> <td ng-bind="rate.active_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="rate.expiry_time|date:'yyyy-MM-dd'"></td> <td ng-bind="rate.expiry_time|date:'yyyy-MM-dd'"></td>
<td ng-if="rate.rate_name=='Wechat' || bankCtrl.rate_name=='rpaypmt_card' ||bankCtrl.rate_name=='rpaypmt_dd'">T+{{rate.clean_days}}</td> <td ng-if="rate.rate_name=='Wechat' || bankCtrl.rate_name=='rpaypmt_card' ||bankCtrl.rate_name=='rpaypmt_dd'">
T+{{rate.clean_days}}
</td>
<td ng-bind="rate.update_time|date:'yyyy-MM-dd'"></td> <td ng-bind="rate.update_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="rate.operator_name||'系统生成'"></td> <td ng-bind="rate.operator_name||'系统生成'"></td>
<td ng-bind="rate.remark|limitTo:20" title="{{rate.remark}}"></td> <td ng-bind="rate.remark|limitTo:20" title="{{rate.remark}}"></td>
<td><a role="button" ng-click="editRate(rate)" ng-if="'011'|withRole"><i class="fa fa-edit"></i></a> <td style="text-align: center">
<a role="button" ng-click="editRate(rate)" style="padding-right: 10px;"
ng-if="'011'|withRole"><i class="fa fa-edit"></i></a>
<span ng-if="rate.active=='1' && rate.current=='1' && (bankCtrl.rate_name=='rpaypmt_card' ||bankCtrl.rate_name=='rpaypmt_dd')">
<span style="color: orange">(Promotional Offer)</span>
<a class="fa fa-cloud-download" target="_blank"
ng-href="/sys/partners/{{partner.client_moniker}}/export/aggregate/card_promotion_agree_pdf?rateid={{rate.client_rate_id}}"></a>
</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div style="text-align: center"> <div style="text-align: center">
<a role="button" style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope" ng-if="('10'|withRole)" ng-click="complianceCheck()">check</a> <a role="button" style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope"
ng-if="('10'|withRole)" ng-click="complianceCheck()">check</a>
</div> </div>
</div> </div>

@ -120,7 +120,8 @@
<!--Organization--> <!--Organization-->
<div class="form-group col-sm-6" ng-if="orgs"> <div class="form-group col-sm-6" ng-if="orgs">
<label class="control-label col-xs-4 col-sm-4" for="bd-select">Organization</label> <label class="control-label col-xs-4 col-sm-4"
for="bd-select">Organization</label>
<div class="col-xs-6 col-sm-6"> <div class="col-xs-6 col-sm-6">
<select id="org-select" class="form-control" ng-model="params.org_id" <select id="org-select" class="form-control" ng-model="params.org_id"
ng-options="org.org_id as org.name group by org.org_type for org in orgs" ng-options="org.org_id as org.name group by org.org_type for org in orgs"
@ -130,9 +131,12 @@
</div> </div>
</div> </div>
<div class="form-group col-sm-6" ng-if="(params.org_id && orgs_child.length>1) || (currentUser.org_id && !currentUser.parent_org_id && orgs_child.length>1)"> <div class="form-group col-sm-6"
<label class="control-label col-xs-4 col-sm-4" for="org-clild" ng-if="!currentUser.org_id">Sub Organization</label> ng-if="(params.org_id && orgs_child.length>1) || (currentUser.org_id && !currentUser.parent_org_id && orgs_child.length>1)">
<label class="control-label col-xs-4 col-sm-4" for="org-clild" ng-if="currentUser.org_id">Organization</label> <label class="control-label col-xs-4 col-sm-4" for="org-clild"
ng-if="!currentUser.org_id">Sub Organization</label>
<label class="control-label col-xs-4 col-sm-4" for="org-clild"
ng-if="currentUser.org_id">Organization</label>
<div class="col-xs-6 col-sm-6"> <div class="col-xs-6 col-sm-6">
<select id="org-clild" class="form-control" ng-model="params.org_ids" <select id="org-clild" class="form-control" ng-model="params.org_ids"
ng-options="org.org_id as org.name group by org.type for org in orgs_child" ng-options="org.org_id as org.name group by org.type for org in orgs_child"
@ -184,10 +188,21 @@
<!--<div class="col-xs-8 col-sm-4">--> <!--<div class="col-xs-8 col-sm-4">-->
<span class="col-xs-8 col-sm-10"> <span class="col-xs-8 col-sm-10">
<span class="checkbox-inline"> <span class="checkbox-inline">
<label> <label style="color: #f06010">
<input type="checkbox" ng-model="params.approving" <input type="checkbox" ng-model="params.approving"
id="approving-check"> id="approving-check">
等待合规 <img height="20px" src="/static/images/royalpay_sign_s.png">
Cross-Board Payment 等待合规
</label>
</span>
<span class="checkbox-inline">
<label style="color: blue">
<input type="checkbox" ng-model="params.card_approving"
id="card_approving-check">
<img height="20px"
src="/static/images/card_payment_sign.png">
Card Payment等待合规
</label> </label>
</span> </span>
<span class="checkbox-inline"> <span class="checkbox-inline">
@ -195,13 +210,26 @@
<input type="checkbox" ng-model="params.tempMchId"> 使用通用子商户号 <input type="checkbox" ng-model="params.tempMchId"> 使用通用子商户号
</label> </label>
</span> </span>
<span class="checkbox-inline"> <span class="checkbox-inline">
<label> <label>
<input type="checkbox" ng-model="params.bd_upload_material"> 等待BD上传材料审核
</label>
</span>
</span>
<!--</div>-->
</div>
<div class="form-group col-sm-12" ng-if="'10'|withRole">
<label class="control-label col-xs-4 col-sm-2"></label>
<!--<div class="col-xs-8 col-sm-4">-->
<span class="col-xs-8 col-sm-10">
<span class="checkbox-inline warning">
<label style="color: yellowgreen" >
<input type="checkbox" ng-model="params.quickPass"> 自助开通 <input type="checkbox" ng-model="params.quickPass"> 自助开通
</label> </label>
</span> </span>
<span class="checkbox-inline"> <span class="checkbox-inline">
<label> <label style="color: green">
<input type="checkbox" ng-model="params.greenChannel"> 绿色通道 <input type="checkbox" ng-model="params.greenChannel"> 绿色通道
</label> </label>
</span> </span>
@ -217,17 +245,12 @@
</label> </label>
</span> </span>
<span class="checkbox-inline"> <span class="checkbox-inline">
<label> <label style="color: yellow">
<input type="checkbox" ng-model="params.apply_to_back"> 申请打回 <input type="checkbox" ng-model="params.apply_to_back"> 申请打回
</label> </label>
</span>
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.bd_upload_material"> 等待BD上传材料审核
</label>
</span> </span>
<span class="checkbox-inline"> <span class="checkbox-inline">
<label> <label style="color: red">
<input type="checkbox" ng-model="params.is_valid"> 禁用 <input type="checkbox" ng-model="params.is_valid"> 禁用
</label> </label>
</span> </span>

@ -265,9 +265,7 @@
</div> </div>
<div class="box-body" ng-if="partner.is_valid==1"> <div class="box-body" ng-if="partner.is_valid==1">
<a ng-if="partner.upay_open_status != 5 && partner.upay_open_status" role="button" type="button" class="btn btn-success" ng-click="exportCardAgreegatePDF()"> <a ng-if="partner.upay_open_status != 5 && partner.upay_open_status" role="button" type="button" class="btn btn-success" ng-click="exportCardAgreegatePDF()">
制作信用卡支付合同</a> 制作Card Payment合同</a>
<a ng-if="partner.upay_open_status != 5 &&letterOfOfferFileManager.letter_of_offer_file" role="button" type="button" class="btn btn-success" ng-click="exportCardPromotionaAgreegatePDF()">
制作促销合同</a>
<div class="btn-group pull-right" role="group" aria-label="..."> <div class="btn-group pull-right" role="group" aria-label="...">
<button type="button" ng-if="partner.upay_open_status==1 && partner.upay_approve_result>1 || partner.upay_open_status==4" <button type="button" ng-if="partner.upay_open_status==1 && partner.upay_approve_result>1 || partner.upay_open_status==4"
class="btn btn-success" ng-click="passCardClient()">Pass class="btn btn-success" ng-click="passCardClient()">Pass
@ -282,9 +280,6 @@
<a ng-if="termsAndConditionsFile.terms_and_conditions_file" role="button" class="btn-group btn btn-warning" <a ng-if="termsAndConditionsFile.terms_and_conditions_file" role="button" class="btn-group btn btn-warning"
type="button" ng-href="{{termsAndConditionsFile.terms_and_conditions_file}}" target="_blank"> <i type="button" ng-href="{{termsAndConditionsFile.terms_and_conditions_file}}" target="_blank"> <i
class="fa fa-download"></i>下载Terms And Conditions合同</a> class="fa fa-download"></i>下载Terms And Conditions合同</a>
<a ng-if="promotionalOfferFileManager.promotional_offer_file" role="button" class="btn-group btn btn-warning"
type="button" ng-href="{{promotionalOfferFileManager.promotional_offer_file}}" target="_blank"> <i
class="fa fa-download"></i>下载Promotional Offer合同</a>
<span style="margin-top: 5px"ng-if="partner.upay_open_status != 5"> <span style="margin-top: 5px"ng-if="partner.upay_open_status != 5">
<a ng-if="partner.upay_open_status==2" role="button" type="button" class="btn btn-primary" <a ng-if="partner.upay_open_status==2" role="button" type="button" class="btn btn-primary"
ng-click="cardNotifyBD()"> ng-click="cardNotifyBD()">
@ -348,23 +343,9 @@
<a ng-if="termsAndConditionsFile.terms_and_conditions_file && partner.upay_approve_result!=1" role="button" class="btn-group btn btn-warning" <a ng-if="termsAndConditionsFile.terms_and_conditions_file && partner.upay_approve_result!=1" role="button" class="btn-group btn btn-warning"
type="button" ng-href="{{termsAndConditionsFile.terms_and_conditions_file}}" target="_blank"> <i type="button" ng-href="{{termsAndConditionsFile.terms_and_conditions_file}}" target="_blank"> <i
class="fa fa-download"></i>下载Terms And Conditions合同</a> class="fa fa-download"></i>下载Terms And Conditions合同</a>
<a ng-if="promotionalOfferFileManager.promotional_offer_file && partner.upay_approve_result!=1" role="button" class="btn-group btn btn-warning"
type="button" ng-href="{{promotionalOfferFileManager.promotional_offer_file}}" target="_blank"> <i
class="fa fa-download"></i>下载Promotional Offer合同</a>
<div ng-if="partner.upay_open_status==3" class="btn-group pull-right" role="group" aria-label="..."> <div ng-if="partner.upay_open_status==3" class="btn-group pull-right" role="group" aria-label="...">
<button type="button" class="btn btn-danger" ng-click="commitToCardCompliance()">Commit to Compliance</button> <button type="button" class="btn btn-danger" ng-click="commitToCardCompliance()">Commit to Compliance</button>
</div> </div>
<!--<div>
<a ng-if="letterOfOfferFileManager.letter_of_offer_file && partner.upay_open_status==3" role="button" class="btn-group btn btn-success"
type="button" ng-href="{{letterOfOfferFileManager.letter_of_offer_file}}" target="_blank"> <i
class="fa fa-upload"></i>上传签约Letter Of Offer合同</a>
<a ng-if="termsAndConditionsFile.terms_and_conditions_file && partner.upay_open_status==3" role="button" class="btn-group btn btn-success"
type="button" ng-href="{{termsAndConditionsFile.terms_and_conditions_file}}" target="_blank"> <i
class="fa fa-upload"></i>上传签约Terms And Conditions合同</a>
<a ng-if="promotionalOfferFileManager.promotional_offer_file && partner.upay_open_status==3" role="button" class="btn-group btn btn-success"
type="button" ng-href="{{promotionalOfferFileManager.promotional_offer_file}}" target="_blank"> <i
class="fa fa-upload"></i>上传签约Promotional Offer合同</a>
</div>-->
<div ng-if="!partner.upay_open_status" class="btn-group pull-right" role="group" aria-label="..."> <div ng-if="!partner.upay_open_status" class="btn-group pull-right" role="group" aria-label="...">
<button type="button" class="btn btn-primary" ng-click="apply2makeCardAgreeFile()"> <button type="button" class="btn btn-primary" ng-click="apply2makeCardAgreeFile()">
<i class="fa fa-paper-plane"></i> <i class="fa fa-paper-plane"></i>
@ -1285,14 +1266,14 @@
<label> <label>
<input type="checkbox" checked disabled ng-if="partner.mw_industry"> <input type="checkbox" checked disabled ng-if="partner.mw_industry">
<input type="checkbox" disabled ng-if="!partner.mw_industry"> <input type="checkbox" disabled ng-if="!partner.mw_industry">
Australia Credit Card Payment|澳大利亚信用卡支付 AU Credit Card | AU 信用卡支付
</label> </label>
</span> </span>
<span class="checkbox-inline"> <span class="checkbox-inline">
<label> <label>
<input type="checkbox" ng-if="partner.enable_international_card" checked disabled> <input type="checkbox" ng-if="partner.enable_international_card" checked disabled>
<input type="checkbox" ng-if="!partner.enable_international_card" disabled> <input type="checkbox" ng-if="!partner.enable_international_card" disabled>
International Credit Card Payment|国际信用卡支付 Intl Credit Card|国际信用卡
</label> </label>
</span> </span>
</div> </div>

@ -1228,13 +1228,13 @@
<label> <label>
<input type="checkbox" checked disabled <input type="checkbox" checked disabled
id="approving-check"> id="approving-check">
Australia Credit Card Payment|澳大利亚信用卡支付 AU Credit Card | AU 信用卡支付
</label> </label>
</span> </span>
<span class="checkbox-inline"> <span class="checkbox-inline">
<label> <label>
<input type="checkbox" ng-model="partner.enable_international_card"> <input type="checkbox" ng-model="partner.enable_international_card">
International Credit Card Payment|国际信用卡支付 Intl Credit Card|国际信用卡
</label> </label>
</span> </span>
</div> </div>

@ -379,23 +379,6 @@
<label class="control-label col-xs-4 col-sm-2">Status</label> <label class="control-label col-xs-4 col-sm-2">Status</label>
<!--<div class="col-xs-8 col-sm-4">--> <!--<div class="col-xs-8 col-sm-4">-->
<span class="col-xs-8 col-sm-10"> <span class="col-xs-8 col-sm-10">
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.approving"
id="approving-check">
<img height="20px" src="/static/images/royalpay_sign_s.png">
等待合规
</label>
</span>
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.card_approving"
id="card_approving-check">
<img height="20px" src="/static/images/card_payment_sign.png">
等待合规
</label>
</span>
<span class="checkbox-inline"> <span class="checkbox-inline">
<label> <label>
<input type="checkbox" ng-model="params.tempMchId"> 使用通用子商户号 <input type="checkbox" ng-model="params.tempMchId"> 使用通用子商户号

@ -2,14 +2,14 @@ package au.com.royalpay.payment.manage.valid;
import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter; import org.apache.commons.csv.CSVPrinter;
import org.apache.commons.csv.QuoteMode; import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.junit.Test; import org.junit.Test;
import java.io.File; import java.io.File;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
/** /**
* Create by davep at 2019-12-24 15:15 * Create by davep at 2019-12-24 15:15
@ -26,4 +26,11 @@ public class CSVTest {
writer.flush(); writer.flush();
System.out.println(file.getAbsolutePath()); System.out.println(file.getAbsolutePath());
} }
@Test
public void tesat(){
DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy");
String dateStr = formatter.print(new DateTime());
System.err.println(dateStr);
}
} }

Loading…
Cancel
Save