当前位置:网站首页>Four steps of Android integrated payment

Four steps of Android integrated payment

2020-11-09 12:17:47 Number of

The following is the four step of Alipay payment. , Other third-party platform payment process is similar

 Insert picture description here

In mobile development, it is a common requirement to access the payment function of the third-party platform , The development documents of related platforms are APP The process of accessing the payment function will also be described in detail . As follows: android Access to Alipay as an example , For the convenience of demonstration , Set up a local one first Tomcat application server . adopt android The code requests the following data returned by the server :
 Insert picture description here

android Steps to integrate Alipay

1. Add dependency 、 To configure SDK:
stay modle Of build.grade Add dependency to
 Insert picture description here
stay modle Of libs Copy the folder into Alipay. SDK
 Insert picture description here
In the engineering of build.grade Add configuration in
 Insert picture description here





2. Add permissions :

 Insert picture description here

3. There are four steps to tune up the Alipay code.

3.1 The first two steps :
 Insert picture description here

The part framed in the figure above is the code that generates the tagging process , It's on the server side , Mobile terminal does not need to be considered , In real development We can go back by calling the company interface orderInfo( Core parameters of payment ) 了 , Fast access directly skips this box . Request interface , The server returned something similar json data :

 Insert picture description here

3.2 The last two steps :

 Insert picture description here

complete demo Address :https://github.com/yanhuomatou2015/AlipayDemo.git

Today's sharing is over , bye ~

版权声明
本文为[Number of]所创,转载请带上原文链接,感谢