For IAP and DLC products, QIYU platform will return the related result and uid to application server as data flow after the user complete to make a payment. Developers need to deal with those data and return the appropriate response.
Query Type
QIYU developer Portal will send payment result as POST to the address which recorded on the developer Portal (notify_url).
When calling the interface, the parameters need to be signed to verify the integrity of the data. The method is as follows:
Parameters name (except signature and the method of signature): please sorting the parameters by letters (A-Z) , and using "|" to combine them together: key 1=value 1|key 2=value 2|key =value n
For example, there are three parameters: foo=1,bar=2,nav=3, it should be sorted like: bar=2|foo=1|nav=3
Please set the xxx (xxx is the API key of the application) at the end of string, and then use MD5 to encode the string and transfer the string to lowercase: String sign = MD5Encode("bar=2|foo=1|nav=3|xxx", "utf-8").toLowerCase().
Return
If successfully receive the message, please return "success", otherwise, return "fail".
Worth to know
Same message might send to developer many times, developers should deal with those duplicate messages.
If QIYU platform receives the response that does not meet the specification or times out, the platform will will determine that the notification fails and resend the notification until success. (QIYU platform will send multiple notifications in 5 times total (will be stopped when the notification is success to send out) with the rate 5s / 30s / 2min / 4min / 6min).
When the order status is unknown or the game does not received the result notification from QIYU platform, we suggest developer call the QueryOrderResult API to check the result of the order.
Developer should sign the result of payment, and authenticate the signature to avoid the man-in middle attack or fake notifications, which might cause the economic loss.
When receiving a notification for processing, firstly, it should check the status of the notification whether it has been processed or not. If it has been processed, it will directly return the result of success. Before checking and processing the status, data lock should be used for concurrency control to avoid data confusion when function reentry.