All Projects → BoBoMEe → ShareLoginPay

BoBoMEe / ShareLoginPay

Licence: other
ThirdParty login,share and pay lib

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to ShareLoginPay

ZTVendorManager
基于友盟集成QQ,微信 ,微博 分享和登录功能,支付宝和微信支付功能。集成简单,使用方便。
Stars: ✭ 26 (+62.5%)
Mutual labels:  share, login-oauth
Sdk3rd
第三方SDK集成库,授权/分享/支付
Stars: ✭ 249 (+1456.25%)
Mutual labels:  share
Desktop
An Open-Source file sharing software for Linux, macOS and Windows allowing you to send and receive files over available connections, and pause and resume transfer process even when an error is given
Stars: ✭ 139 (+768.75%)
Mutual labels:  share
Rtcode
Real time code sharing web application
Stars: ✭ 170 (+962.5%)
Mutual labels:  share
Rxtool
Android开发人员不得不收集的工具类集合 | 支付宝支付 | 微信支付(统一下单) | 微信分享 | Zip4j压缩(支持分卷压缩与加密) | 一键集成UCrop选择圆形头像 | 一键集成二维码和条形码的扫描与生成 | 常用Dialog | WebView的封装可播放视频 | 仿斗鱼滑动验证码 | Toast封装 | 震动 | GPS | Location定位 | 图片缩放 | Exif 图片添加地理位置信息(经纬度) | 蛛网等级 | 颜色选择器 | ArcGis | VTPK | 编译运行一下说不定会找到惊喜
Stars: ✭ 11,567 (+72193.75%)
Mutual labels:  share
Sharect
🔗 A lightweight JavaScript library to let users share their text selections to social networks.
Stars: ✭ 192 (+1100%)
Mutual labels:  share
Zaobao
每日时报,以前端技术体系为主要分享课题。根据:文章、工具、新闻、视频几大板块作为主要分类。
Stars: ✭ 1,961 (+12156.25%)
Mutual labels:  share
note
笔记分享 | Note Share
Stars: ✭ 83 (+418.75%)
Mutual labels:  share
Sharesdk
分享SDK,包括微信、朋友圈,微博,QQ,QQ空间等渠道分享。
Stars: ✭ 221 (+1281.25%)
Mutual labels:  share
Shareable Links
A curated list of shareable social media links
Stars: ✭ 168 (+950%)
Mutual labels:  share
Code2sec.com
xmind\code\articles for my personal blog 个人博客上的资源备份存储,也是个人分享的汇总
Stars: ✭ 164 (+925%)
Mutual labels:  share
Simplesharingbuttons
Share to Facebook, Twitter, Google+ and other social networks using simple HTML buttons.
Stars: ✭ 147 (+818.75%)
Mutual labels:  share
Wormhole Gui
Cross-platform graphical user interface for easy encrypted sharing of files, folders, and text between devices.
Stars: ✭ 196 (+1125%)
Mutual labels:  share
Library
ufutx share book libraries : share and manage books platform for personal and organization
Stars: ✭ 144 (+800%)
Mutual labels:  share
React Native Share
Social share, sending simple data to other apps.
Stars: ✭ 2,955 (+18368.75%)
Mutual labels:  share
Vue Social Share
A Vue 2.x social share component
Stars: ✭ 136 (+750%)
Mutual labels:  share
Resources
知名互联网企业内推资料整理 持续更新ing 。 目前已经维护五个微信群接近3000人,欢迎你的加入!
Stars: ✭ 1,910 (+11837.5%)
Mutual labels:  share
Datash
Send and Receive files directly from your browser with end-to-end encryption
Stars: ✭ 178 (+1012.5%)
Mutual labels:  share
filein-frontend
The best way to share files
Stars: ✭ 16 (+0%)
Mutual labels:  share
Sharex
ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of files to many supported destinations you can choose from.
Stars: ✭ 18,143 (+113293.75%)
Mutual labels:  share

ShareLoginPay


A simple tools for share (WeChat,Weibo, QQ) login(WeChat,Weibo,QQ) pay(Alipay,WeChatPay)

ThirdPay

Wechat Pay

//todo init appid
      PayBlock.getInstance().initWechatPay(wechatAppId);
      WxpayUtil.init(this);
//generate payinfo from server and start pay
     String payInfo = WechatOderInfo.getPayInfo();
     PayReq req = WechatOderInfo.getWeixinPayReq(payInfo);
 
     WxpayUtil.weixinPay(req, new WxpayResultListener() {
       @Override public void payResult(PayResp payResp) {
         String prepayId = payResp.prepayId;
         Toast.makeText(MainActivity.this, "prepayid--->" + prepayId, Toast.LENGTH_SHORT).show();
       }
 
       @Override public void onError(int errCode) {
         Toast.makeText(MainActivity.this, "onError()-->" + errCode, Toast.LENGTH_SHORT).show();
       }
 
       @Override public void onCancel() {
         Toast.makeText(MainActivity.this, "onCancel()", Toast.LENGTH_SHORT).show();
       }
 
       @Override public void notSupport() {
         Toast.makeText(MainActivity.this, "没有安装微信,或版本太低", Toast.LENGTH_SHORT).show();
       }
     });

NOTE: 微信支付必须使用签名包,新建回调类wxapi/WXPayEntryActivity.java

AliPay

//todo mock data,will be set in server,
      AlipayBlock.getInstance().initAliPay(alipayPartner, alipaySeller, alipayRsa_private);
