How does the APP achieve automatic renewal?

How does the APP achieve automatic renewal?

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.

<<:  my country's independent research and development of magnetic substrates has broken the foreign technology monopoly

>>:  5G phones in 2019: expensive, battery-hungry, and not very useful

Recommend

Improving Android program security using hook technology (Part 1)

one, Introduction In the Android development worl...

20 tips for hot-selling headlines!

Besides the content, the most important thing abo...

TVOS 2.0 dominates the market? See how people complain about it

In the past week, the biggest event in the televi...

E-commerce platforms create their own private domain traffic?

Private domain traffic is not a new term, nor did...

How to do website SEO optimization? How to do Baidu SEO?

Especially in recent times, Baidu has been acting...

The secret of Pinduoduo’s cash flow for user growth

It has only been five years since Pinduoduo went ...

Artificial Intelligence Report: Scaling

Accenture has released a new report, “Artificial ...

Why Microsoft's cloud computing business is losing to Amazon

When Microsoft released its latest financial repo...