You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

814 lines
44 KiB

7 years ago
/**
* @apiDefine API API
* API List
*/
/**
* @apiDefine Sign
* @apiParam (QueryParam) {Long} time Required, UTC timestamp in milliseconds
* @apiParam (QueryParam) {String} nonce_str Required, Random string
* @apiParam (QueryParam) {String} sign Required, Sign
*/
/**
* @apiDefine PathVariable Path Variable
*/
/**
* @apiDefine QueryParam Query Params
*/
/**
* @apiDefine JSON JSON keys
*/
/**
* @apiDefine ERROR_CODE Error Code
*/
/**
* @apiDefine GlobalError
* @apiError (ERROR) return_code Error Code
* @apiError (ERROR) return_msg Error Description
* @apiError (ERROR_CODE) SYSTEMERROR Exception inside system
* @apiError (ERROR_CODE) INVALID_SHORT_ID Partner code is invalid or there is no partner associated with this code
* @apiError (ERROR_CODE) SIGN_TIMEOUT Sign expired, the difference between time and the server time is more than 5 minutes
* @apiError (ERROR_CODE) INVALID_SIGN Invalid sign
* @apiError (ERROR_CODE) PARAM_INVALID Parameters are invalid. See return_msg for more details.
* @apiError (ERROR_CODE) NOT_PERMITTED Gateway payment permission has not been enabled for this partner
* @apiError (ERROR_CODE) INVALID_CHANNEL Channel name is not available, check the Capitalize
*
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/exchange_rate Get Current Exchange Rate
* @apiName GetExchange
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription
* 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.
* @apiHeader Accept application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner Code
* @apiUse Sign
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {Double} wechat_rate Exchange rate for WeChat
* @apiSuccess {Double} alipay_retail_rate Exchange rate for Alipay Retail Trade
* @apiSuccess {Double} alipay_online_rate Exchange rate for Alipay Online Trade
*
* @apiUse GlobalError
*/
/**
* @api {PUT} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id} Create QR Code Payment
* @apiName NewQRCode
* @apiGroup QRCode
* @apiVersion 1.0.0
* @apiDescription
* QR Code Payment is used for webpage/application on PC. Customers use WeChat or Alipay app to scan QR Code generated when creating order and finish the payment.<br>
* <img src="img/QRCODE_process_en.png"><br>
* Return value contains QR Code string, QR Ccode image and payment page address. Partners can decide how to finish the payment.
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner Code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. Shall be unique for the same partner. If repeated, order will be recognized as an existing order.
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Description of an order.
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} channel Payment channel
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one.
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} code_url QR Code string. Partners can create the payment QR Code according to this value.
* @apiSuccess {String} qrcode_img QR Code image formatted in Base64. Can be used as the src attribute on img element
* @apiSuccess {String} pay_url Payment page in RoyalPay
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner.
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/pay QR Code Payment Page in RoyalPay
* @apiName QRCodePay
* @apiDescription
* This page mush be called after payment order has been created.
* When jumping back to redirection URL, it is recommended to call the order query API to make sure the payment has succeeded.
* @apiVersion 1.0.0
* @apiGroup QRCode
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. It shall have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when payment succeeded. Contain sign parameters for validation.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/**
* @api {PUT} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id} Create H5 Payment
* @apiName NewMobileH5Pay
* @apiGroup MobileH5
* @apiVersion 1.0.0
* @apiDescription
* <b>WarningH5 Payment socket requires application separately and requires agreement from Tencent. Merchants who needs this socket please contact RoyalPay first.
* Alipay has no limit at the moment.</b><br>
* H5 Payment is used for payment in Webpage or App on mobile outside WeChat or Alipay App. The browser would redirect to a webpage from WeChat or Alipay and call the App to finish the payment.<br>
* Return value contains a payment page. Partners shall guide users to redirect to this page. Sign params are required.
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.<br>
* <img src="img/h5_api_payment.jpg">
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD currency
* @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} channel Payment channel
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id.
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {GET} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id}/pay H5 Payment Page
* @apiName MobileH5Pay
* @apiDescription This page mush be called after payment order has been created.
* When jumping back to redirection URL, it is recommended to call the order query API to make sure the payment has succeeded.
* @apiVersion 1.0.0
* @apiGroup MobileH5
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. It shall have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when payment succeeded. Contain sign parameters for validation.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/**
* @api {PUT} /api/v1.0/wechat_jsapi_gateway/partners/{partner_code}/orders/{order_id} Create JSAPI Payment Order
* @apiName NewJSAPI
* @apiGroup JSApi
* @apiVersion 1.1.0
* @apiDescription
* JSAPI Payment is used to pay in webpage which was opened in WeChat or Alipay App. If customers enter this page from WeChat Official Account, this Official Account is required to be authorized.
* Customers will jump to RoyalPay order page and call WeChat or Alipay Payment Board to finish payment.<br>
* <img src="img/JSAPI_process_en.png"><br>
* Return value contains a payment page. Partners shall guide users to redirect to the page. Sign params is required when redirect happens.
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD currency
* @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} channel Payment Channel
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay. Can only be accessed through WeChat
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {GET} /api/v1.0/wechat_jsapi_gateway/partners/{partner_code}_order_{order_id} WeChat JSAPI Payment Page in RoyalPay
* @apiName WxJSAPIPay
* @apiDescription This page must be called after Payment Order has been created. Actural url shall be according to pay_url param from order creation
* @apiVersion 1.0.0
* @apiGroup JSApi
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. Must have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when the payment succeeded
* @apiParam (QueryParam) {Boolean=true,false} directpay='false' whether open direct pay mode.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/**
* @api {GET} /api/v1.0/gateway/alipay/partners/{partner_code}/orders/{order_id}/app_pay Alipay JSAPI Payment Page in RoyalPay
* @apiName AliJSAPIPay
* @apiDescription This page must be called after Payment Order has been created. Actural url shall be according to pay_url param from order creation
* @apiVersion 1.0.0
* @apiGroup JSApi
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. Must have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when the payment succeeded
* @apiParam (QueryParam) {Boolean=true,false} directpay='false' whether open direct pay mode.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/**
* @api {PUT} /api/v1.0/micropay/partners/{partner_code}/orders/{order_id} Create Retail Passive Payment Order
* @apiName RetailMicroPay
* @apiDescription
* 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<br>
* <img src="img/Retail_en.png">
* @apiVersion 1.0.2
* @apiGroup RetailPay
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD currency
* @apiParam (JSON) {String} device_id Required, ID of the device which sends the request
* @apiParam (JSON) {String} auth_code Required, The Payment QR Code scanned from customer's WeChat Wallet.
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code Order status
* <ul>
* <li>PAYING:Waiting for payment</li>
* <li>CREATE_FAIL:Fail to create order</li>
* <li>CLOSED:Order closed</li>
* <li>PAY_FAIL:Payment failed</li>
* <li>PAY_SUCCESS:Payment succeeded</li>
* </ul>
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id.
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {int} total_fee Order amount, which uses the base unit of current currency
* @apiSuccess {int} real_fee Actual paid amount.(The same as total fee at the moment. After coupon feature is finished, this may be different.)
* @apiSuccess {String} pay_time Time when order is paid(yyyy-MM-dd HH:mm:ss, UTC+10)
* @apiSuccess {String} create_time Time when order is created(according to the latest order)(yyyy-MM-dd HH:mm:ss, UTC+10)
* @apiSuccess {String} currency Currency. Default value is AUD.
* @apiSuccess {String} channel Currency. Channel. Alipay,Wechat,Bestpay.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order ID does not belongs to current partner.
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
* @apiError (ERROR_CODE) AUTHCODEEXPIRE QR Code expired
* @apiError (ERROR_CODE) NOTENOUGH The customer does not have enough balance to finish the payment
* @apiError (ERROR_CODE) NOTSUPORTCARD Card type is not supported
* @apiError (ERROR_CODE) AUTH_CODE_ERROR Payment QR Code has been used twice
* @apiError (ERROR_CODE) AUTH_CODE_INVALID The submitted QR Code is not a WeChat Payment QR Code
*/
/**
* @api {PUT} /api/v1.0/retail_qrcode/partners/{partner_code}/orders/{order_id} Create Retail Active Payment Order
* @apiName RetailQRCode
* @apiGroup RetailPay
* @apiVersion 1.0.2
* @apiDescription
* 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 and Bestpay<br>
* <img src="img/RetailQR_en.png"><br>
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner Code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. Shall be unique for the same partner. If repeated, order will be recognized as an existed order.
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Description of order.
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String} device_id Required, ID of the device which sends the request.
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} code_url QR Code string. Partners can create the payment QR Code according to this value.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner.
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id} Query Order Status
* @apiName OrderStatus
* @apiGroup CommonApi
* @apiVersion 1.0.1
* @apiDescription Including QR Code orders, JSAPI orders and Retail orders
* @apiHeader Accept application/json
*
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code
* <ul>
* <li>PAYING: Waiting for payment</li>
* <li>CREATE_FAIL: Fail to create order</li>
* <li>CLOSED: Order closed</li>
* <li>PAY_FAIL: Payment failed</li>
* <li>PAY_SUCCESS: Payment succeeded</li>
* <li>PARTIAL_REFUND: Partial refunded</li>
* <li>Full_REFUND: Full refunded</li>
* </ul>
* Use the same order id to call create order API can renew the order. PAYING, PAY_SUCCESS orders cannot be renewed.
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {int} total_fee Order amount, which uses the base unit of current currency
* @apiSuccess {int} real_fee Actual paid amount.(Equal to total fee at the moment. After coupon feature is finished, this value may be different. )
* @apiSuccess {Double} rate Exchange Rate used while trading. 1AUD=?CNY
* @apiSuccess {String} pay_time Time when order is paid(yyyy-MM-dd HH:mm:ss, UTC+10)
* @apiSuccess {String} create_time Time when order is created(according to the latest order)(yyyy-MM-dd HH:mm:ss, UTC+10)
* @apiSuccess {String} currency Currency. Default value is AUD.
* @apiSuccess {String} channel Channel. Alipay,Wechat,Bestpay.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*
*/
/**
* @api {PUT} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/refunds/{refund_id} Apply for Refund
* @apiName RefundOrder
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiDescription
* 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.
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner payment order id
* @apiParam (PathVariable) {String} refund_id Required, Partner refund order id
* @apiUse Sign
* @apiParam (JSON) {int} fee Required, Refund amount. Use base unit of the currency. Total amount of all refund orders must be less than actual paid amount.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code
* <ul>
* <li>WAITING: Order is being submitted to WeChat</li>
* <li>CREATE_FAILED: Fail to submit to WeChat</li>
* <li>SUCCESS: Submission succeeded</li>
* <li>FAILED: Refund failed</li>
* <li>FINISHED: Refund success(funds has already been returned to user's account)</li>
* <li>CHANGE: Refund can not return to user's account. Manual operation is required</li>
* </ul>
* @apiSuccess {String} refund_id RoyalPay Refund id
* @apiSuccess {String} partner_refund_id Partner refund id
* @apiSuccess {int} amount Refund amount
* @apiSuccess {String} currency Refund currency
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Payment order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Payment order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_NOT_PAID Payment order is not paid
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/refunds/{refund_id} Query Refund Order Status
* @apiName RefundQuery
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
*
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner payment order id
* @apiParam (PathVariable) {String} refund_id Required, Partner refund order id
* @apiUse Sign
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code
* <ul>
* <li>WAITING: Order is being submitted to WeChat</li>
* <li>CREATE_FAILED: Fail to submit to WeChat</li>
* <li>SUCCESS: Submission succeeded</li>
* <li>FAILED: Refund failed</li>
* <li>FINISHED: Refund succeeded(funds have already been returned to user's account)</li>
* <li>CHANGE: Refund can not return to user's account. Manual operation is required</li>
* </ul>
* @apiSuccess {String} refund_id RoyalPay Refund id
* @apiSuccess {String} partner_refund_id Partner refund id
* @apiSuccess {int} amount refund Amount
* @apiSuccess {String} currency Refund currency
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Payment order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Payment order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_NOT_PAID Payment order is not paid
* @apiError (ERROR_CODE) REFUND_NOT_EXIST Refund order does not exist
* @apiError (ERROR_CODE) REFUND_MISMATCH Refund order is not belong to this payment order
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders Check Orders
* @apiName ListOrder
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription
* Get a list of orders. This api may change in the future.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiUse Sign
* @apiParam (QueryParam) {String} date Payment order creation date,which is formatted in 'yyyyMMdd' ,UTC+10. Query all orders if not provided
* @apiParam (QueryParam) {String='ALL','PAID','REFUNDED'} status='ALL'
* Order status
* <ul>
* <li>ALL: All orders, including orders not paid and closed</li>
* <li>PAID: Only paid orders. including orders which have refunds.</li>
* <li>REFUNDED: Only orders which have refunds</li>
* </ul>
* @apiParam (QueryParam) {int} page=1 Page number. start with 1
* @apiParam (QueryParam) {int} limit=10 Rows per page
*
* @apiSuccess (ROOT) {String} return_code Execution result
* @apiSuccess (ROOT) {JSON[]} data Orders list
* @apiSuccess (ROOT) {JSON} pagination Pagination information
* @apiSuccess (ROOT) {JSON} analysis Payment analysis
*
* @apiSuccess (data) {String} order_id RoyalPay Order ID
* @apiSuccess (data) {String} partner_order_id Partner Order ID
* @apiSuccess (data) {int} total_fee Order amount
* @apiSuccess (data) {int} real_fee Actual paid amount
* @apiSuccess (data) {String} payment via channel: Alipay, Bestpay, Wechat
* @apiSuccess (data) {String} currency Currency
* @apiSuccess (data) {String} create_time Time when order is created, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10
* @apiSuccess (data) {String} pay_time Time when order is paid, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10. will be null if not paid
* @apiSuccess (data) {String} status
* order status
* <ul>
* <li>SUBMITTING: Submitting to wechat</li>
* <li>SUBMIT_FAIL: Submission failed</li>
* <li>WAITING_PAYMENT: Submission succeeded and wait for payment</li>
* <li>CLOSED: Order closed</li>
* <li>PAYMENT_FAIL: Payment failed</li>
* <li>SUCCESS: Payment succeeded</li>
* <li>PARTIAL_REFUND: Partial Refunded</li>
* <li>FULL_REFUND: Full Refunded</li>
* </ul>
* @apiSuccess (data) {String} order_body Order description
* @apiSuccess (data) {String} gateway
* <ul>
* <li>Retail In-Store: Paid from official EFTPos or App</li>
* <li>QRCODE: Paid from merchant static QR Code</li>
* <li>Online API: Paid from QR Code API<li>
* <li>WeChat HTML5: Paid from JSAPI</li>
* <li>Retail API: Paid from Retail API</li>
* <li>Mobile H5: Paid from H5 Api</li>
* </ul>
* @apiSuccess (data) {String} partner_code Partner code
* @apiSuccess (data) {String} partner_name Partner name
* @apiSuccess (data) {String} refund_fee Total refund amount of this order
*
* @apiSuccess (pagination) {int} page Page number,start with 1
* @apiSuccess (pagination) {int} limit Rows per page
* @apiSuccess (pagination) {int} totalCount Total rows
* @apiSuccess (pagination) {int} totalPages Total pages
*
* @apiSuccess (analysis) {int} order_count Order count of successful payment (including orders which have refunds)
* @apiSuccess (analysis) {int} total_fee Total amount
* @apiSuccess (analysis) {int} real_fee Actual paid amount
*
* @apiUse GlobalError
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/transactions Query Daily Transactions
* @apiName ListTransaction
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription 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.<br>
* <b>Notice: A payment order or refund order can contains several transaction records</b>
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiUse Sign
* @apiParam (QueryParam) {String} date Required, Transaction date. Format as 'yyyyMMdd'GMT+10
*
* @apiSuccess (ROOT) {String} return_code Execution result,SUCCESS
* @apiSuccess (ROOT) {String} result_code Process result
* @apiSuccess (ROOT) {int} transaction_count transaction record count
* @apiSuccess (ROOT) {int} order_count payment order count
* @apiSuccess (ROOT) {int} refund_count refund order count
* @apiSuccess (ROOT) {JSON[]} transactions transaction list
*
* @apiSuccess (transactions) {String} transaction_time Trade time, format as yyyyMMddHHmmssGMT+10
* @apiSuccess (transactions) {String} order_id RoyalPay Order ID
* @apiSuccess (transactions) {String} partner_order_id Partner Order ID
* @apiSuccess (transactions) {String} channel_order_id Order ID in payment channel (Alipay/Bestpay/Wechat)
* @apiSuccess (transactions) {String} refund_id RoyalPay Refund ID (Only in refunds or refunds failure cashback)
* @apiSuccess (transactions) {String} partner_refund_id Partner refund ID (Only in refunds or refunds failure cashback)
* @apiSuccess (transactions) {String} gateway Payment method
* <ul>
* <li>0: RoyalPay EftPOS Payment Code (Scan Payment Code displaying in customer's device)</li>
* <li>1: RoyalPay EftPOS Order Code (Customer scan QR Code displaying on POS screen)</li>
* <li>2: RoyalPay Static Merchant QRCode</li>
* <li>3: QRCode Gateway</li>
* <li>4: JSAPI Gateway</li>
* <li>5: Gateway for third-party EftPOS Payment Code</li>
* <li>6: Gateway for third-party EftPOS Order Code</li>
* <li>7: RoyalPay Static Merchant QRCode(deprecated)</li>
* <li>8: H5 Payment Gateway</li>
* </ul>
* @apiSuccess (transactions) {String} channel Payment Channel (Alipay, Wechat, Bestpay)
* @apiSuccess (transactions) {String} type Trade Direction
* <ul>
* <li>Credit: Income</li>
* <li>Debit: Outcome</li>
* </ul>
* @apiSuccess (transactions) {String} currency currency(AUD/CNY)
* @apiSuccess (transactions) {int} total_amount Total payment amount, which uses the base unit of order currency
* @apiSuccess (transactions) {int} input_amount Order input amount, which uses the base unit of order currency
* @apiSuccess (transactions) {int} settle_amount Settle amount, AUD cents
* @apiSuccess (transactions) {double} exchange_rate Using exchange rate
* @apiSuccess (transactions) {String} remark Remark
*
* @apiUse GlobalError
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/transactions Query Settlement Details
* @apiName SettleLog
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription 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.<br>
* <b>Notice: A payment order or refund order can contains several transaction records</b>
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiUse Sign
* @apiParam (QueryParam) {String} date Required, Transaction date. Format as 'yyyyMMdd'GMT+10
*
* @apiSuccess (ROOT) {String} return_code Execution result,SUCCESS
* @apiSuccess (ROOT) {String} result_code Process result
* @apiSuccess (ROOT) {String} settle_from Transaction date from,yyyyMMdd
* @apiSuccess (ROOT) {String} settle_to Transaction date to, yyyyMMdd
* @apiSuccess (ROOT) {String} settle_days Settle delay(T+n)
* @apiSuccess (ROOT) {int} transaction_count transaction record count
* @apiSuccess (ROOT) {int} order_count payment order count
* @apiSuccess (ROOT) {int} refund_count refund order count
* @apiSuccess (ROOT) {int} total_credit Total credit amount (AUD cent)
* @apiSuccess (ROOT) {int} total_debit Total debit amount (AUD cent)
* @apiSuccess (ROOT) {int} total_surcharge Total surcharge amount(AUD cent)
* @apiSuccess (ROOT) {int} total_transfer Total amount sending to merchant's bank account(AUD cent)
* @apiSuccess (ROOT) {JSON[]} transactions transaction list
*
* @apiSuccess (transactions) {String} transaction_time Trade time, format as yyyyMMddHHmmssGMT+10
* @apiSuccess (transactions) {String} order_id RoyalPay Order ID
* @apiSuccess (transactions) {String} partner_order_id Partner Order ID
* @apiSuccess (transactions) {String} channel_order_id Order ID in payment channel (Alipay/Bestpay/Wechat)
* @apiSuccess (transactions) {String} refund_id RoyalPay Refund ID (Only in refunds or refunds failure cashback)
* @apiSuccess (transactions) {String} partner_refund_id Partner refund ID (Only in refunds or refunds failure cashback)
* @apiSuccess (transactions) {String} gateway Payment method
* <ul>
* <li>0: RoyalPay EftPOS Payment Code (Scan Payment Code displaying in customer's device)</li>
* <li>1: RoyalPay EftPOS Order Code (Customer scan QR Code displaying on POS screen)</li>
* <li>2: RoyalPay Static Merchant QRCode</li>
* <li>3: QRCode Gateway</li>
* <li>4: JSAPI Gateway</li>
* <li>5: Gateway for third-party EftPOS Payment Code</li>
* <li>6: Gateway for third-party EftPOS Order Code</li>
* <li>7: RoyalPay Static Merchant QRCode(deprecated)</li>
* <li>8: H5 Payment Gateway</li>
* </ul>
* @apiSuccess (transactions) {String} channel Payment Channel (Alipay, Wechat, Bestpay)
* @apiSuccess (transactions) {String} type Trade Direction
* <ul>
* <li>Credit: Income</li>
* <li>Debit: Outcome</li>
* </ul>
* @apiSuccess (transactions) {String} currency currency(AUD/CNY)
* @apiSuccess (transactions) {int} total_amount Total payment amount, which uses the base unit of order currency
* @apiSuccess (transactions) {int} input_amount Order input amount, which uses the base unit of order currency
* @apiSuccess (transactions) {int} settle_amount Amount to make settlement, AUD cents
* @apiSuccess (transactions) {String} surcharge_rate Rate of surcharge (x%)
* @apiSuccess (transactions) {int} surcharge Surcharge amount, AUD cents
* @apiSuccess (transactions) {int} transfer_amount Amount send to merchant's bank account, AUD cents
* @apiSuccess (transactions) {double} exchange_rate Using exchange rate
* @apiSuccess (transactions) {String} remark Remark
*
* @apiUse GlobalError
*/
/**
* @api {POST} /notify_url Payment Success Notice
* @apiName PayNotice
* @apiGroup API
* @apiVersion 1.0.0
* @apiDescription
* If notify_url is provided when order is created. System will post request to this url when the payment succeeds. Request method is POST.
* Different from Server APIs, sign parameters will be included in json entity. 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.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (JSON) {long} time UTC timestamp in millis
* @apiParam (JSON) {String} nonce_str Random string
* @apiParam (JSON) {String} sign Sign
* @apiParam (JSON) {String} partner_order_id Partner order id
* @apiParam (JSON) {String} order_id RoyalPay order id
* @apiParam (JSON) {int} total_fee Order amount
* @apiParam (JSON) {int} real_fee Actual paid amount
* @apiParam (JSON) {Double} rate Exchange Rate used while trading. 1AUD=?CNY
* @apiParam (JSON) {String} currency Currency,AUD
* @apiParam (JSON) {String} channel Payment Channel AlipayWechatBestpay
* @apiParam (JSON) {String} create_time Time when order is created, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10
* @apiParam (JSON) {String} pay_time Time when order is paid, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10.
*
* @apiSuccess {String} return_code SUCCESS
*/
/**
* @api {PUT} /api/v1.0/jd_gateway/partners/{partner_code}/orders/{order_id} Create JD Payment Order
* @apiName JDPAY
* @apiDescription
* Use for JD Payment in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param.
* Then enter JD Pay page to finish payment.<br>
* JD Channel Only.<br>
* <img src="img/jd_en.png">
* @apiVersion 1.0.0
* @apiGroup JD_Online_Payment
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {String} user_id RequiredOnly account number of the user on the merchant platform
* @apiParam (JSON) {String} mobile RequiredMobile phone
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency (cent).
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay. Can only be accessed through WeChat
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
7 years ago
/**
* @api {PUT} /api/v1.0/gateway/partners/{partner_code}/microapp_orders/{order_id} Create Miniprogram Order
* @apiName microapp
* @apiDescription
Use for wechat Payment in miniprogram. After create order, returned and redirect param.
7 years ago
* wechat Channel Only.<br> * <br>
* <a href="https://www.royalpay.com.au/downloads/MiniProgram_WechatPay.pdf"> MiniProgram_WechatPay doc</a>
7 years ago
* <img src="img/microapp_en.png">
* @apiVersion 1.0.0
7 years ago
* @apiGroup Miniprogram_Payment
7 years ago
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
7 years ago
* @apiParam (JSON) {String} appid wechat app app_id
* @apiParam (JSON) {String} customer_id wechat app open_id
7 years ago
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay. Can only be accessed through WeChat
* @apiSuccess {String} sdk_params The required parameters for payment.(Json String)
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
7 years ago
/**
* @api {PUT} /api/v1.0/alipay/partners/{partner_code}/orders/{order_id} Create Alipay Online Order
* @apiName AlipayOnline
* @apiDescription
* 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.<br>
* Alipay Channel Only.<br>
* <img src="img/alipayOnline_en.png">
* @apiVersion 1.0.0
* @apiGroup Alipay_Online_Payment
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay. Can only be accessed through WeChat
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {PUT} /api/v1.0/alipay/partners/{partner_code}/app_orders/{order_id} 创建支付宝SDK订单
* @apiName AlipaySDK
* @apiDescription
* Used for mobile Apps calling Alipay payment with Alipay 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 Alipay app
* <b>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.</b><br>
* <img src="img/sdk_api_payment.jpg"><br>
* More information for integration with Alipay: <a href="https://global.alipay.com/service/app_split/6">Alipay SDK Document</a><br>
* <a href="resources/api/alipaySdk-20160825.jar">SDK for Android</a><br>
* <a href="resources/api/AlipaySDKForiOS.zip">SDK for iOS</a>
* @apiVersion 1.0.0
* @apiGroup SDKPayment
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
* @apiParam (JSON) {String=android,iphone,ipad} system os type of client app, optional
* @apiParam (JSON) {String} version client app version, optional
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} sdk_params param string for calling SDK
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
function apis() {
}