Zum Hauptinhalt springen

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:

    CasdoorWert
    TypePayment (x509)
    CertificateInhalt von appCertPublicKey.crt
    Private keyInhalt von appPrivateKey.txt

    App Cert in Casdoor

  2. Add a certificate named Root Cert:

    CasdoorWert
    TypePayment (x509)
    CertificateInhalt von alipayCertPublicKey.crt
    Private keyInhalt von alipayRootCert.crt

    Root Cert in Casdoor

Add the provider in Casdoor​

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

    CasdoorWert
    CategoryZahlung
    TypeAlipay (Zahlung)
    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

Info

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​