Parsing Wechat Payments

Although the 3rd party payments market in China is extremely vast, any phone manufacturer, every mobile operator has their e-wallets, and there are dozens of names in their ratings, it is no exaggeration to say that considering electronic payment systems, you can limit yourself to two companies - Tencent and Alibaba . According to 3mbang, in 2018, Alipeu owned 52.5% of the market in mobile payments, and Tensent - 36.7% (according to the number of transactions using mobile terminals). If we consider not only telephones, but also all electronic devices, then the statistics look a little different - 44.5% for Alipey and 30.3% for Tensent. In any case, with the thought “I need to connect electronic payments”, any novice (or advanced) entrepreneur will have these two names in his head. And in 99% of cases this is enough - whether it is about opening an IP for trading in shoes, a noodle tray on the street or a serious site with millions of visitors. All other payments - yes, they are desirable, they have their advantages, but the basic set is these two. We will consider them in detail.



Naturally, the topic is too extensive. And since over the years both networks have grown to the scale of huge, independent and system-forming products (at least the fact that on the basis of Wechat - the messenger-processor, which is the main tool for payments through Tencent - through the wallet, speaks about their importance for the existence of the state Wechat in some regions launched a test of electronic identity cards, we won’t be able to grasp the immensity.Each network has overgrown with hundreds of related services - from food delivery and sale of discount coupons to investment platforms and a credit history bureau.We will consider all this from the point of view of a novice businessman who realized that without electronic payments he is doomed to ruin in 2019. So here we start, and in future articles we will continue.



So, Wechat offers the following payment solutions:



付款 码 支付 - payment by payment code. The user opens his wich on a page with a personal payment code (containing a 18-digit barcode or QR code), the seller, by reading this code, deducts the amount determined by him from the user's account. That is, from the system side, it looks like this:



<appid>wx11112222aaaabbbb</appid> - ID       <attach>-</attach> -   (  ) <auth_code>120269300684844649</auth_code> -     <body>-</body> -   -      <device_info>1000</device_info> -    <goods_tag></goods_tag> -    ,     <mch_id>10000100</mch_id> - ID  <nonce_str>8aaee146b1dee7cec9100add9b96cbe2</nonce_str> -     <out_trade_no>1415757673</out_trade_no> -      <spbill_create_ip>14.17.22.52</spbill_create_ip> IP  <time_expire></time_expire> ,     <total_fee>1</total_fee>    <sign>C29DB7DB1FD4136B84AE35604756362C</sign> - 
      
      





That is, roughly speaking, this is the form that the seller sends to hatch, and each time only the amount and payment code of the buyer changes in it. And, accordingly, the danger of the method is immediately visible to everyone:



  1. the buyer does not see the amount until it is debited
  2. Having learned the payment code, an unscrupulous seller can debit any amount from the buyer's account at any time without his knowledge.
  3. However, since the code is one-time and changes with every launch of Wichat, and the notification of the debited amount comes in the same second, fraud with this type of payment is quite problematic. This method has taken root in almost all offline stores, self-service terminals at McDonalds and almost everywhere where you can install a barcode scanner and where the customer has physical access to it






Native Payments. Completely opposite to the first method, based on the fact that the seller generates a QR code with his data and the order amount, and the buyer through his Wechat scans it and confirms the payment. The advantages are obvious:



  1. the buyer sees the amount payable until payment
  2. all decisions are made by the buyer - he can refuse to pay even after he scanned the code. The decision to scan / not scan is also made by him.


This method has taken root wherever there is a screen on which you can display the updated QR code, first of all, on desktop websites. It can also be found in places where there is one single mass product - for example, entrance tickets to Sky Park are sold through Native payments of Vichat.







In essence, Native payments are a link in the weixin: // wxpay format that opens in the Wechat built-in browser.



The disadvantages of both of the above methods are the complete lack of feedback and the lack of the ability to personalize payments for a particular user. That is, if we just sell entrance tickets, this is enough for us - we see the payment passed, we issue a ticket, the next visitor is suitable. But if we want to give each user a personalized ticket (pulling his name out of Wichat), then using such payments is not possible - communication between the seller and the buyer ends when the order is paid and confirmed. And the maximum that the seller will see is the message that the user 123456789 in 12-31 paid 20 yuan to the seller 98765454321. Therefore, other types of payments are gaining more and more popularity. But about them a little later.



APP payments, or payments in third-party applications. Here, too, everything is extremely simple - the only scenario for using such payments is in mobile applications. Nestle water delivery app, for example. The user orders water, clicks “pay”, the Nestle application calls through the Inter-app communication the Wechat application in which payment is made. Upon completion of the transaction, Wechat sends the information back to the Nestle application and informs him that payment for order 12345 was successful.









H5 payments. In fact, this is an updated version of Native payments. Since mobile traffic has been prevailing over desktop traffic for quite some time, and Native payments have not taken root on phones for obvious reasons (mainly due to the fact that in order to scan the QR code by the phone on the screen of which it is displayed, if you need a complex mirror system, or another phone, or half-hour gestures from the series “save code to album, open wich, select scan from image), then H5 payments appeared. In fact, this is just a link in the weixin: // format on the product’s web page, which, when clicked on, offers to launch wichat and, upon completion of the transaction, gives information to the callback address









JSAPI payments. The first attempt by Wichat to combine everything under one roof and conduct all transactions in its built-in browser. It also supports the generation of codes for offline payments, and embedding on sites, and payment in public accounts. The attempt was frankly unsuccessful and is now found in few places. But it became a prerequisite for the emergence of small applications, which are slightly lower.



Also, of course, it is worth mentioning two types of payments, which are not pure payments, but are also quite popular:



  1. Payments-transfers. Particularly popular with trolley tangerines and street vendors. The personal QR code of the wallet owner is printed, having scanned which a certain amount can be transferred to him. This, in fact, is illegal, is prosecuted by the tax and so on, because the license agreement expressly states that transfers cannot be used for commercial purposes and to pay for goods. Unless the seller intentionally registered as an individual entrepreneur and indicated to Wechat that he was using his account to accept payments for business activities. But IP accounts (个体 工商 户) are a separate big topic, inappropriate for this article, especially since only citizens of the PRC-residents of the PRC can register as IP.
  2. Payments through aggregators. If the seller is too lazy to register with each of the payment systems, he can register with an aggregator like iapppay.com, print out his QR code and hang it above the cashier \ place on the site. Well, of course, everything will now take place on the side of the aggregator.
  3. And finally, the last and most enjoyable type of payment is payments in 小 程序. You can roughly translate into Russian as “small applications”. 小 程序 are essentially web pages that only work from Wichat’s built-in browser. Typical user case - a user scans a QR code through vichata and ends up in the application of a certain company. After that, it is used as a credits for login, the developer can use the full power of third-party APIs for access - to get information about the user, his geolocation, the results of preference and hobby analyzes, queries on the Internet and so on - you won’t remember everything. And in his application, he can implement absolutely everything, without any restrictions. And, accordingly, add payments in one click. That is, if all the above methods have their understandable limitations, then the conversion and retention in the application depend on you. Many companies starting with simple applications have now grown into big monsters, in the wich app of which people spend more time than on any entertainment site.


From possible implementation examples:





But in general, the two platforms are developing more or less evenly and provide equal opportunities. We will talk about the intricacies of integration and connection next time.



All Articles