# signContract

> The MPP app calls the signContract API to start the user authorization process for Auto Debit payment.

The Mobile Payment Provider (MPP) app calls the **signContract** API to **start the user** authorization process for Auto Debit payments.

## Method signature

```java
public class AlipayPlusClientAutoDebit{

    void signContract(SignContractParams params, Callback<SignContractResult> callback);

}
```

## Request parameters

| **Item** | **Type** | **Description** | **Required** |
| --- | --- | --- | --- |
| params | [SignContractParams](android_appendix#uw4Nr) | Parameters that are required to initiate a contract. | M |
| callback | Callback | The callback to be invoked after the signing process ends. See [Callback](#iMNMO) for details. | M |

#### Callback

| **Item** | **Type** | **Description** | **Required** |
| --- | --- | --- | --- |
| result | [SignContractResult](android_appendix#Pe07J) | The result information that is required if the signing is successful. | O |
| errorCode | String | The error code that is required if the signing fails. | O |
| errorMessage | String | The error message that is required if the signing fails. | O |

## Response parameters

N/A

## Sample

```java
SignContractParams params = new SignContractParams;
Intent intent = getIntent();
Uri data = intent.getData();
params.needCallback = data.getBooleanQueryParameter("needCallback", false);
params.authUrl = data.toString();
AlipayPlusClientAutoDebit.getInstance().signContract(this, params, new Callback<SignContractResult>() {
        @Override
        public void onSuccess(SignContractResult result) {

        }

        @Override
        public void onFailure(String errorCode, String errorMessage) {
        }
});
```