Disclaimer: This article is xing_star original article, please indicate the source!
This article synchronization from http://javaexception.com/archives/162
Recently found a good open source project, you can add the app to their micro-channel / Alipay transfer function of a reward, give their app added this feature, found that the use of simple, really great.
github address is https://github.com/CankingApp/MiniPay
On the principle of this project, there are articles about very clear, specific reference to this, http://www.canking.win/2017/09/21/minipay/ next is a summary, micro-channel, two-dimensional code scan code Alipay, is a url, micro-channel sweep out specific protocol format, Alipay this can be resolved, the user identification to be transferred, thereby bringing the transfer function of a reward. MiniPay this sdk is based on a lightweight package.
usage
1. The need to provide configuration information
Alipay and micro-channel two-dimensional code
parsing content Alipay two-dimensional code suffix characters (giro use)
this may refer http://www.canking.win/2017/09/21/minipay/ can use two-dimensional code online parser https : //jiema.wwei.cn/ resolved two-dimensional code Alipay, access to that suffix character string
2. Add project dependencies
Add in app / build.gradle in
implementation 'com.canking.minipay:minipay:1.0.5'
3. line of code to start MiniPay
MiniPayUtils.setupPay(AboutActivity.this, new Config.Builder("xxxxxxx", R.drawable.ic_alipay, R.drawable.ic_wechatpay).build());
This has been integrated successfully, you can look renderings
Renderings
Reference material
Principles http://www.canking.win/2017/09/21/minipay/
Github address https://github.com/CankingApp/MiniPay