BGInterface.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #import <Foundation/Foundation.h>
  2. #import <UIKit/UIKit.h>
  3. #import "BGParam.h"
  4. @protocol FWInterfaceDelegate <NSObject>
  5. @required
  6. /*
  7. 支付的结果回调
  8. payid: 单号
  9. success: YES支付成功,NO支付失败
  10. message: 结果详细信息
  11. */
  12. - (void)receiveResult:(NSString*)payid result:(BOOL)success message:(NSString*)message;
  13. @optional
  14. /**
  15. @abstract Api版本的SDK返回通道信息
  16. @param types 通道代码数组 1微信支付,2支付宝支付,3点卡支付,4银联支付,QQ支付5,百度支付6,京东支付7
  17. */
  18. - (void)receiveChannelTypes:(NSArray<NSNumber *>*)types;
  19. @end
  20. @interface BGInterface : NSObject
  21. /*
  22. @abstract 初始化接口
  23. @params appId:APP的唯一标识,由凡伟提供
  24. @params wxAppId:在微信开放平台注册的WXAppId。
  25. */
  26. + (void)init:(NSString *)appId useAPI:(BOOL)useAPI withWXAppId:(NSString *)wxAppId;
  27. /**
  28. @abstract API版本直接支付
  29. @params controller 视图控制器
  30. @params params 支付参数
  31. @params type 通道代码数组 1微信支付,2支付宝支付,3点卡支付,4银联支付,QQ支付5,百度支付6,京东支付7
  32. @params delegate 支付回调的代理
  33. */
  34. + (void)start:(UIViewController *)controller withParams:(BGParam *)params withType:(NSUInteger)type withDelegate:(id<FWInterfaceDelegate>)delegate;
  35. /*
  36. 启动接口
  37. controller 视图控制器
  38. params 支付参数
  39. delegate 支付回调对象
  40. 推荐使用这种
  41. */
  42. + (void)start:(UIViewController *)controller withParams:(BGParam*)params withDelegate:(id<FWInterfaceDelegate>)delegate;
  43. /*
  44. 启动接口
  45. controller 视图控制器
  46. params 支付参数
  47. delegate 支付回调对象
  48. */
  49. + (void)start:(UIViewController *)controller withParams:(BGParam*)params withDelegate:(id<FWInterfaceDelegate>)delegate withView:(UIView*)view;
  50. /*
  51. 选择通道下单
  52. */
  53. + (void)selectChannel:(NSInteger)channelType;
  54. /*
  55. 应用进入后台
  56. */
  57. + (void)applicationWillEnterForeground:(UIApplication *)application;
  58. @end