Your main logic should always be the following:
1、Customer navigates around in your app, adds a good into the shopping cart.
2、When the customer wants to pay for the good, a payment page appears which display a goods list and the total amount.
3、Here, you should call our PayChannelInit API to get the pay channels that you have signed. Based on the result, do something to initialize the pay channel environment and then display the buttons for each pay channel.
4、When the customer clicks a button, the app should call our CreateOrder API to get all information the pay channel requires.
5、Build the pay request according to the data from Step 4,call the method in payment sdk to transfer customer to Alipay/Wechat APP.
6、The customer pays the amount and is transfered back to your app.
7、Lead the customer to the results page, and call our QueryOrder API for the pay result, then display it to customer.
8、All funds charged and will be transferred to you later.