GithubHelp home page GithubHelp logo

alipay's Introduction

支付宝集成组件

集成方法

  1. 在工程目录下添加maven
allprojects {
    repositories {
        maven { url "https://jitpack.io" }       
        ...
    }
}
  1. module下添加gradle依赖
implementation 'com.github.chenzhenlindx:Alipay:1.0.0'
//可选
implementation 'io.reactivex.rxjava2:rxjava:2.1.6'
//可选
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'

使用方法

  1. 向服务端请求生成订单信息orderInfo,格式参考App支付请求参数说明
  2. 在Activity调用AlipayHelper.payV2(final Activity activity, final String orderInfo)
String orderInfo = "";
//这里需要获取后端的orderInfo信息
AlipayHelper.payV2(MainActivity.this, orderInfo).subscribe(new Consumer<PayResult>() {
    public void accept(PayResult payResult) {
       if (AlipayHelper.isSuccess(payResult)) {
            Result var2 = AlipayHelper.getResult(payResult);
       } else {
           String var3 = payResult.getMemo();
          Toast.makeText(MainActivity.this,var3,Toast.LENGTH_SHORT).show();
       }
     }
});

alipay's People

Contributors

chenzhenlindx avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.