12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //
- // XYPayHelpler.h
- // Starbuds
- //
- // Created by 翟玉磊 on 2019/12/23.
- // Copyright © 2019 翟玉磊. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- NS_ASSUME_NONNULL_BEGIN
- /// 支付成功回调
- typedef void(^PayHelplerSuccessBlock)(NSInteger payType);
- /// 支付失败回调 payType如果是999则说明创建支付订单就失败了没有获取到支付信息
- typedef void(^PayHelplerFailureBlock)(NSInteger payStatus, NSString *message, NSInteger payType);
- @interface XYPayHelpler : NSObject
- /// 当前选中的支付类型
- @property (nonatomic, readonly, assign) NSInteger currentPayType;
- /// 当前的支付状态
- @property (nonatomic, readonly, assign) NSInteger payStatus;
- // 默认1星芽 2稀客
- @property (nonatomic, assign) NSInteger appType;
- /// 回去订单支付信息和支付参数
- /// @param orderId 订单Id
- /// @param payType 支付方式 101苹果支付 201支付宝 301微信
- /// @param itemId 商品id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (void)addPayOrderWithOrderId:(NSString *)orderId payType:(NSInteger)payType itemId:(NSString *)itemId successHandler:(nonnull PayHelplerSuccessBlock)successHandler failureHandler:(nonnull PayHelplerFailureBlock)failureHandler;
- /// 调用支付SDK
- /// @param orderId 订单Id
- /// @param payType 支付方式 101苹果支付 201支付宝 301微信
- /// @param itemId 商品id
- /// @param payParams 支付参数
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (void)starPayWithOrderId:(NSString *)orderId payType:(NSInteger)payType itemId:(NSString *)itemId payParams:(NSString *)payParams successHandler:(nonnull PayHelplerSuccessBlock)successHandler failureHandler:(nonnull PayHelplerFailureBlock)failureHandler;
- @end
- NS_ASSUME_NONNULL_END
|