BTPaymentMethodNonce.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #import <Foundation/Foundation.h>
  2. NS_ASSUME_NONNULL_BEGIN
  3. /**
  4. BTPaymentMethodNonce is for generic tokenized payment information.
  5. For example, if a customer's vaulted payment methods contains a type that's not recognized or supported by the
  6. Braintree SDK or the client-side integration (e.g. the vault contains a PayPal account but the client-side
  7. integration does not include the PayPal component), this type can act as a fallback.
  8. The payment method nonce is a public token that acts as a placeholder for sensitive payments data that
  9. has been uploaded to Braintree for subsequent processing. The nonce is safe to access on the client and can be
  10. used on your server to reference the data in Braintree operations, such as Transaction.sale.
  11. */
  12. @interface BTPaymentMethodNonce : NSObject
  13. /**
  14. Initialize a new Payment Method Nonce.
  15. @param nonce A transactable payment method nonce.
  16. @param description A human-readable description.
  17. @param type A string identifying the type of the payment method.
  18. @return A Payment Method Nonce, or `nil` if nonce is nil.
  19. */
  20. - (nullable instancetype)initWithNonce:(NSString *)nonce localizedDescription:(nullable NSString *)description type:(NSString *)type;
  21. /**
  22. Initialize a new Payment Method Nonce.
  23. @param nonce A transactable payment method nonce.
  24. @param description A human-readable description.
  25. @return A Payment Method Nonce, or `nil` if nonce is nil.
  26. */
  27. - (nullable instancetype)initWithNonce:(NSString *)nonce localizedDescription:(nullable NSString *)description;
  28. /**
  29. Initialize a new Payment Method Nonce.
  30. @param nonce A transactable payment method nonce.
  31. @param description A human-readable description.
  32. @param type A string identifying the type of the payment method.
  33. @param isDefault A boolean indicating whether this is a default payment method.
  34. @return A Payment Method Nonce, or `nil` if nonce is nil.
  35. */
  36. - (nullable instancetype)initWithNonce:(NSString *)nonce localizedDescription:(NSString *)description type:(nonnull NSString *)type isDefault:(BOOL)isDefault;
  37. /**
  38. The one-time use payment method nonce
  39. */
  40. @property (nonatomic, readonly, copy) NSString *nonce;
  41. /**
  42. A localized description of the payment info
  43. */
  44. @property (nonatomic, readonly, copy) NSString *localizedDescription;
  45. /**
  46. The type of the tokenized data, e.g. PayPal, Venmo, MasterCard, Visa, Amex
  47. */
  48. @property (nonatomic, readonly, copy) NSString *type;
  49. /**
  50. True if this nonce is the customer's default payment method, otherwise false.
  51. */
  52. @property (nonatomic, readonly, assign) BOOL isDefault;
  53. @end
  54. NS_ASSUME_NONNULL_END