BTThreeDSecureInfo.m 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #import "BTThreeDSecureInfo.h"
  2. @interface BTThreeDSecureInfo ()
  3. @property (nonatomic, strong) BTJSON *threeDSecureJSON;
  4. @end
  5. @implementation BTThreeDSecureInfo
  6. - (instancetype)initWithJSON:(BTJSON *)json {
  7. if (self = [super init]) {
  8. if (json != nil) {
  9. _threeDSecureJSON = json;
  10. } else {
  11. _threeDSecureJSON = [BTJSON new];
  12. }
  13. }
  14. return self;
  15. }
  16. - (NSString *)acsTransactionId {
  17. return [self.threeDSecureJSON[@"acsTransactionId"] asString];
  18. }
  19. - (NSString *)authenticationTransactionStatus {
  20. return [self.threeDSecureJSON[@"authentication"][@"transStatus"] asString];
  21. }
  22. - (NSString *)authenticationTransactionStatusReason {
  23. return [self.threeDSecureJSON[@"authentication"][@"transStatusReason"] asString];
  24. }
  25. - (NSString *)cavv {
  26. return [self.threeDSecureJSON[@"cavv"] asString];
  27. }
  28. - (NSString *)dsTransactionId {
  29. return [self.threeDSecureJSON[@"dsTransactionId"] asString];
  30. }
  31. - (NSString *)eciFlag {
  32. return [self.threeDSecureJSON[@"eciFlag"] asString];
  33. }
  34. - (NSString *)enrolled {
  35. return [self.threeDSecureJSON[@"enrolled"] asString];
  36. }
  37. - (BOOL)liabilityShifted {
  38. return [self.threeDSecureJSON[@"liabilityShifted"] isTrue];
  39. }
  40. - (BOOL)liabilityShiftPossible {
  41. return [self.threeDSecureJSON[@"liabilityShiftPossible"] isTrue];
  42. }
  43. - (NSString *)lookupTransactionStatus {
  44. return [self.threeDSecureJSON[@"lookup"][@"transStatus"] asString];
  45. }
  46. - (NSString *)lookupTransactionStatusReason {
  47. return [self.threeDSecureJSON[@"lookup"][@"transStatusReason"] asString];
  48. }
  49. - (NSString *)paresStatus {
  50. return [self.threeDSecureJSON[@"paresStatus"] asString];
  51. }
  52. - (NSString *)status {
  53. return [self.threeDSecureJSON[@"status"] asString];
  54. }
  55. - (NSString *)threeDSecureAuthenticationId {
  56. return [self.threeDSecureJSON[@"threeDSecureAuthenticationId"] asString];
  57. }
  58. - (NSString *)threeDSecureServerTransactionId {
  59. return [self.threeDSecureJSON[@"threeDSecureServerTransactionId"] asString];
  60. }
  61. - (NSString *)threeDSecureVersion {
  62. return [self.threeDSecureJSON[@"threeDSecureVersion"] asString];
  63. }
  64. - (BOOL)wasVerified {
  65. return ![self.threeDSecureJSON[@"liabilityShifted"] isError] &&
  66. ![self.threeDSecureJSON[@"liabilityShiftPossible"] isError];
  67. }
  68. - (NSString *)xid {
  69. return [self.threeDSecureJSON[@"xid"] asString];
  70. }
  71. @end