BTPaymentMethodNonce.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #import "BTPaymentMethodNonce.h"
  2. @interface BTPaymentMethodNonce ()
  3. @property (nonatomic, copy, readwrite) NSString *nonce;
  4. @property (nonatomic, copy, readwrite) NSString *localizedDescription;
  5. @property (nonatomic, copy, readwrite) NSString *type;
  6. @property (nonatomic, readwrite, assign) BOOL isDefault;
  7. @end
  8. @implementation BTPaymentMethodNonce
  9. - (instancetype)initWithNonce:(NSString *)nonce localizedDescription:(NSString *)description type:(NSString *)type {
  10. if (!nonce) return nil;
  11. if (self = [super init]) {
  12. self.nonce = nonce;
  13. self.localizedDescription = description;
  14. self.type = type;
  15. }
  16. return self;
  17. }
  18. - (nullable instancetype)initWithNonce:(NSString *)nonce localizedDescription:(nullable NSString *)description {
  19. return [self initWithNonce:nonce localizedDescription:description type:@"Unknown"];
  20. }
  21. - (nullable instancetype)initWithNonce:(NSString *)nonce localizedDescription:(NSString *)description type:(nonnull NSString *)type isDefault:(BOOL)isDefault {
  22. if (self = [self initWithNonce:nonce localizedDescription:description type:type]) {
  23. _isDefault = isDefault;
  24. }
  25. return self;
  26. }
  27. @end