Alipay+Alipay+

decode

The Alipay+ client SDK calls the decode API to decode entry codes and obtain the order information from the Mobile Payment Partner (MPP) app. For entry codes to work, the MPP must implement the decode API.

Method signature

copy
public interface MPMService {
    
    void decode(DecodeServiceParams params, Callback<DecodeServiceResult> callback);
    
}

Request parameters

Item

Type

Description

Required

params

DecodeServiceParams

The parameters that are required to obtain the order information.

M

callback

Callback

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

M

Callback

Item

Type

Description

Required

result

DecodeServiceResult

The result information that is required if the decoding is successful.

O

Response parameters

N/A

Sample

Definition of YOUR_MPM_SERVICE_CLASS:

copy
public class YOUR_MPM_SERVICE_CLASS implements MPMService {

    public void decode(DecodeServiceParams params, Callback<DecodeServiceResult> callback) {
    
        //Invoke the cashier after receiving the request from Alipay+
        //On success
        DecodeServiceResult result = new DecodeServiceResult();
        callback.onSuccess(result)
        //On failure
        callback.onFailure(errorCode, errorMessage);
        
    }


}

Instance of YOUR_MPM_SERVICE_CLASS:

copy
AlipayPlusClientMPM.getInstance().mpmService = new YOUR_MPM_SERVICE_CLASS();