メインコンテンツにスキップ

WeChat Pay

You need a WeChat Merchant account. See preparation before access.

1. Get credentials

API Key v3

In WeChat Merchant Platform: Account SettingsAPI SecuritySet APIv3 Secret. Copy the API Key v3. See APIv3 Key Settings.

wechat api key v3

Merchant certificate

Account SettingsAPI SecurityAPI Certificate → download the certificate. Get the Certificate Serial Number and Private Key. In Casdoor, create a Cert and fill in the certificate details.

wechat merchant certificate wechat_cert

Merchant ID and App ID

2. Create the provider in Casdoor

Add a Payment provider, set Type to WeChat Pay, and fill in:

Casdoor fieldValue
Client IDMerchant ID
Client secretAPI Key v3
App IDApp ID
CertThe Cert above

wechat pay provider

3. Attach to your product

Add the WeChat Pay provider to your product so users can pay with WeChat Pay.

製品のためのwechat pay支払いプロバイダーを追加する

JSAPI payment (in-WeChat browser)

Casdoor supports JSAPI and Native payment. For JSAPI (payment inside the WeChat app), configure a WeChat OAuth provider that uses the WeChat Media Platform. The Client ID 2 of that WeChat OAuth provider must match the App ID of this WeChat Pay provider.

wechat pay支払いプロバイダーとwechat oauthプロバイダーの関係

After users sign in via WeChat (e.g. in the WeChat in-app browser), they can pay with WeChat Pay via JSAPI.