支付宝
步骤1。 准备
You need a merchant account at Alipay Open Platform.
在访问支付宝之前,需要做一些准备工作。
See preparation before access.
1.1 获取APPID
登录支付宝开放平台控制台并创建一个应用。
如何获取APPID:支付宝APPID查询指南
1.2 配置证书
Generate an RSA2 certificate per the Alipay doc to obtain appPrivateKey.txt and appPublicKey.txt.
Upload the certificate to the application and download three files: alipayRootCert.crt, appCertPublicKey.crt, alipayCertPublicKey.crt.
Create a Cert named App Cert in Casdoor:
| Casdoor | Value |
|---|---|
| Type | Payment (x509) |
| Certificate | appCertPublicKey.crt的内容 |
| Private key | appPrivateKey.txt的内容 |

Create a Cert named Root Cert in Casdoor:
| Casdoor | Value |
|---|---|
| Type | Payment (x509) |
| Certificate | alipayCertPublicKey.crt的内容 |
| Private key | alipayRootCert.crt的内容 |

步骤2。 创建一个支付宝支付提供商
接下来,在Casdoor中创建一个支付宝支付提供商,填写必要的信息。
| Casdoor | Value |
|---|---|
| Category | Payment |
| Type | Alipay |
| Client ID | APPID from step 1.1 |
| Cert | App Cert from step 1.2 |
| Root Cert | Root Cert from step 1.2 |

步骤3。 为您的产品添加支付宝支付提供商
最后,为您的产品添加支付宝支付提供商,以便用户可以使用支付宝购买产品。
Alipay only supports transactions in Chinese Yuan (CNY). When adding Alipay as a payment provider, ensure your product's currency is set to CNY. Products with other currencies will be rejected during creation or update to prevent payment failures.
