App call App Android SDK
Latest Update
version 2.3.4.jar
-
sdk support specify MPM or CPM payment
CollectionReq.SCAN_TYPE_SCAN
: MPM paymentCollectionReq.SCAN_TYPE_QRCODE
:CPM payment
Setting Method:
CollectionReq req = new CollectionReq(Long.parseLong(money));
req.setScan_type(scan_type);//set scan type,
CollectionReq.SCAN_TYPE_SCAN/CollectionReq.SCAN_TYPE_QRCODE
version 2.3.3.jar
- Transaction add
getOut_trade_no
and getCardscheme method
version 2.3.2.jar Update:
-
Transaction related 1.1 Transaction support passing in
out_trade_no
: 1.2 Support setting card payment(card_payment/unionpay_card/amex_card)wait timeout timewait_card_timeout
(optional),Ifwait_card_timeout
is not set, Default timeout time is 120s, the parameter must be greater than 0, if it is passed in a value less than or equal to 0, the default timeout time is 120s Setting method:CollectionReq req = new CollectionReq(Long.parseLong(money));
req.setWait_card_timeout(wait_card_timeout);//设置刷卡超时时间
req.setOut_trade_no(out_trade_no);//设置外部订单号 -
Query 2.1 Support using
out_trade_no
to query transaction information,order_id
andout_trade_no
must be passed in at least one, or both Setting method:GetTransReq req = new GetTransReq(order_id);
req.setOut_trade_no(out_trade_no);
version 2.3.1.jar
1、app call app sdk support specify payment method when make payment
Using CollectionReq setPay_method
to set specific payment method,if not set specific payment method, or account has not opened specific payment method it will pop up payment method selection box to let self choose
pay_method
field type String
, reference value as follows:
pay_method desc
(1)、card_payment Card payment(master/visa)
(2)、wx WeChat Pay
(3)、alipay Alipay
(4)、payme PayMe
(5)、union UnionPay
(6)、fps FPS
(7)、octopus Octopus
(8)、unionpay_card union card pay
(9)、amex_card amex card pay
2、sdk support set front and back camera
Using CollectionReq setCamera_id
to set front and back camera(optional), default is back camera
camera_id
field type Int
, reference value as follows:
0:CAMERA_PARAM_BACK back camera
1:CAMERA_PARAM_FROT front camera
e.g.
CollectionReq req = new CollectionReq(Long.parseLong(money));
req.setPay_method(current_paymethod);
req.setCamera_id(current_camera);
Introduction
HaoJin is a mobile phone software that provides aggregate collection services for merchants. This document describes the interface calls that HaoJin is open to, and third-party applications can implements the collection function through these interfaces. HaoJin supports below third-party functions:
- Collection, Refund, Query Multiple Transaction Records, Query Transaction Details.
- View Transaction Summary, Query Transaction Channel Configuration.
- Sale/Void/Query/Adjust Endpoints for card.
How to use
Add Permissions
Add the following code to the AndroidManifest.xml file. Note: In order to ensure that you can get permission, please install the haojin application first.
Add Jar Package Dependency
Integrated the qfpay_haojin_api_xxx.jar file in the third party application.
Config Target Application Id
Add Proguard Rule
Add follow code to the proguard-rules.pro file.
Third-party Interface Invoke Sample
Collection
Calling a collection request:
Refund
Calling a refund request:
Parse the return value:
Query Multiple Transaction
Calling a query request:
- Check the supported channels.
- Only support querying of two transaction types (payment, refund)
- Querying by time period has higher priority than querying by month.
- The time format is "yyyy-MM-dd HH:mm:ss"
- The month format is "yyyyMM"
- Split page number starts from one.
Parse the return value:
Query Transaction Details
Calling a query request:
Parse the return value:
View Transaction Summary
Calling a view transaction summary request:
Parse the return value:
Query Transaction Channel Configuration(Deprecated)
This interface has been marked as deprecated and can be replaced with the GetUserConfig interface. See Query User Configuration Information for details.
Calling a Query transaction channel configuration request:
Parse the return value:
Query User Configuration Information
Call a query user configuration information request:
Parse the return value:
Pre-authorization Transaction Deduction
Call a pre-authorization transaction deduction request:
Parse the return value:
Pre-authorization Transaction Cancel
Call pre-authorization transaction cancel request:
Parse the return value:
Pre-authorization Transaction List
Call pre-authorization transaction list request:
Parse the return value:
Pre-authorization Transaction Detail
Call pre-authorization transaction detail request:
Parse the return value:
Card Refund
Calling a refund request:
Parse the return value:
Query Multiple Card Transactions
Calling a query request:
Parse the return value:
Query Card Transaction Details
Calling a query request:
Parse the return value:
Card Adjust
Calling an adjust request:
Parse the return value:
Card Settle
Calling a settle request:
Parse the return value:
Reference
Transaction Information Field Description
Attribute | Type | Mandatory | Description |
---|---|---|---|
id | String | Yes | Transaction idendity number |
amt | Long | Yes | Transaction Amount |
time | String | Yes | Transaction time yyy-MM-dd HH:mm:ss |
channel | String | Yes | Transaction channel like weixin, alipay |
status | Integer | Yes | Transaction status |
type | String | Yes | Transaction type, payment or refund |
originId | String | No | Original transaction id, mandatory if the transaction is refund |
mchntName | String | Yes | Sore name |
remarks | String | No | Transaction remarks |
confirmCode | String | No | Transaction confirmation code |
operatorAccount | String | Yes | Operator name |
appCode | String | No | Application code (swipe card) |
customerId | String | No | Idendity of customer wallet (pre-authorization) |
customerAccount | String | No | Account of customer wallet (pre-authorization) |
completeTransId | String | No | Newly generated transaction id when the pre-authorization transaction is completed (pre-authorization) |
completeTime | String | No | Complete time when the pre-authorization transaction is completed yyyy-MM-dd HH:mm:ss (pre-authorization) |
Channel Information Field Description
Attribute | Type | Mandatory | Description |
---|---|---|---|
name | String | Yes | Channel name |
desc | String | Yes | Channel description |
Transaction Status Field Description
Transaction Status | Description |
---|---|
0 | Normal transaction |
-1/-2 | Waiting for payment |
-3 | Failed |
1 | Reversal |
2 | Void |
3 | Refund |
4 | Partial Refund |
5 | Pre-authorization Frozen |
6 | Pre-authorization Unfrozen |
7 | Pre-authorization Completed |
Result Code Description
Result Code | Description |
---|---|
-1 | Unknown error |
0 | Success |
100 | Client error |
101 | Amount error |
102 | AppId is empty |
103 | Order id is empty |
104 | Other parameter is empty |
105 | User cancel |
106 | Network error |
107 | User not logged in |
108 | Application not installed |
109 | Launch App failed |
110 | Non-support API invoke |
111 | Time period error |
112 | Cross-month query not allowed |
113 | Failed to get config info |
114 | Card adjust failed |
115 | Device does not support card swiping |
116 | Password input error |
200 | Server error |
201 | Order id does not exist |
202 | Transaction Failed |
203 | Insufficient account balance |
204 | Transaction is confirming |
205 | Login status expired |
206 | Refund is confirming |
207 | Refund Failed |