XYPayManager.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // XYPayManager.h
  3. // Starbuds
  4. //
  5. // Created by 翟玉磊 on 2020/1/19.
  6. // Copyright © 2020 翟玉磊. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. /// 支付成功回调
  11. typedef void(^PayHelplerSuccessBlock)(NSInteger payType);
  12. /// 支付失败回调 payType如果是999则说明创建支付订单就失败了没有获取到支付信息
  13. typedef void(^PayHelplerFailureBlock)(NSInteger payStatus, NSString *message, NSInteger payType);
  14. @interface XYPayManager : NSObject
  15. // 默认1星芽 2稀客
  16. @property (nonatomic, assign) NSInteger appType;
  17. /// 回去订单支付信息和支付参数
  18. /// @param orderId 订单Id
  19. /// @param payType 支付方式 101苹果支付 201支付宝 301微信
  20. /// @param itemId 商品id
  21. /// @param successHandler 请求成功
  22. /// @param failureHandler 请求失败
  23. - (void)addPayOrderWithOrderId:(NSString *)orderId payType:(NSInteger)payType itemId:(NSString *)itemId successHandler:(nonnull PayHelplerSuccessBlock)successHandler failureHandler:(nonnull PayHelplerFailureBlock)failureHandler;
  24. /// 调用支付SDK
  25. /// @param orderId 订单Id
  26. /// @param payType 支付方式 101苹果支付 201支付宝 301微信
  27. /// @param itemId 商品id
  28. /// @param payParams 支付参数
  29. /// @param successHandler 请求成功
  30. /// @param failureHandler 请求失败
  31. - (void)starPayWithOrderId:(NSString *)orderId payType:(NSInteger)payType itemId:(NSString *)itemId payParams:(NSString *)payParams successHandler:(nonnull PayHelplerSuccessBlock)successHandler failureHandler:(nonnull PayHelplerFailureBlock)failureHandler;
  32. @end
  33. NS_ASSUME_NONNULL_END