Closed thedmd closed 10 years ago
The orderNo is the transaction identifier actually. We're involved in a distributed transaction when you issue a payment request. It's the initiator of the transaction(here, you) that should generate the transaction identifier if there' no central transaction manager. And the identifier must be unique globally in our system to prevent all race conditions.
For example, the payment could be failed at client due to network timeout. The request may suspend in our server: the thread which is processing the request is suspended in our system. So if you query for the order immediately, the result is "no such order". For this case, you may re-send it to us again and the request is finished finally. Until now, the suspended thread go! Here we must use your unique orderNo to figure out that the order has been processed before. Otherwise users may pay twice!
The orderNo must be persisted before sending to us. And persisting in your server is preferred.
Please use your partnerId
as the prefix of the orderNo
. The subsequent string must be unique in all of your requests.
I didn't know partnerId must be a prefix of orderId. I will use it that way.
In demo application we can read orderId is a string which size should be 12 to 20. Is this correct or maybe there are some extra character I can utilize?
Sorry for the misleading requirement. Let me fix it:
The orderNo(including the prefix) has 30 characters at most.
I'll fix the demo soon.
Thank you.
I need to create consumables so one purchase button each time will try to purchase new item. Apparently one orderNo can be used only once, in that case how can I implement repetitive purchases? Should I increase orderNo after each payment? Is orderNo assigned to only my telephone number so it will not collide with another device?