Przejdź do głównej zawartości

Take payments with Alipay

This guide explains how to let users pay for your Casdoor products with Alipay.


Learning outcomes​

  • Get the APPID and the certificates of an Alipay merchant application.
  • Store the certificates in Casdoor.
  • Add Alipay as a payment provider and add it to a product.

What you need​


Prepare Alipay​

  1. Create an application in the console of the Alipay Open Platform and note its APPID. See Find the APPID.
  2. Generate an RSA2 key pair as the Alipay documentation describes. You get appPrivateKey.txt and appPublicKey.txt.
  3. Upload the certificate to the application and download three files: alipayRootCert.crt, appCertPublicKey.crt, and alipayCertPublicKey.crt.

Store the certificates in Casdoor​

  1. On the Certs page of the Casdoor admin console, add a certificate named App Cert:

    CasdoorValue
    TypePayment (x509)
    Certificatecontent of appCertPublicKey.crt
    Private keycontent of appPrivateKey.txt

    App Cert in Casdoor

  2. Add a certificate named Root Cert:

    CasdoorValue
    TypePayment (x509)
    Certificatecontent of alipayCertPublicKey.crt
    Private keycontent of alipayRootCert.crt

    Root Cert in Casdoor

Add the provider in Casdoor​

  1. Go to Identity > Providers and add a provider with the following values:

    CasdoorValue
    CategoryPayment
    TypeAlipay
    Client IDAPPID from step 1.1
    CertApp Cert from step 1.2
    Root CertRoot Cert from step 1.2

    Alipay payment provider in Casdoor

  2. Save the provider.

Add the provider to a product​

Add the provider to the Payment providers of the product and save it.

Alipay in the payment providers of a product

informacja

Alipay supports only Chinese yuan (CNY). Set the currency of the product to CNY. Casdoor rejects a product with Alipay in another currency when you save it.

See also​