Learn how to initiate WeChat Pay payments from your iOS or Android app.
When initiating a WeChat Pay payment from your app, the shopper is switched to the WeChat app to verify the payment. When the payment is completed, they are switched back to your app and presented with the payment result.
The WeChat Pay desktop payment flow is supported by our:
Before you can accept WeChat Pay payments in-app you'll need to:
Create developer account
To register a WeChat Developer Account:
- Go to https://open.weixin.qq.com/ and select Sign Up.
- Fill in your information and complete your developer profile.
WeChat will contact you to verify that the details you provided are correct. Once approved, you can register your mobile app.
Register mobile app
To register your iOS or Android app with WeChat:
- Go to https://open.weixin.qq.com/ and click Log In .
- Navigate to Admin Center > Mobile Application > Create Mobile Application, and enter:
- Your app name.
- A short introduction for your app.
The official website for your app.
iOS only: The App Store download link and Bundle ID for your app. The Bundle ID is usually in the format com.your-company.app-name
- Contact our Support Team, and provide them your AppID and AppSecret. This will ensure that payments made with your app are settled to your Adyen account.
Integrate with Checkout SDKs
The WeChat Pay in-app flow is supported by our Checkout SDKs for iOS and Android. To accept in-app payments using our Checkout SDKs, you'll need to integrate Adyen's WeChat Pay module into your:
Integrate Adyen Checkout SDK module for iOS
To add Adyen's WeChat module into your iOS app:
- Add the WeChat Pay framework into your project:
pod 'Adyen/WeChatPay'to your
AdyenWeChatPay.frameworkto your target.
- Add your AppID to your URL scheme.
- Select Targets > Info > URL type > URL Scheme.
Add a new URL Scheme:
For the Identifier, use
For the URL Scheme, use your AppID.
- In your Info.plist, add
For more information on integrating our iOS SDK into your app, refer to our Checkout SDK for iOS documentation.
Integrate Adyen Checkout SDK module for Android
To add Adyen's WeChat module into your app:
Add the following to your build.gradle file.
For more information on integrating our Android SDK into your app, refer to our Checkout SDK for Android documentation.
Integrate with API
In this section, we show the integration steps for accepting in-app payments using our API integration.
Before you begin this section, make sure you read and understand our API Integration guide.
Integrate WeChat's mobile SDKs
- Follow the steps for registering with WeChat for in-app payments.
- Integrate the WeChat Pay SDK into your app:
- Go to https://open.weixin.qq.com/ and navigate to Resource Center .
- Open Downloads, and select either:
- iOS Resource Download > iOS Development Kit (version x.x.x with payment functionality).
- Android Resource Download > Development Kit (SDK).
- Follow the instructions provided in the downloaded file to integrate the SDK.
Step 1: Make a payment
When a shopper chooses to pay with WeChat Pay:
- Make a
/paymentsAPI call, providing:
reference: Your unique reference for this payment.
paymentMethod.type: Set to wechatpaySdk
This returns a
/paymentsresponse containing a:
Pass the values in the
redirect.dataobject to the SDK.
Step 2: Present payment result
paymentData: Value you received from the
resultCode: Value you received from the SDK.
The response will contain:
pspReference: Our unique identifier for the transaction.
/payments/detailsendpoint to present the payment result to the shopper in your app.
You can track the status of the payment using notifications.
WeChat Pay result codes
resultCode you will receive for WeChat Pay is:
- Pending : The shopper has completed the payment but the final result is not yet known. It may take minutes or hours WeChat to confirm this. Inform the shopper that you've received their order, and are waiting for the payment to be completed. You will receive a notification when the status of the payment has been updated. If successful, you will receive the funds in 2 days.
To find out more about result codes and how you can action them, see Result codes.
WeChat Pay notifications
If you're accepting WeChat Pay payments you will need to set up notifications to know whether a payment is successful. Each WeChat Pay notification has a:
pspReference: identifies which payment is being referred to.
eventCode: indicates the status of the payment.
If you haven't already set up notifications, refer to our notifications documentation for instructions.
You'll know a WeChat Pay payment has been successful when you receive a notification with:
Testing in-app payments
Before accepting payments from your shoppers, we recommend testing your setup. There is currently no test platform for WeChat Pay. If you have a personal WeChat account you can test your integration by making live WeChat Pay payments with a low value, or you can cancel the transaction when you are asked to verify the payment.
You can check the status of a WeChat Pay payment in your Customer Area > Transactions > Payments.