# 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

```objectivec
@interface MPPAlipayPlusClient (AutoDebit)
- (void)signContract:(MPPSignContractParams *)params
   completionHandler:(void(^)(MPPSignContractResult * _Nullable result, NSError *_Nullable error))completionHandler
@end
```

## Request parameters

| **Item** | **Type** | **Description** | **Required** |
| --- | --- | --- | --- |
| params | [MPPSignContractParams](ios_appendix#uw4Nr) | Parameters that are required to initiate a contract. | M |
| completionHandler | iOS Block | The callback to be invoked after the signing process ends. See [completionHandler](#gQI7N) for details. | M |

#### completionHandler

| **Item** | **Type** | **Description** | **Required** |
| --- | --- | --- | --- |
| result | [MPPSignContractResult](ios_appendix#Pe07J) | The result information that is required if the signing is successful. | O |
| error | NSError | The error that is required if the signing fails. | O |

## Response parameters

N/A

## Sample

```objectivec
#import <MPPAlipayPlusClientAutoDebit/MPPAlipayPlusClientAutoDebit.h>

MPPSignContractParams *params = [MPPSignContractParams new];
params.authUrl = @"xxx";
params.needCallback = true; // needCallback is always a query value in authUrl, such as “xxx?needCallback=true”

[[MPPAlipayPlusClient shared] signContract:params
                         completionHandler:^(MPPSignContractResult * _Nullable result, NSError *_Nullable error) {
             if (!error) {
             // your Logic
             }
 }];

```