blog image
Blog Articles

ALIPAY QR Mastery: Diverse Payment Solutions

Alipay is providing the solution of smart e-commerce, contact free payment options and digital ecosystem. One integration with multiple options to get help in business. A digital ecosystem plays a vital role in your business. The main thing is safety & security because every transaction should be secured by a trusted technology and protected from involvement of virus transmission for the safety of customers. Alipay is providing an easy way of integration of APIs. By creating a developer account and following minimal instructions a user can integrate APIs.

Create a developer account at Alipay home

By clicking on this link a user can create a developer account
after visiting the page click on the Login
Or you can click on this signup URL directly if you don’t have login credentials
After entering the basic details a user can have a developer account to integrate the APIs.

alipay form

Set Public and Private Keys for Alipay account

Set Private and Public keys on alipay account

After creating the developer account then login on the sandbox dashboard and then you can see the “Integration Settings” section and click on that.
As you can see a button “Edit Public Key”, click on this button a new modal will display on the screen as shown below.

Edit keys for Alipay account

If you are a “Mac” user then click on “For Mac” otherwise for windows click on “For Windows”. Now a key generator tool will start downloading. After completion of downloading you can see a zip file downloaded at the download location and you will have to unzip that file. Now you can see the files and folders as shown in the below screenshot.

Run file to see private and public keys

Now double click on the “Run” file and a modal will display on the screen. On that modal choose the new key and then see the private and public keys in the different sections. Keep those keys as backup in text files for future reference.

After all of these, come back on the Alipay sandbox dashboard and paste that public key here in the box as shown in the below screenshot and then click on submit button. In this way a user can set up a developer account to integrate the Alipay APIs easily.

 modal submission at Alipay

Now the user has a pair of keys (Private/Public) and a public user can copy from the Alipay sandbox dashboard to validate the Alipay response in his code. Because corresponding a pair of keys is used by Alipay as well to encrypt and decrypt the response and in the same the pair keys user has used to encrypt and decrypt the request. And by submitting the public key here and copying the Alipay public key user and Alipay exchange the public keys with each other. So that when a user sends an encrypted request on Alipay then Alipay by using the public can decrypt that request and then Alipay sends an encrypted response and by using the Alipay’s public key user can decrypt the response.

Build request header

Build the request header by adding the pair of keys and values in the request header.
Follow this link and accordingly set values.

builid request header

Sign Signature for request header

As you can see in the above screenshot signature is required in the request header. Here is the snippet of the Java code used to sign the signature.

registration on Alipay

Merchant Registration on Alipay

After visiting the APIs documentation link, you can see the “In Store Payments” section and other sub menus. Now you have to click on “Registration”. As shown in the screenshot, you can see the API URL, request header, and response header. Before sending the request on URL a user will have to prepare the request header as required to fulfill the request and accordingly can verify the response header as well. 
Follow this link for request and response parameters:

Regstraytion request Parameters

Notify Merchant Registration Status on Alipay

notifyRegistrationStatus

After registering a merchant on Alipay a user can call an API to send the merchant registration result to the merchant.
Follow this link for more details:

registration status request parameters

QR Code Generation

pay order code payment

This API is used for order code payments and by sending all the required details users can generate the QR code and all details of the QR code will be received in the API response.
Follow this link for more details:

qr code generation

Inquiry QR Code Payment

inquiry payment

This API is used to get more information about a previously submitted payment request.
Follow this link for more details:

inquiry request parameters

Notify QR Code Payment

notify payment on Alipay

This API is used to send the payment details to the merchant after payment processing reaches a final phase of success.
Follow this link for more details:

notification QR Code payment on Alipay

Conclusion

In conclusion, mastering the ALIPAY QR Generation API opens doors to diverse payment solutions. Seamlessly integrate this powerful tool to unlock new possibilities and streamline financial transactions with ease.
For additional insightful articles and information on custom software development services, please reach out to us.

Sign Up Now
Get a Fast Estimate on Your Software Development Project

We are committed to delivering high-quality IT solutions tailored to meet the unique needs of our clients. As part of our commitment to transparency and excellence, we provide detailed project estimations to help our clients understand the scope, timeline, and budget associated with their IT initiatives.