Alipay+ DocsAlipay+ Docs

signContract

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

Method signature

copy
@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

Parameters that are required to initiate a contract.

M

completionHandler

iOS Block

The callback to be invoked after the signing process ends. See completionHandler for details.

M

completionHandler

Item

Type

Description

Required

result

MPPSignContractResult

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

copy
#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
             }
 }];