BTThreeDSecureLookup.m 808 B

1234567891011121314151617181920212223242526272829303132
  1. #import "BTThreeDSecureLookup_Internal.h"
  2. #if __has_include(<Braintree/BraintreeThreeDSecure.h>)
  3. #import <Braintree/BraintreeCore.h>
  4. #else
  5. #import <BraintreeCore/BraintreeCore.h>
  6. #endif
  7. @implementation BTThreeDSecureLookup
  8. - (instancetype)initWithJSON:(BTJSON *)json {
  9. self = [super init];
  10. if (self) {
  11. _PAReq = [json[@"pareq"] asString];
  12. _MD = [json[@"md"] asString];
  13. _acsURL = [json[@"acsUrl"] asURL];
  14. _termURL = [json[@"termUrl"] asURL];
  15. _threeDSecureVersion = [json[@"threeDSecureVersion"] asString];
  16. _transactionID = [json[@"transactionId"] asString];
  17. }
  18. return self;
  19. }
  20. - (BOOL)requiresUserAuthentication {
  21. return self.acsURL != nil;
  22. }
  23. - (BOOL)isThreeDSecureVersion2 {
  24. return [self.threeDSecureVersion hasPrefix:@"2."];
  25. }
  26. @end