Alipay+ DocsAlipay+ Docs

inquireQuote

The Mobile Payment Provider (MPP) app uses the inquireQuote API to query the exchange rate between a pair of currencies. However, the exchange rate returned by Alipay+ is only for reference.

Method signature

copy
NS_ASSUME_NONNULL_BEGIN

@interface MPPAlipayPlusClient : NSObject
+ (instancetype)shared;
- (void)inquireQuote:(MPPInquireQuoteParams *)params
   completionHandler:(void(^)(MPPInquireQuoteResult * _Nullable result, NSError *  _Nullable error))completionHandler;
@end

NS_ASSUME_NONNULL_END

Request parameters

Item

Type

Description

Required

params

MPPInquireQuoteParams

Parameters that are required for the exchange rate inquiry.

M

completionHandler

iOS Block

The callback to be invoked after the process of exchange rate inquiry ends. See completionHandler for details.

M

completionHandler

Item

Type

Description

Required

result

MPPInquireQuoteResult

The exchange rate inquiry result that is required if the inquiry is successful.

O

error

NSError

The error code that is required if the inquiry fails.

O

Response parameters

N/A

Sample

copy
#import <MPPAlipayPlusClient/MPPAlipayPlusClientAPI.h>

MPPInquireQuoteParams *params = [MPPInquireQuoteParams new];
params.buyCurrency = @"SGD";
params.sellCurrency = @"USD";
[[AlipayPlusClient shared] inquireQuote:params completionHandler:^(MPPInquireQuoteResult * _Nullable result, NSError *  _Nullable error){
        if (!error){
            // Your logic
        }
}]