How to call WeChat Pay in the H5 page embedded in APP?

one requirement is to call WeChat Pay in the h5 page of app. How to do that? what is the process?


my solution is that H5 is bridged with APP. In the H5 payment button binding event, the Android/IOS method is called directly, and WeChat Pay is used to retrieve it with Android/IOS. After the payment result is called back to Android/IOS, APP calls the H5 event to display the result or jump to the page. If you build a bridge, you can check the @ JavascriptInterface annotation on your own, and you can easily call each other between APP and H5.


https://open.weixin.qq.com/cg.

in essence, APP tune WeChat Pay. As for how the embedded H5 communicates with your APP, it depends on how the logic is written.

Menu