Alipay+ DocsAlipay+ Docs

inquirePaymentOption

The inquirePaymentOption API is used to inquire whether the Alipay+ payment method is available and if so, related data about the Alipay+ payment method, such as the Alipay+ logo, brand name, and promotion information.

You can directly render the payment method page based on the data about the Alipay+ payment method. Alternatively, you can process the data about the Alipay+ payment method and append the processing result to the data about your existing payment methods, and then render the payment method page accordingly.

To improve loading performance and reduce data transfer costs, it is recommended that you cache the image of the Alipay+ logo by its CDN URL.

Method signature

copy
public static void inquirePaymentOption(Context context, IAPInquirePaymentOptionParams params, IAPInquirePaymentCallback<IAPPaymentOption> callback);

Request parameters

Name

Type

Length

Description

Required

context

Context

/

The context of the Android activity.

M

params

IAPInquirePaymentOptionParams

/

An object that contains the parameters for querying the data about the Alipay+ payment method.

M

callback

IAPInquirePaymentCallback<IAPPaymentOption>

/

The callback that is used to return the query result. See callback for details.

M

callback

Name

Type

Length

Description

Required

paymentOption

IAPPaymentOption

/

The data about the Alipay+ payment method.

This parameter is returned if the inquiry is successful.

O

errorCode

String

/

The error code about the inquiry.

This parameter is returned if the inquiry failed. See ErrorCode for details.

O

errorMessage

String

/

The error message about the inquiry.

This parameter is returned if the inquiry failed. See ErrorCode for details.

O

Response parameters

N/A

Sample

copy
IAPInquirePaymentOptionParams params = new IAPInquirePaymentOptionParams();
params.paymentCurrency = "PHP";
params.logoPattern = "YYY";
AlipayPlusClient.inquirePaymentOption(context, params, new IAPInquirePaymentCallback() {

    @override
    public void onSuccess(IAPPaymentOption paymentOption) {
    
        //render your chekout element view
    
    }
    
    public void onFailure(String errorCode, String errorMessage) {
    
        //continue to execute your own logic
    
    }

})