01. Goal Implement the function of automatic membership renewal in the APP 02. Process 2.1、Membership automatic renewal authorization The essence of automatic membership renewal is a delegated deduction model. Only when the user completes the contract can the merchant automatically deduct the user's account to complete the payment operation of the member order. The user completes the debit contract through the WeChat or Alipay SDK in the app. After the user successfully signs the contract, WeChat or Alipay notifies the merchant backend of the contract information through asynchronous notification. The merchant backend needs to maintain the user's contract information, and the contract ID is the core information, which is used to verify the authorization in the order debit request. 2.2. Automatically initiate renewal process after membership expires When the system detects that the user's membership is about to expire, it initiates the automatic renewal process for the user. It is necessary to complete the order creation and order payment process (withdrawal), and *** extend the user's membership time when the payment notification is called back. The main difference between a renewal order and a normal order is whether the entrusted withdrawal interface is called. 03. Authorization for deduction of funds User authorization for deductions is a prerequisite for automatic membership renewal, and there are two main modes: signing during payment and pure signing. 3.1. Signing a contract during payment The signing of the deduction agreement is completed at the same time as the payment. The signing function can be supported by simply adding the signing information to the original order parameters, which seems to be very suitable for the scenario of automatic renewal of our members. The signing function is completed after the user places an order to purchase a membership for consecutive months. However, in practice, we found that there was a problem that was overlooked. The default signing process in the payment process is not enabled, and users need to manually enable the entrusted deduction. We hope to increase the proportion of users signing contracts, but the operation cost of requiring users to manually check this step is really too high, which does not meet our expectations. 3.2. Contract Signed Only The pure contract mode is that the merchant first calls the pure contract interface through the front-end page to complete the deduction agreement with the user. When deduction is required, the application deduction interface can be called for automatic deduction. After the user signs the contract, the merchant backend will receive a callback notification. 04. Solution Design The basic process of automatic membership renewal after adjustment is as follows: 4.1. Optimization of automatic renewal process Use only the contract signing interface, not the payment contract signing interface Only the contract signing interface can limit users to purchase continuous monthly products only after signing a contract. In order to simulate the user's experience of signing a contract and paying, the system initiates an automatic renewal process after the user successfully signs the contract. 4.2 How to avoid repeated renewal after signing a membership contract After the process is optimized, the automatic renewal process needs to be initiated after the user successfully signs the contract. Here, it is necessary to ensure that the user will not be renewed repeatedly. Here, you can consider using the contract ID as the order idempotent element. The same contract ID will only initiate automatic renewal once. 4.3 How to avoid repeated renewal after membership expires When a membership expires, an automatic renewal process will be initiated. Here, you can consider using the membership expiration timestamp as the order idempotent element. If the membership renewal is successful, the membership expiration timestamp will be extended accordingly, and the logic of the membership expiration will no longer be triggered. If the membership renewal fails, the membership expiration timestamp remains unchanged, and multiple renewal orders will not be initiated. 05. Summary When implementing the function, changing the way of thinking may lead to different findings. In this function, using the contract-only interface can simulate the effect of user payment and contract, which is in line with our expectations. |
>>: 5G phones in 2019: expensive, battery-hungry, and not very useful
Recently, WeChat released the 7.0.10 beta version...
Wait! Before you scroll down this article, stop h...
With the change of seasons, the temperature often...
On November 30, the General Administration of Qua...
Business owners are also confused. We have set th...
I started writing for the official account in Aug...
As the saying goes, "If you want to be healt...
Nowadays, training camps have become one of the s...
The landing page is the first impression that con...
Attracting users and increasing purchase return r...
Food is the best source of immune barrier for the...
[[147577]] If you are already a very good program...
Source: www.countytimes.co.uk Huer Insects are ve...
[[153510]] Three days ago was my first anniversar...
8,000 kilometers away from China and with a 5-hou...