Joke Collection Website - Blessing messages - How to use Alipay SDK

How to use Alipay SDK

You can download a source code DEMO first.

The current SDK is renamed Mobile Payment Integrated Development Kit.

Step method:

1. Call the Alipay payment interface

2. Process the payment result returned by Alipay

After calling the Alipay payment interface Before, you need to generate an order first. When described in the document, this step is also done on the client side, but the order can also be generated on the server side (Alipay in the picture will notify the server side after the payment is successful, so If you generate orders on the server side, you can control all orders and it will be safer):

Generate orders (can be generated in the iOS client or on the server side).

3. Call the Alipay payment interface and send the order

4. Process the payment results returned by Alipay

In fact, for business, these steps are enough. However, there is a security issue. We do not want the received payment results to be intercepted and modified. Therefore, we need to do a security check when generating orders and processing payment results:

When generating orders Data signature: perform signature verification on the data when receiving the payment result to verify whether the data has been tampered with.

5. Use RSA encryption method for signature verification.