Alipay+ DocsAlipay+ Docs

launch

After the entry code is identified, the MPP app uses the launch API to start the payment process for the entry code.

Method signature

copy
public class AlipayPlusClientMPM {

    void launch(Context context, LaunchParams params, Callback<LaunchResult> callback);
    
}

Request parameters

Item

Type

Description

Required

context

Context

The context of the Android activity.

M

params

LaunchParams

The parameters required for the payment to be launched.

M

callback

Callback

The callback to be invoked after the process to launch the decoding ends. See callback for details.

M

Callback

Item

Type

Description

Required

result

LaunchResult

The decoding result that is required if the request succeeds.

O

errorCode

String

The error code that is required if the request fails.

O

errorMessage

String

The error message that is required if the request fails.

O

Response parameters

N/A

Sample

copy
LaunchParams params = new LaunchParams();
params.url = "XXX";
params.userAgent = "YYY";
AlipayPlusClientMPM.getInstance().launch(context, params, 
                                         new Callback<LaunchResult>() {
         @Override                              
         public void onSuccess(LaunchResult result) {
                                                 
                 //Your logic
                                                 
         }
         @Override                                  
         public void onFailure(String errorCode, String errorMessage) {
                 //Your logic
         }
                                             
    }
);