App call App Android SDK
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 |