Alipay+Alipay+

decode

The Alipay+ client SDK calls the decode API to decode entry codes and obtain the order information from the Mobile Payment Partner (MPP) app. For entry codes to work, the MPP must implement the decode API.

Method signature

copy
NS_ASSUME_NONNULL_BEGIN
@protocol MPPAlipayPlusClientMPMProtocol <NSObject>
- (void)decode:(MPPDecodeServiceParams *)params
    payCompletionHandler:(void(^)(MPPDecodeServiceResult *_Nullable result, NSError * _Nullable error))payCompletionHandler;
@end
NS_ASSUME_NONNULL_END

Request parameters

Item

Type

Description

Required

params

MPPDecodeServiceParams

The parameters that are required to obtain the order information.

M

payCompletionHandler

iOS Block

The callback to be invoked after the decoding process ends. See payCompletionHandler or details.

M

payCompletionHandler

Item

Type

Description

Required

result

MPPDecodeServiceResult

The result information that is required if the decoding is successful.

O

Response parameters

N/A

Sample

Definition of YOUR_MPM_SERVICE_CLASS:

copy
#import <MPPAlipayPlusClientMPM/MPPAlipayPlusClientMPM.h>

@interface YOUR_MPM_SERVICE_CLASS: NSObject <MPPAlipayPlusClientMPMProtocol>
- (void)decode:(MPPDecodeServiceParams *)params
    payCompletionHandler:(void(^)(MPPDecodeServiceResult *_Nullable result, NSError * _Nullable error))payCompletionHandler;
@end

@implementation YOUR_MPM_SERVICE_CLASS

- (void)decode:(MPPDecodeServiceParams *)params
    payCompletionHandler:(void(^)(MPPDecodeServiceResult *_Nullable result, NSError * _Nullable error))payCompletionHandler; {
 // Invoke the cashier after receiving the request from Alipay+
 payCompletionHandler(result, nil); //Payment success
 }
@end

Instance of YOUR_MPM_SERVICE_CLASS:

copy
#import <MPPAlipayPlusClientMPM/MPPAlipayPlusClientMPM.h>

[MPPAlipayPlustClient shared].mpmService = YOUR_MPM_SERVICE_CLASS.new