// todo Using mock data to generate payinfo
            String orderInfo = AlipayOrderInfo.getOrderInfo("测试的商品", "该测试商品的详细描述", "0.01");
            String sign = AlipayOrderInfo.sign(orderInfo);

            AlipayUtil.aliPay(this, orderInfo, sign, new AlipayResultListener() {
                @Override public void payResult(String s) {

                    AliPayResult payResult = new AliPayResult(s);
                    String resultStatus = payResult.getResultStatus();
                    String resultResult = payResult.getResult();

                    // 判断resultStatus 为“9000”则代表支付成功,具体状态码代表含义可参考接口文档
                    if (TextUtils.equals(resultStatus, "9000")) {
                        //支付成功
                        AliPayResultS trand = new AliPayResultS(resultResult);
                        final String tradNo = trand.getResult();

                        runOnUiThread(new Runnable() {
                            @Override public void run() {
                                Toast.makeText(MainActivity.this,
                                    "payResult: tradNo --- > " + tradNo, Toast.LENGTH_SHORT).show();
                            }
                        });
                    } else {
                        // 判断resultStatus 为非“9000”则代表可能支付失败
                        // “8000”代表支付结果因为支付渠道原因或者系统原因还在等待支付结果确认,最终交易是否成功以服务端异步通知为准(小概率状态)
                        if (TextUtils.equals(resultStatus, "8000")) {
                            //支付结果确认中
                            runOnUiThread(new Runnable() {
                                @Override public void run() {
                                    Toast.makeText(MainActivity.this, "payResult: 支付结果确认中",
                                        Toast.LENGTH_SHORT).show();
                                }
                            });
                        } else {
                            // 其他值就可以判断为支付失败,包括用户主动取消支付,或者系统返回的错误
                            //支付失败
                            runOnUiThread(new Runnable() {
                                @Override public void run() {
                                    Toast.makeText(MainActivity.this, "payResult: 支付失败",
                                        Toast.LENGTH_SHORT).show();
                                }
                            });
                        }
                    }
                }
            });

NOTE: 支付宝支付的订单信息和签名信息都在服务端生成.最终成功与否需要看服务器异步回调.

详细说明: Android 支付宝和微信支付集成

ThirdLogin

1.Init

// TODO: init appid
    LoginShareBlock.getInstance().initWechat(wechatAppId, wechatAppSecret);
    LoginShareBlock.getInstance().initQQ(qqAppId);
    LoginShareBlock.getInstance().initWb(wbAppKey, wbRedirectUrl);

2.Wechat Login

 private LoginManager mLoginManager = LoginManager.INSTANCE;

 mLoginManager.loginClass(WeiXinLogin.class).loginCallback(new ILoginCallback() {
      @Override public void tokeCallBack(Object o) {
        final WeixinTokenModel tokenModel = (WeixinTokenModel) o;
        runOnUiThread(new Runnable() {
          @Override public void run() {
            Toast.makeText(MainActivity.this, tokenModel.toString(), Toast.LENGTH_SHORT).show();
          }
        });
      }

      @Override public void infoCallBack(Object o) {
        final WeixinInfoModel infoModel = (WeixinInfoModel) o;
        runOnUiThread(new Runnable() {
          @Override public void run() {
            Toast.makeText(MainActivity.this, infoModel.toString(), Toast.LENGTH_SHORT).show();
          }
        });
      }

      @Override public void onError(final Exception e) {
        runOnUiThread(new Runnable() {
          @Override public void run() {
            Toast.makeText(MainActivity.this, "onError()--->" + e.getMessage(), Toast.LENGTH_SHORT)
                .show();
          }
        });
      }

      @Override public void onCancel() {
        runOnUiThread(new Runnable() {
          @Override public void run() {
            Toast.makeText(MainActivity.this, "onCancel()", Toast.LENGTH_SHORT).show();
          }
        });
      }
    }).doLogin(this);

NOTE:需要复写onActivityResult()方法才能监听回调,新建微信回调类wxapi/WXEntryActivity.java

详细说明:Android中QQ,微信,微博三方登陆及注意事项

ThirdShare

Wechat Share

public void wxshare(View view) {
    IShare wxshare = new WechatShare(this);
    ShareContent shareContent = new ShareContent();
    shareContent.setContent("分享的内容");
    shareContent.setTitle("分享的标题");
    // 分享的类型,包括文本,图片,webpage,music等
    shareContent.setContentType(ContentType.TEXT);
    // 分享的类型,包括 微信好友和微信朋友圈
    shareContent.setShareType(ShareType.WECHAT);

    wxshare.share(shareContent, new IShareCallBack() {
      @Override public void onComplete(Object o) {
        Toast.makeText(MainActivity.this, "onComplete-->" + o.toString(), Toast.LENGTH_SHORT)
            .show();
      }

      @Override public void onError(Exception e) {
        Toast.makeText(MainActivity.this, "onError-->" + e.toString(), Toast.LENGTH_SHORT).show();
      }

      @Override public void onCancel() {
        Toast.makeText(MainActivity.this, "onCancel", Toast.LENGTH_SHORT).show();
      }
    });
  }

微信分享同样需要签名,新建微信回调类wxapi/WXEntryActivity.java

详细说明: Android 三方分享与ShareSDK分享

Thanks to

lingochamp/ShareLoginLib

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].