XYPayHelpler.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // XYPayHelpler.h
  3. // Starbuds
  4. //
  5. // Created by 翟玉磊 on 2019/12/23.
  6. // Copyright © 2019 翟玉磊. 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 XYPayHelpler : NSObject
  15. /// 当前选中的支付类型
  16. @property (nonatomic, readonly, assign) NSInteger currentPayType;
  17. /// 当前的支付状态
  18. @property (nonatomic, readonly, assign) NSInteger payStatus;
  19. // 默认1星芽 2稀客
  20. @property (nonatomic, assign) NSInteger appType;
  21. /// 回去订单支付信息和支付参数
  22. /// @param orderId 订单Id
  23. /// @param payType 支付方式 101苹果支付 201支付宝 301微信
  24. /// @param itemId 商品id
  25. /// @param successHandler 请求成功
  26. /// @param failureHandler 请求失败
  27. - (void)addPayOrderWithOrderId:(NSString *)orderId payType:(NSInteger)payType itemId:(NSString *)itemId successHandler:(nonnull PayHelplerSuccessBlock)successHandler failureHandler:(nonnull PayHelplerFailureBlock)failureHandler;
  28. /// 调用支付SDK
  29. /// @param orderId 订单Id
  30. /// @param payType 支付方式 101苹果支付 201支付宝 301微信
  31. /// @param itemId 商品id
  32. /// @param payParams 支付参数
  33. /// @param successHandler 请求成功
  34. /// @param failureHandler 请求失败
  35. - (void)starPayWithOrderId:(NSString *)orderId payType:(NSInteger)payType itemId:(NSString *)itemId payParams:(NSString *)payParams successHandler:(nonnull PayHelplerSuccessBlock)successHandler failureHandler:(nonnull PayHelplerFailureBlock)failureHandler;
  36. @end
  37. NS_ASSUME_NONNULL_END