更新日期:2023-11-17QuickSDK Server Connect Document
l The API is started from game sever to SDK sever
l The main function of this API is that the game sever verifies the users' information for SDK server via token.
l SDK client will inform Game client about token values /Game client will get the token value through SDK client
l Succeed to return 1
l The UID is exclusive for the same market, or may repetitive for the others/different markets, that's why Game sever must combine market ID with market UID to comfirm the identity of game character
ADD:http://checkuser.quickapi.net/v2/checkUserInfo
GET/POST
Parameter Name
Importance
Data Type
Explanation
token
Always
string
Game client can get token value from SDK client, and the token value can be transferred to Game sever without decoding. The length of this token value is less , or equal, than 512, we suggest developers to reserve enough space for that.
uid
Always
string
You can obtain the original UID of market from client API without any additional operations.
product_code
Optional
String
You can get this product code value by viewing game information from the Quick background
channel_code
Optional
String
Passing in this value will verify whether the uid and token match the channel_ code is consistent. If there is an account transfer between player channels during the game operation process, it should be ensured that this value is correct (this interface is the channel type interface in the client document)
NOTE : There is only one UID for the same market, and developers can obtain the original UID from QuickSDK API .It may exists the same UID for different markets (i.g: UID '1' may be the user of Baidu &UC for the same time)
That's why we need to combine market ID with market UID to confirm the only identity of Game user.
i.g: market ID@market UID, market ID|market UID, market ID_ market UID etc.)
Returning result is plain string
i.g:1
Beside 1,all other value represent failure/There's no other value can represent successed except 1. It represents failure except string 1. Only plain string 1 represent success.
http://checkuser.quickapi.net/v2/checkUserInfo?token?token=@178@83@173@158@157@88@108@86@118@98@117@107@105@106@108@99@104@120@108@103@112@123@125@106@96@101@104@110@104@115@105@101@169@187@175@156@163@183@152@164@101@155@134@217@160@158@157@87@115@103@102@105@101@99@105@99@99@110@105@92@85@154@157@152@165@163@158@163@121@151@90@112@90@100@102@87@157@151@219@196@217@215@134@165@121@163@225&uid=D2A864635A709FD302080B508FF98D49&product_code=64345624204336603757759703868145
Payment decryption process: (CallbackKey is used to decode the ciphertext of the notification; Md5Key is used to verify the signature)
The final amount of items distributed in the game should be based on the amount
1. Received callback parameters (nt_data, sign, md5Sign)
2. Calculate md5 (nt_data+sign+md5key) to obtain the signature (md5key obtained in the quick background), which is consistent with the received md5Sign, and the signature passes
3. Use callbackkey to decrypt nt_ Data
4. After successful decryption, the game distributes items according to the amount in the notification XML
Calculate signature as nt_data is concatenated with the value of sign, and then concatenated with md5key to calculate md5. The calculated result is compared with md5Sign in POST
l Developers need to fill their goods url in QuickSDK background->parameter configuration->synchronizing address.
l QuickSDK need to send back the postback parameter in xml type via http post.
l Developers reading and analyzing QuickSDK POST data , then writing/coding in their game systems/own database.
l All parameter values need to be encrypted or decoded in algorithm of Chapter 3.
l Synchronous notification will inform developers about the recharge source/which market of this recharge come from(i.g 360Game center, 91 game).
l While the recharge order is synchronously completed, Developers need to double check the order in case reprocessing. And send SUCCESS to QuickSDK once it succeed.(Only these 7 pure strings can be returned without any other characters)
l The response speed of the distribution tool interface should be within 5 seconds. The slower the response of the distribution interface, the lower the frequency of QuickSDK sending notifications to this interface
Note: During the parent package payment process, the "Payment Success" and "Payment Failure" options that pop up after the client clicks are only used to send client notifications. The server sends notifications based on whether to use the test account created here and whether the account balance is sufficient.
QuickSDK sever will send these parameters to developers in 'http post':
Parameter Name
Data Type
Instruction
nt_data
string
The notification data is decoded into XML format, as detailed in 2.1.1
sign
string
signature string, please refer to Chapter 3 for details
md5Sign
string
The calculation method is MD5 (nt_data+sign+md5key), and the three values can be directly concatenated
Parameters will be transferred by decoding method which is mentioned in Chapter Developers can get the plain text XML in 2.1.1 by decoding these parameters.
Parameter Name
Data Type
Importance Level
Instruction
is_test
string
Always
1 stands for test order, 0 stands for official order. Developers shall pay goods to consumers according to the result
channel
string
Always
Market ID NOTE: Developers could choose to test whether the payment notification data channel is different from the character's registered channel. If it is not the same channel, developers can refuse to pay the goods. Developers do this test depend on the specific situation
channel_uid
string
Always
Market user identification, you can get this value from client GetUserId()
game_order
string
Always
Game clients call payment function in QuickSDK lib can set this params , and it will send to Game Server when this order has pay
order_no
string
Always
The exclusive/official order number of QuickSDK
pay_time
string
Always
Pay time 2015-01-01 23:00:00
amount
string
Always
The transaction amount, in yuan, should be based on the final amount of items distributed in the game
status
string
Always
Recharge status ,0 stands for success, 1 stands for fail.( It should return FAILED when it is 1)
extras_params
string
Always
If the game client orders with such extras_params , extras_params of this order function will return as it is; if not, the return is empty
l Filed :md5Sign。
l Caculating the received original ciphertext
l nt_data、sign、md5Sign will. be received by callback API.
l Developers can obtain the current md5SignLocal via function: md5(nt_data+sign+md5key)
l Developers can judge the result by testing the consistency of Local calculating md5SignLocal with received md5Sign.
l md5Key can be assigned and obtained from QuickSDK.
Cryptographic algorithm
Details in Appendix 1
Decipherment algorithm
Details in Appendix 1
Assume that these are the callback parameters that developers have received from QuickSDK:
nt_data=@116@119@168@161@165@88@170@153@167@170@161@163@166@113@87@99@94@102@83@85@153@166@154@164@155@157@166@152@114@90@140@135@126@101@104@86@89@171@168@149@163@155@153@160@167@162@154@111@82@164@160@87@115@118@115@168@162@173@165@160@164@166@170@146@165@157@163@167@154@159@153@114@113@164@157@167@171@149@156@151@110@114@154@168@147@172@156@168@171@114@104@109@100@161@170@146@172@157@163@168@119@116@151@156@150@165@166@153@164@114@109@106@104@110@109@100@151@160@152@163@165@153@164@111@113@155@159@148@166@166@149@160@152@173@157@152@115@105@107@101@112@104@106@110@95@153@153@150@162@166@156@161@150@169@161@149@115@116@158@148@165@157@143@163@171@156@153@166@115@104@106@103@108@105@107@105@104@111@109@100@155@153@164@154@150@163@170@149@154@170@117@111@167@170@148@153@171@151@162@163@115@104@106@105@106@100@102@104@96@108@98@103@101@105@107@103@105@100@108@101@102@105@109@107@108@107@99@112@104@167@166@152@154@169@151@162@167@114@113@162@145@175@144@169@157@165@156@115@105@100@105@103@98@104@109@96@105@106@80@101@106@114@104@102@111@105@104@112@103@164@150@171@143@170@154@162@153@118@115@150@164@163@173@159@169@118@104@97@104@104@108@99@154@165@163@169@163@171@118@112@171@168@150@166@165@169@111@101@112@103@170@169@152@168@173@164@115@116@156@171@172@170@145@167@152@168@149@166@150@164@171@114@179@101@178@145@171@104@174@113@99@157@175@169@169@149@171@144@165@153@169@148@165@171@110@112@104@165@153@167@168@152@159@153@118@112@100@165@155@175@158@164@163@166@170@148@164@153@171@164@150@159@156@113&sign=@106@154@147@150@154@155@153@150@151@157@106@103@153@101@110@107@150@104@103@150@104@155@152@154@109@109@158@101@109@111@156@99&md5Sign=c644c134144555807c228bd439f8264d
a) Game sever should test the validity of signature right after receiving these 3 datas:
Computing md5(nt_data+sign+md5key) to get c644c134144555807c228bd439f8264d,if the result is same as the received md5Sign, the signature is successful.
b) According to the method of Appendix 1, you can get the xml by decoding nt_data
0 8888 231845 123456789 12520160612114220441168433 2016-06-12 11:42:20 1.00 0 {1}_{2}
c) Developers will pay the payable goods according to the accurate amount as XML notified, if decryption is successful.
For some unexpected/unpredicted reasons/situations, QuickSDK sever will not be able to receive SUCCESS . QuickSDK sever will send notification again. And it/QuickSDK sever will persistently sending a new notification to Game sever in certain time
There will be an Error to remind that the order is failed(return value is not SUCCESS):SignError、AmountError
It should be noted that when a game accumulates a large number of errors and returns, the system will reduce the frequency of replenishment for this game, and game developers need to develop and distribute prop interfaces correctly.
public static String encode(String src,String key) { try { byte[] data = src.getBytes(charset); byte[] keys = key.getBytes(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < data.length; i++) { int n = (0xff & data[i]) + (0xff & keys[i % keys.length]); sb.append("@" + n); } return sb.toString(); }catch (UnsupportedEncodingException e){ e.printStackTrace(); } return src; }
public static String decode(String src,String key) { if(src == null || src.length() == 0){ return src; } Matcher m = pattern.matcher(src); List list = new ArrayList(); while (m.find()) { try { String group = m.group(); list.add(Integer.valueOf(group)); } catch (Exception e) { e.printStackTrace(); return src; } } if (list.size() > 0) { try { byte[] data = new byte[list.size()]; byte[] keys = key.getBytes(); for (int i = 0; i < data.length; i++) { data[i] = (byte) (list.get(i) - (0xff & keys[i % keys.length])); } return new String(data, charset); } catch (UnsupportedEncodingException e){ e.printStackTrace(); } return src; } else { return src; } }
The key for encryption or decryption is the callbackkey which was agreed by QuickSDK sever and Game sever ,at beginning. This value can obtain by QuickSDK console,( log in www.quicksdk.com) →choose(the correct product) →click (parameter configuration)
You can get the QuickSDK server access document on the website's download center/ QuickSDK server access document is available on the website's download center, including C#、C++、Java、PHP
李先生:13880511661
QQ:48157910
赵先生:15390049857
QQ:1077535763
孙女士:13551010407
QQ:1799614139
QQ群:698731538