showAuthPage
The Alipay+ client SDK calls the showAuthPage API to display the authorization page for the user to proceed with the authorization.
Method signature
copy
public interface AutoDebitService {
void showAuthPage(SignContractOAuthServiceParams params, Callback<SignContractOAuthServiceResult> callback);
}
Request parameters
Item | Type | Description | Required |
params | Parameters that are required to render the authorization page. | M | |
callback | Callback | The callback to be invoked after the authorization process ends. See Callback for details. | M |
Callback
Item | Type | Description | Required |
result | The authorization information that is required if the authorization is successful. | O | |
errorCode | String | The error code that is required if the authorization fails. | O |
errorMessage | String | The error message that is required if the authorization fails. | O |
Response parameters
N/A
Sample
Definition of YOUR_AUTODEBIT_SERVICE_CLASS
:
copy
public class YOUR_AUTODEBIT_SERVICE_CLASS implements AutoDebitService {
public void showAuthPage(SignContractOauthServiceParams params, Callback<SignContractOAuthServiceResult> callback) {
//Open the authUrl
// Callback when user confirms authorization
SignContractOAuthServiceResult result = new SignContractOAuthServiceResult();
callback.onSuccess(result);
// Callback when authorization fails
callback.onFailure(errorCode, errorMessage);
}
}
Instance of YOUR_AUTODEBIT_SERVICE_CLASS
:
copy
AlipayPlusClientAutoDeibt.getInstance().autoDebitService = new YOUR_AUTODEBIT_SERVICE_CLASS;