Current location - Quotes Website - Signature design - How to use AliPay SDK
How to use AliPay SDK
You can download a source demo first.

The current SDK is renamed as Mobile Payment Integrated Development Kit.

Step by step method:

1, calling Alipay payment interface.

2. Processing the payment results returned by Alipay

Before calling Alipay payment interface, you need to place an order. When described in the document, this step is also completed on the client side, but you can also generate this order on the server side (Alipay will notify the server side after the payment is successful in the figure, so if you generate the order on the server side, you can grasp all the orders and it will be safer):

Generate an order (on an iOS client or server).

3. Call the Alipay payment interface and send the order.

4. Processing the payment results returned by Alipay

In fact, these steps are enough for the business, but there is a security problem, and we don't want the received payment results to be intercepted and modified. Therefore, when generating orders and processing payment results, it is necessary to carry out security checks:

Sign the data when the order is generated, sign and verify the data when the payment result is received, and check whether the data has been tampered with.

5. RSA encryption is used for signature verification.