BTPaymentFlowDriver+ThreeDSecure.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #if __has_include(<Braintree/BraintreeThreeDSecure.h>)
  2. #import <Braintree/BTPaymentFlowDriver.h>
  3. #else
  4. #import <BraintreePaymentFlow/BTPaymentFlowDriver.h>
  5. #endif
  6. NS_ASSUME_NONNULL_BEGIN
  7. /**
  8. Domain for 3D Secure flow errors.
  9. */
  10. extern NSString * const BTThreeDSecureFlowErrorDomain;
  11. /**
  12. Error codes associated with 3D Secure flow.
  13. */
  14. typedef NS_ENUM(NSInteger, BTThreeDSecureFlowErrorType) {
  15. /// Unknown error
  16. BTThreeDSecureFlowErrorTypeUnknown = 0,
  17. /// 3D Secure failed during the backend card lookup phase; please retry
  18. BTThreeDSecureFlowErrorTypeFailedLookup,
  19. /// 3D Secure failed during the user-facing authentication phase; please retry
  20. BTThreeDSecureFlowErrorTypeFailedAuthentication,
  21. /// 3D Secure was not configured correctly
  22. BTThreeDSecureFlowErrorTypeConfiguration,
  23. };
  24. /**
  25. Category on BTPaymentFlowDriver for 3D Secure
  26. */
  27. @interface BTPaymentFlowDriver (ThreeDSecure)
  28. /**
  29. Creates a stringified JSON object containing the information necessary to perform a lookup.
  30. @param request The BTThreeDSecureRequest object where prepareLookup was called.
  31. @param completionBlock This completion will be invoked exactly once with the client payload string or an error.
  32. */
  33. - (void)prepareLookup:(BTPaymentFlowRequest<BTPaymentFlowRequestDelegate> *)request completion:(void (^)(NSString * _Nullable lookupPayload, NSError * _Nullable error))completionBlock;
  34. /**
  35. Initialize a challenge from a server side lookup call.
  36. @param lookupResponse The json string returned by the server side lookup.
  37. @param request The BTThreeDSecureRequest object where prepareLookup was called.
  38. @param completionBlock This completion will be invoked exactly once when the payment flow is complete or an error occurs.
  39. */
  40. - (void)initializeChallengeWithLookupResponse:(NSString *)lookupResponse request:(BTPaymentFlowRequest<BTPaymentFlowRequestDelegate> *)request completion:(void (^)(BTPaymentFlowResult * _Nullable result, NSError * _Nullable error))completionBlock;
  41. @end
  42. NS_ASSUME_NONNULL_END