Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solutionDOCS

      SDK overview

      Order payment
      Obtain SDK version number

      Express pay SDK API on Android platform is shown in the following table:

      API nameAPI description
      PayTaskSDK provides object APIs of payment and inquiry.

      PayTask object mainly provides sellers with order payment function and obtains current SDK version number.

      #Order payment

      Method name:
      Method prototype: PayTask payTask = new PayTask (activity); (orderInfo, true);
      Method function: provides sellers with order payment function.
      Method parameters: Examples using PayTask with parameter activity.

      Parameter nameParameter description
      String orderInfoMainly includes sellers' order information, key=“value” form, and uses & to connect.
      boolean isShowPayLoadingUsers click to pay inside seller's app, whether loading is needed or not as transition before opening Alipay app, set this value as true, a loading will be directly opened when calling for pay API, until H5 payment page or Alipay app payment page opens. (Suggest to set this value as true, to optimise the transition process from click-to-pay to payment page.)

      An example of payment parameters is shown below - please see "Request Parameters Description" for more details on parameters:


      Returned value:Returned result called by this method, see "synchronous response parameter" for parameters description". The typical string format for returned result is shown as below:



      Returned result needs to use value of resultStatus and result fields to determine the payment result. When verifications of resultStatus=9000, and success="true", as well as sign="xxx" are passed, payment is successfully. Other outcomes will be regarded as failure. For circumstances of low security level, payment result can be decided by checking resultStatus and success="true" only. 
      The only difference on the returned result between Android platform and iOS platform is the key of resultStatus; the returned result of iOS is ResultStatus (the initial letter is capitalized in order to be compatible with historical versions), while that of Android platform is resultStatus.


      #Obtain SDK version number

      Method name: payTask.getVersion
      Method prototype: PayTask payTask = new PayTask (activity); payTask.getVersion();
      Method function: obtain current SDK version number
      Method parameters:  Instantiate PayTask, and pass instance of parameter activity
      Returned value:  String type value, e.g. "2.0.0".