BTPayPalIDToken.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #import <Foundation/Foundation.h>
  2. NS_ASSUME_NONNULL_BEGIN
  3. /**
  4. An authorization token used to initialize the Braintree SDK
  5. */
  6. @interface BTPayPalIDToken : NSObject
  7. /**
  8. Initialize a PayPal ID Token with an ID Token string.
  9. */
  10. - (nullable instancetype)initWithIDTokenString:(NSString *)payPalIDToken error:(NSError **)error NS_DESIGNATED_INITIALIZER;
  11. /**
  12. Base initializer - do not use.
  13. */
  14. - (instancetype)init __attribute__((unavailable("Please use initWithPayPalIDToken:error: instead.")));
  15. /**
  16. The extracted authorization fingerprint
  17. */
  18. @property (nonatomic, readonly, copy) NSString *token;
  19. /**
  20. The extracted configURL
  21. */
  22. @property (nonatomic, readonly, strong) NSURL *configURL;
  23. /**
  24. The base Braintree URL
  25. */
  26. @property (nonatomic, readonly, strong) NSURL *baseBraintreeURL;
  27. /**
  28. The base PayPal URL
  29. */
  30. @property (nonatomic, readonly, strong) NSURL *basePayPalURL;
  31. /**
  32. The PayPal merchant ID embedded in the token
  33. */
  34. @property (nonatomic, readonly, strong) NSString *paypalMerchantID;
  35. /**
  36. The Braintree merchant ID embedded in the token
  37. */
  38. @property (nonatomic, readonly, strong) NSString *braintreeMerchantID;
  39. /**
  40. Environment codes associated with PayPal ID Token.
  41. */
  42. typedef NS_ENUM(NSInteger, BTPayPalIDTokenEnvironment) {
  43. /// Staging
  44. BTPayPalIDTokenEnvironmentStage = 0,
  45. /// Sandbox
  46. BTPayPalIDTokenEnvironmentSand = 1,
  47. /// Production
  48. BTPayPalIDTokenEnvironmentProd = 2
  49. };
  50. /**
  51. The environment context of the provided PayPal ID Token
  52. */
  53. @property (nonatomic, readonly, assign) BTPayPalIDTokenEnvironment environment;
  54. /**
  55. Error codes associated with a PayPal ID Token.
  56. */
  57. typedef NS_ENUM(NSInteger, BTPayPalIDTokenError) {
  58. /// Unknown error
  59. BTPayPalIDTokenErrorUnknown = 0,
  60. /// Invalid
  61. BTPayPalIDTokenErrorInvalid,
  62. /// Missing associated merchant ID
  63. BTPayPalIDTokenErrorUnlinkedAccount,
  64. };
  65. @end
  66. NS_ASSUME_NONNULL_END