Files
CustomPlugin/Libs/UPPaymentControl/UPPaymentControl.h
2026-05-10 14:55:18 +08:00

76 lines
2.4 KiB
Objective-C
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// PaymentControl.h
// PaymentControl
//
// Created by qcao on 15/10/20.
// Copyright © 2015年 China Unionpay Co.,Ltd. All rights reserved.
// v3.4.10 build1(mini)
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef void (^UPPaymentResultBlock)(NSString* code, NSDictionary* data);
typedef void (^UPPaymentDirectAppSucc)(NSArray* directApps);
typedef void (^UPPaymentDirectAppFail)(NSString* code,NSString* msg);
@interface UPPaymentControl : NSObject
/**
* 创建支付单例服务
*
* @return 返回单例对象
*/
+ (UPPaymentControl *)defaultControl;
/**
* 支付接口
*
* @param tn 订单信息
* @param schemeStr 调用支付的app注册在info.plist中的scheme
* @param mode 支付环境
* @param viewController 启动支付控件的viewController
* @return 返回成功失败
*/
- (BOOL)startPay:(NSString*)tn
fromScheme:(NSString *)schemeStr
mode:(NSString*)mode
viewController:(UIViewController*)viewController;
/// APP是否已安装检测接口通过该接口得知用户是否安装银联支付的APP。
/// @param mode 支付环境
/// @param merchantInfo 商户标识
- (BOOL)isPaymentAppInstalled:(NSString*)mode withMerchantInfo:(NSString *)merchantInfo;
/**
* 通过回调异步返回直通可用app列表
* @param mode 支付环境
* @param merchantInfo 商户标识
* @param succBlock 成功回调回调参数directApps表示直通可用app列表如无可用App则directApps为空数组@[]
* @param succBlock 失败回调回调参数一code表示错误码参数错误 : 01网络错误 : 02其它 : 03
* 回调参数二msg表示错误信息参数错误 : parameter error网络错误 : network error其它 : unknown error
*/
- (void)getDirectApps:(NSString*)mode
withMerchantInfo:(NSString*)merchantInfo
succBlock:(UPPaymentDirectAppSucc)succBlock
failBlock:(UPPaymentDirectAppFail)failBlock;
/**
* 处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url
*
* @param url 支付结果url传入后由SDK解析
* @param completionBlock 结果回调保证跳转钱包支付过程中即使调用方app被系统kill时能通过这个回调取到支付结果。
*/
- (void)handlePaymentResult:(NSURL*)url completeBlock:(UPPaymentResultBlock)completionBlock;
@end