Bootstrap

Android 微信支付流程以及注意事项。

一,集成:

     1,微信开放平台进行账户的注册,商户平台的注册以及微信的支付授权。https://open.weixin.qq.com/

     2,在包名下新建wxapi文件夹,同时copy 开放平台的demo下的WXEntryActivity文件,记得在注册文件中注册。

 <activity android:name="com.xxx.abc.wxapi.WXPayEntryActivity"
            android:exported="true"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

3,在使用微信支付的地方进行微信支付的创建以及注册

 val api = WXAPIFactory.createWXAPI(this,AppConstant.APP_ID,false)
 api?.registerApp(AppConstant.APP_ID)
 api?.sendReq(PayReq())<
;