This app demonstrates
- Creating a Stripe PaymentIntent for WeChat using the PaymentIntent API
- Integrating with the WeChat SDK to capture payment and complete the transaction through stripe-wechatpay module
See Accept a WeChat Pay payment for more details.
- Your app must be registered WeChat Open Platform and have a appId assigned by WeChat.
- You must have a WeChat account with WeChat Pay enabled.
- See more details of Stripe's WeChat Pay module here.
- Create a Heroku account if you don't have one.
- Navigate to the example mobile backend repo and click "Deploy to Heroku".
- Set an App Name of your choice (e.g. Stripe Example Mobile Backend).
- Under Config Vars, set your Stripe livemode secret key
for the
STRIPE_TEST_SECRET_KEY
field.A live key is required for valid WeChat Pay parameters.
- Click "Deploy for Free".
- Create
~/.gradle/gradle.properties
if it doesn't exist - Add the following entries to the end of the file and set to the appropriate values
STRIPE_WECHAT_EXAMPLE_APP_ID=wx123456 STRIPE_WECHAT_EXAMPLE_STRIPE_KEY=pk_live_mykey STRIPE_WECHAT_EXAMPLE_BACKEND_URL=https://my-backend.herokuapp.com/
STRIPE_WECHAT_EXAMPLE_APP_ID and STRIPE_WECHAT_EXAMPLE_STRIPE_KEY are used to talk to Stripe backend to create a PaymentIntent. A live key is required for valid WeChat Pay parameters.
- Clone the
wechatpay-sources-android
repository. - Open the project in Android Studio.
- Run the
app
project.