BTAPIClient_Internal.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #if __has_include(<Braintree/BraintreeCore.h>)
  2. #import <Braintree/BTAPIClient.h>
  3. #else
  4. #import <BraintreeCore/BTAPIClient.h>
  5. #endif
  6. @class BTAnalyticsService;
  7. @class BTAPIHTTP;
  8. @class BTClientMetadata;
  9. @class BTClientToken;
  10. @class BTGraphQLHTTP;
  11. @class BTHTTP;
  12. @class BTJSON;
  13. @class BTPaymentMethodNonce;
  14. NS_ASSUME_NONNULL_BEGIN
  15. typedef NS_ENUM(NSInteger, BTAPIClientAuthorizationType) {
  16. BTAPIClientAuthorizationTypeTokenizationKey = 0,
  17. BTAPIClientAuthorizationTypeClientToken,
  18. };
  19. @interface BTAPIClient ()
  20. @property (nonatomic, copy, nullable) NSString *tokenizationKey;
  21. @property (nonatomic, strong, nullable) BTClientToken *clientToken;
  22. @property (nonatomic, strong) BTHTTP *http;
  23. @property (nonatomic, strong) BTHTTP *configurationHTTP;
  24. @property (nonatomic, strong) BTAPIHTTP *braintreeAPI;
  25. @property (nonatomic, strong) BTGraphQLHTTP *graphQL;
  26. /**
  27. Client metadata that is used for tracking the client session
  28. */
  29. @property (nonatomic, readonly, strong) BTClientMetadata *metadata;
  30. /**
  31. Exposed for testing analytics
  32. */
  33. @property (nonatomic, strong) BTAnalyticsService *analyticsService;
  34. /**
  35. Queues an analytics event to be sent.
  36. */
  37. - (void)queueAnalyticsEvent:(NSString *)eventName;
  38. /**
  39. An internal initializer to toggle whether to send an analytics event during initialization.
  40. It can also be used to suppress excessive network chatter during testing.
  41. */
  42. - (nullable instancetype)initWithAuthorization:(NSString *)authorization sendAnalyticsEvent:(BOOL)sendAnalyticsEvent;
  43. /**
  44. Gets base GraphQL URL
  45. */
  46. + (nullable NSURL *)graphQLURLForEnvironment:(NSString *)environment;
  47. /**
  48. Determines the BTAPIClientAuthorizationType of the given authorization string. Exposed for testing.
  49. */
  50. + (BTAPIClientAuthorizationType)authorizationTypeForAuthorization:(NSString *)authorization;
  51. @end
  52. NS_ASSUME_NONNULL_END