Payment of Scan Code payment development: The pits and solutions I encountered (attached: Ecshop payment plugin)
Some time ago to help a friend based on the Ecshop development of the Mall to join the scan payment function, this thought is very simple thing--Download the official SDK or development help document, according to the inside of do OK, behold toss two or three days of time to calculate, in the middle also with questions on the internet to find a lot of technical articles, But found all just a relatively sketchy write how they develop access, and did not solve the problems I encountered ..., alas, sometimes the real feeling ' only on their own '. This article is to want to put their own problems and solutions to write, so that the development of this area of the friend has helped!
Before development, review the official "Scan code Payment" Development document, scan code payment is divided into the following two modes:
△ mode one:
Problems encountered: The first scan of the QR code can also be normal scan, unpaid re-scan will prompt: OK or request merchant Information Timeout Httpcode non---This problem try to find a solution through a variety of ways have no effect, here want to know friends can give and answer, thank you!
△ mode two:
Note: can not directly use the mall's order number as a trade order number (OUT_TRADE_NO), or else to generate a scan code to pay the QR code, the interface will prompt: The merchant order number is duplicated , cannot be regenerated.
So Jiangzi question, how to set the trade order number, but also to ensure that the subsequent interface to query the merchant platform for the corresponding order information or to achieve reconciliation? The feasible way is: before sweeping the unified next single interface, out_trade_no do not pass the order number of the mall order system, but regenerate a new unique water, and then add an order number and payment transaction order number (OUT_TRADE_NO) corresponding table, as follows:
There is a Serial_is_paid field in the table above: used to mark whether this transaction has been completed, that is: in the payment success notification callback processing, according to the return of the Out_trade_no update payment status, as to how to check the status of the order payment, presumably you should also know ...
Well, a long time did not write technical blog some can not find the feeling, writing may be relatively sketchy, have not clear friends to pay attention to & exchange!
Reference website >>
Ecshop Payment plugin. rar
My subscription number:Zxcknowmore, your concern and support is my motivation to write more blog posts!