1 Star 0 Fork 23

div / AppPay

forked from Jenly / AppPay 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

AppPay

Image

JitPack CI API License Blog QQGroup

AppPay for Android 是一个专注于App支付的库,将主流的官方App支付集成方式进行封装、简化,让实现App支付简单到只需几句代码。

AppPay目前包括的库

  • WXPay 封装的微信支付库,使用起来更简单。
  • AliPay 封装的支付宝支付库(初始化,监听支付结果,发送支付请求,三句代码搞定。)
  • AppPay 将以上所有子库进行整合再次封装,让集成App支付一步到位。

AppPay的的整体结构:包含多个独立封装的子库,每个子库可以独立集成,也可以直接集成AppPay,一步到位,拥有所有子库的能力,并且使用更简单。

结构

Image

引入

Maven:

    //AppPay
    <dependency>
      <groupId>com.king.pay</groupId>
      <artifactId>apppay</artifactId>
      <version>1.0.1</version>
      <type>pom</type>
    </dependency>
    
    //WXPay
    <dependency>
      <groupId>com.king.pay</groupId>
      <artifactId>wxpay</artifactId>
      <version>1.0.1</version>
      <type>pom</type>
    </dependency>
    
    //AliPay
    <dependency>
      <groupId>com.king.pay</groupId>
      <artifactId>alipay</artifactId>
      <version>1.0.1</version>
      <type>pom</type>
    </dependency>    

Gradle:

    //AppPay
    implementation 'com.king.pay:apppay:1.0.1'
    
    //WXPay
    implementation 'com.king.pay:wxpay:1.0.1'

    //AliPay
    implementation 'com.king.pay:alipay:1.0.1'

注意:当集成涉及到支付宝支付时(即使用了AliPay或者AppPay时),需在您项目中引入alipaySdk依赖,具体详情请参见App中的build.gradle,在下面的版本记录中查看AppPay使用alipaySdk对应的版本

Lvy:

    //AppPay
    <dependency org='com.king.pay' name='wxpay' rev='1.0.1'>
      <artifact name='$AID' ext='pom'></artifact>
    </dependency>
    
    //WXPay
    <dependency org='com.king.pay' name='wxpay' rev='1.0.1'>
      <artifact name='$AID' ext='pom'></artifact>
    </dependency>

    //AliPay
    <dependency org='com.king.pay' name='alipay' rev='1.0.1'>
      <artifact name='$AID' ext='pom'></artifact>
    </dependency>
如果Gradle出现compile失败的情况,可以在Project的build.gradle里面添加如下:(也可以使用上面的GitPack来complie)
    allprojects {
        repositories {
            //...
            maven { url 'https://dl.bintray.com/jenly/maven' }
        }
    }

示例

AppPay

    //在Activity中初始化AppPay
    mAppPay = new AppPay(this);

    //设置支付宝支付监听
    mAppPay.setOnAliPayListener(new AliPay.OnPayListener() {
        @Override
        public void onPayResult(boolean isSuccess, String resultInfo) {
            if(isSuccess){//TODO 支付宝支付成功
                //务必以服务端结果为准
            }
        }
    });

    //发送微信支付请求
    mAppPay.sendWXPayReq(WXPayReq req);

    //发送支付宝支付请求
    mAppPay.sendAliPayReq(String orderInfo);
WXPay
    //初始化微信支付
    mWXPay = new WXPay(Context context,String appId);

    //发送微信支付请求
    mWXPay.sendReq(WXPayReq req);
AliPay
    //初始化支付宝支付
    mAliPay = new AliPay(Activity activity);

    //设置支付宝支付监听
    mAliPay.setOnPayListener(new AliPay.OnPayListener() {
        @Override
        public void onPayResult(boolean isSuccess, String resultInfo) {
            if(isSuccess){//TODO 支付宝支付成功
                //务必以服务端结果为准
            }
        }
    });

    //发送支付宝支付请求
    mAliPay.sendReq(String orderInfo);

更多使用示例请查看App

版本记录

v1.0.1 :2019-11-14

v1.0.0 :2019-3-21

赞赏

如果您喜欢AppPay,或感觉AppPay帮助到了您,可以点右上角“Star”支持一下,您的支持就是我的动力,谢谢 :smiley:

您也可以扫描下面的二维码,请作者喝杯咖啡 :coffee:

关于我

Name: Jenly

Email: jenly1314#gmail.com / jenly1314#vip.qq.com

CSDN: jenly121

博客园: jenly

Github: jenly1314

加入QQ群: 20867961

The MIT License (MIT) Copyright (c) 2019 Jenly Yu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

:money_with_wings: AppPay专注于App支付的库,几句代码轻松搞定微信支付、支付宝支付。集成更简单。 展开 收起
Android
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Android
1
https://gitee.com/dale-lib/AppPay.git
git@gitee.com:dale-lib/AppPay.git
dale-lib
AppPay
AppPay
master

搜索帮助

14c37bed 8189591 565d56ea 8189591