public void CardHolderEnrolled_ChallengeRequired_v2_Initiate_WithShippingMethod() { var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); AssertThreeDSResponse(secureEcom, AVAILABLE); var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithShippingMethod(ShippingMethod.DIGITAL_GOODS) .WithShippingNameMatchesCardHolderName(true) .WithShippingAddressCreateDate(DateTime.Now) .WithShippingAddressUsageIndicator(AgeIndicator.LESS_THAN_THIRTY_DAYS) .Execute(); AssertThreeDSResponse(initAuth, CHALLENGE_REQUIRED); Assert.IsTrue(initAuth.ChallengeMandated); }
public void CardHolderEnrolled_ChallengeRequired_v2_Initiate_Without_PaymentMethod() { var secureEcom = new ThreeDSecure { ServerTransactionId = "AUT_" + Guid.NewGuid().ToString().Replace("-", "") }; var exceptionCaught = false; try { card = new CreditCardData(); Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithOrderCreateDate(DateTime.Now) .WithBrowserData(browserData) .Execute(); } catch (GatewayException ex) { exceptionCaught = true; Assert.AreEqual("40005", ex.ResponseMessage); Assert.AreEqual("MANDATORY_DATA_MISSING", ex.ResponseCode); Assert.AreEqual( "Status Code: BadRequest - Request expects the following fields number", ex.Message); } finally { Assert.IsTrue(exceptionCaught); } }
public void CardHolderEnrolled_ChallengeRequired_v2_Initiate_MobileDataAndBrowserData() { CreditCardData challengeCard = new CreditCardData { Number = GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_2, ExpMonth = 12, ExpYear = 2025, CardHolderName = "James Mason" }; var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(Secure3dVersion.Two); AssertThreeDSResponse(secureEcom, AVAILABLE); Assert.AreEqual("ENROLLED", secureEcom.Enrolled); var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.MOBILE_SDK) .WithMobileData(mobileData) .WithBrowserData(browserData) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .Execute(Secure3dVersion.Two); AssertThreeDSResponse(initAuth, CHALLENGE_REQUIRED); }
public void CardHolderEnrolled_ChallengeRequired_v2_Initiate_NonExistentId() { var secureEcom = new ThreeDSecure { ServerTransactionId = Guid.NewGuid().ToString() }; var exceptionCaught = false; try { Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithOrderCreateDate(DateTime.Now) .WithBrowserData(browserData) .Execute(); } catch (GatewayException ex) { exceptionCaught = true; Assert.AreEqual("40118", ex.ResponseMessage); Assert.AreEqual("RESOURCE_NOT_FOUND", ex.ResponseCode); Assert.AreEqual( "Status Code: NotFound - Authentication " + secureEcom.ServerTransactionId + " not found at this location.", ex.Message); } finally { Assert.IsTrue(exceptionCaught); } }
public void CardHolderEnrolled_Frictionless_v2_Initiate_AllPreferenceValues_ChallengeRequired(ChallengeRequestIndicator preference) { card.Number = GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1; var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); AssertThreeDSResponse(secureEcom, AVAILABLE); Assert.IsFalse(secureEcom.ChallengeMandated); var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithChallengeRequestIndicator(preference) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); Assert.IsNotNull(initAuth); Assert.AreEqual(ENROLLED, initAuth.Enrolled, "Card not enrolled"); Assert.AreEqual(Secure3dVersion.Two, initAuth.Version); Assert.AreEqual(CHALLENGE_REQUIRED, initAuth.Status); Assert.IsTrue(initAuth.ChallengeMandated); }
public void FullCycle_v2_EOS_Block() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); try { // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(800m) .WithCurrency("EUR") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithEnableExemptionOptimization(true) .Execute(); } catch (GatewayException ex) { var message = ex.Message.Replace("\n", "").Replace("\r", "").Replace("\"", "'"); Assert.AreEqual(@"Status Code: Accepted - { 'eos_reason' : 'Blocked by Transaction Risk Analysis.'}", message); } } else { Assert.Fail("Card not enrolled."); } }
public void CardHolderEnrolled_Frictionless_v2_Initiate() { card.Number = GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1; var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); AssertThreeDSResponse(secureEcom, AVAILABLE); Assert.IsFalse(secureEcom.ChallengeMandated); var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); Assert.IsNotNull(initAuth); Assert.AreEqual(ENROLLED, initAuth.Enrolled, "Card not enrolled"); Assert.AreEqual(Secure3dVersion.Two, initAuth.Version); Assert.AreEqual(SUCCESS_AUTHENTICATED, initAuth.Status); Assert.IsFalse(initAuth.ChallengeMandated); Assert.IsNotNull(initAuth.IssuerAcsUrl); Assert.IsNotNull(initAuth.PayerAuthenticationRequest); Assert.IsNotNull(initAuth.ChallengeReturnUrl); Assert.IsNotNull(initAuth.MessageType); Assert.IsNotNull(initAuth.SessionDataFieldName); Assert.AreEqual(5, initAuth.Eci); }
public void CardHolderEnrolled_ChallengeRequired_v2_Initiate_WithGiftCard() { var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); AssertThreeDSResponse(secureEcom, AVAILABLE); var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithGiftCardAmount(Amount) .WithGiftCardCount(1) .WithGiftCardCurrency(Currency) .Execute(); AssertThreeDSResponse(initAuth, CHALLENGE_REQUIRED); Assert.IsTrue(initAuth.ChallengeMandated); }
public void OptionalMobileFields() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(250m) .WithCurrency("USD") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithMethodUrlCompletion(MethodUrlCompletion.NO) // optionals .WithApplicationId("f283b3ec-27da-42a1-acea-f3f70e75bbdc") .WithSdkInterface(SdkInterface.BOTH) .WithSdkUiTypes(SdkUiType.TEXT, SdkUiType.SINGLE_SELECT, SdkUiType.MULTI_SELECT, SdkUiType.OOB, SdkUiType.HTML_OTHER) // .WithEphemeralPublicKey("{\"kty\":\"EC\",\"crv\":\"p-256\",\"x\":\"WWcpTjbOqiu_1aODllw5rYTq5oLXE_T0huCPjMIRbkI\",\"y\":\"Wz_7anIeadV8SJZUfr4drwjzuWoUbOsHp5GdRZBAAiw\"}") // .WithMaximumTimeout(5) .WithReferenceNumber("3DS_LOA_SDK_PPFU_020100_00007") .WithSdkTransactionId("b2385523-a66c-4907-ac3c-91848e8c0067") .WithEncodedData("ew0KCSJEViI6ICIxLjAiLA0KCSJERCI6IHsNCgkJIkMwMDEiOiAiQW5kcm9pZCIsDQoJCSJDMDAyIjogIkhUQyBPbmVfTTgiLA0KCQkiQzAwNCI6ICI1LjAuMSIsDQoJCSJDMDA1IjogImVuX1VTIiwNCgkJIkMwMDYiOiAiRWFzdGVybiBTdGFuZGFyZCBUaW1lIiwNCgkJIkMwMDciOiAiMDY3OTc5MDMtZmI2MS00MWVkLTk0YzItNGQyYjc0ZTI3ZDE4IiwNCgkJIkMwMDkiOiAiSm9obidzIEFuZHJvaWQgRGV2aWNlIg0KCX0sDQoJIkRQTkEiOiB7DQoJCSJDMDEwIjogIlJFMDEiLA0KCQkiQzAxMSI6ICJSRTAzIg0KCX0sDQoJIlNXIjogWyJTVzAxIiwgIlNXMDQiXQ0KfQ0K") .Execute(); Assert.IsNotNull(initAuth); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("AUTHENTICATION_SUCCESSFUL")) { Transaction response = card.Charge(10.01m) .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); } else { Assert.Fail("Signature verification failed."); } } else { Assert.Fail("Card not enrolled."); } }
public void CardHolderEnrolled_ChallengeRequired_v2(string cardNumber) { card.Number = cardNumber; // Check enrollment var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); Assert.IsNotNull(secureEcom); Assert.AreEqual(ENROLLED, secureEcom.Enrolled, "Card not enrolled"); Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); Assert.AreEqual(AVAILABLE, secureEcom.Status); // Initiate authentication var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); Assert.IsNotNull(initAuth); Assert.AreEqual(CHALLENGE_REQUIRED, initAuth.Status); Assert.IsTrue(initAuth.ChallengeMandated); Assert.IsNotNull(initAuth.IssuerAcsUrl); Assert.IsNotNull(initAuth.PayerAuthenticationRequest); // Perform ACS authentication GpApi3DSecureAcsClient acsClient = new GpApi3DSecureAcsClient(initAuth.IssuerAcsUrl); string authResponse = acsClient.Authenticate_v2(initAuth); Assert.AreEqual("{\"success\":true}", authResponse); // Get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); Assert.IsNotNull(secureEcom); Assert.AreEqual(SUCCESS_AUTHENTICATED, secureEcom.Status); Assert.AreEqual("YES", secureEcom.LiabilityShift); card.ThreeDSecure = secureEcom; // Create transaction var response = card.Charge(Amount) .WithCurrency(Currency) .Execute(); Assert.IsNotNull(response); Assert.AreEqual(SUCCESS, response?.ResponseCode); Assert.AreEqual(GetMapping(TransactionStatus.Captured), response?.ResponseMessage); }
public void FullCycle_v2() { card = new CreditCardData { Number = "4012001038488884", ExpMonth = 12, ExpYear = 2025, CardHolderName = "John Doe" }; // Check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency("USD") .WithAmount(10.01m) .Execute(Secure3dVersion.Any); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("ENROLLED")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // Initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(10.01m) .WithCurrency("USD") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); Assert.IsNotNull(initAuth); // Get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("SUCCESS_AUTHENTICATED")) { Transaction response = card.Charge(10.01m) .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual(SUCCESS, response?.ResponseCode); Assert.AreEqual(GetMapping(TransactionStatus.Captured), response?.ResponseMessage); } else { Assert.Fail("Signature verification Assert.Failed."); } } else { Assert.Fail("Card not enrolled."); } }
public void CardHolderEnrolled_ChallengeRequired_v2_With_MobileData() { card.Number = GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1; var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .WithAuthenticationSource(AuthenticationSource.MOBILE_SDK) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); AssertThreeDSResponse(secureEcom, AVAILABLE); Assert.AreEqual(ENROLLED, secureEcom.Enrolled); Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); ThreeDSecure initAuth = Secure3dService .InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.MOBILE_SDK) .WithMobileData(mobileData) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .Execute(Secure3dVersion.Two); Assert.IsNotNull(initAuth); Assert.AreEqual(ENROLLED, initAuth.Enrolled); Assert.AreEqual(Secure3dVersion.Two, initAuth.Version); Assert.AreEqual(SUCCESS_AUTHENTICATED, initAuth.Status); Assert.AreEqual("YES", initAuth.LiabilityShift); Assert.IsFalse(initAuth.ChallengeMandated); Assert.IsNotNull(initAuth.IssuerAcsUrl); Assert.IsNotNull(initAuth.PayerAuthenticationRequest); Assert.AreEqual("05", initAuth.Eci); // Get authentication data secureEcom = Secure3dService .GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(Secure3dVersion.Two); card.ThreeDSecure = secureEcom; // Create transaction Transaction response = card .Charge(Amount) .WithCurrency(Currency) .Execute(); Assert.IsNotNull(response); Assert.AreEqual(SUCCESS, response.ResponseCode); Assert.AreEqual(TransactionStatus.Captured.ToString().ToUpper(), response.ResponseMessage); }
public void FrictionlessFullCycle_v2_WithTokenizedPaymentMethod() { card.Number = GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1; // Tokenize payment method var tokenizedCard = new CreditCardData() { Token = card.Tokenize() }; Assert.IsNotNull(tokenizedCard.Token); // Check enrollment var secureEcom = Secure3dService.CheckEnrollment(tokenizedCard) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); Assert.IsNotNull(secureEcom); Assert.AreEqual(ENROLLED, secureEcom.Enrolled, "Card not enrolled"); Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); Assert.AreEqual(AVAILABLE, secureEcom.Status); // Initiate authentication var initAuth = Secure3dService.InitiateAuthentication(tokenizedCard, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); Assert.IsNotNull(initAuth); Assert.AreEqual(SUCCESS_AUTHENTICATED, initAuth.Status); // Get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); Assert.AreEqual(SUCCESS_AUTHENTICATED, secureEcom.Status); tokenizedCard.ThreeDSecure = secureEcom; // Create transaction Transaction response = tokenizedCard.Charge(Amount) .WithCurrency(Currency) .Execute(); Assert.IsNotNull(response); Assert.AreEqual(SUCCESS, response?.ResponseCode); Assert.AreEqual(GetMapping(TransactionStatus.Captured), response?.ResponseMessage); }
public void OptionalPriorAuthenticationData() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(250m) .WithCurrency("USD") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithMethodUrlCompletion(MethodUrlCompletion.NO) // optionals .WithPriorAuthenticationMethod(PriorAuthenticationMethod.FRICTIONLESS_AUTHENTICATION) .WithPriorAuthenticationTransactionId("26c3f619-39a4-4040-bf1f-6fd433e6d615") .WithPriorAuthenticationTimestamp(DateTime.Parse("2019-01-10T12:57:33.333Z")) .WithPriorAuthenticationData("string") .Execute(); Assert.IsNotNull(initAuth); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("AUTHENTICATION_SUCCESSFUL")) { Transaction response = card.Charge(10.01m) .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); } else { Assert.Fail("Signature verification failed."); } } else { Assert.Fail("Card not enrolled."); } }
public void OptionalRecurringData() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(250m) .WithCurrency("USD") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithMethodUrlCompletion(MethodUrlCompletion.NO) // optionals .WithMaxNumberOfInstallments(5) .WithRecurringAuthorizationFrequency(25) .WithRecurringAuthorizationExpiryDate(DateTime.Parse("2019-08-25")) .Execute(); Assert.IsNotNull(initAuth); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("AUTHENTICATION_SUCCESSFUL")) { Transaction response = card.Charge(10.01m) .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); } else { Assert.Fail("Signature verification failed."); } } else { Assert.Fail("Card not enrolled."); } }
public void FullCycle_v2() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(); Assert.IsNotNull(secureEcom); // create card data card.ExpMonth = 12; card.ExpYear = 2025; card.CardHolderName = "John Smith"; if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(10.01m) .WithCurrency("GBP") //.WithChallengeRequestIndicator(ChallengeRequestIndicator.NO_PREFERENCE) .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); Assert.IsNotNull(initAuth); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("AUTHENTICATION_SUCCESSFUL")) { Transaction response = card.Charge(10.01m) .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); } else { Assert.Fail("Signature verification Assert.Failed."); } } else { Assert.Fail("Card not enrolled."); } }
public void OptionalPayerLoginData() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(250m) .WithCurrency("USD") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithMethodUrlCompletion(MethodUrlCompletion.NO) // optionals .WithCustomerAuthenticationData("string") .WithCustomerAuthenticationTimestamp(DateTime.Parse("2019-01-28T12:57:33.333Z")) //, DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"))) .WithCustomerAuthenticationMethod(CustomerAuthenticationMethod.MERCHANT_SYSTEM_AUTHENTICATION) .Execute(); Assert.IsNotNull(initAuth); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("AUTHENTICATION_SUCCESSFUL")) { Transaction response = card.Charge(10.01m) .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); } else { Assert.Fail("Signature verification failed."); } } else { Assert.Fail("Card not enrolled."); } }
public void FrictionlessFullCycle_v2_DifferentAmount() { card.Number = GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2; // Check enrollment var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(15) .Execute(); Assert.IsNotNull(secureEcom); Assert.AreEqual(ENROLLED, secureEcom.Enrolled, "Card not enrolled"); Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); Assert.AreEqual(AVAILABLE, secureEcom.Status); // Assert.AreEqual(1500, secureEcom.Amount); // Initiate authentication var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(10) .WithCurrency("EUR") .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); Assert.IsNotNull(initAuth); Assert.AreEqual(SUCCESS_AUTHENTICATED, initAuth.Status); Assert.AreEqual("YES", secureEcom.LiabilityShift); // Assert.AreEqual(1500, secureEcom.Amount); // Assert.AreEqual(Currency, secureEcom.Currency); // Get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); Assert.AreEqual(SUCCESS_AUTHENTICATED, secureEcom.Status); Assert.AreEqual("YES", secureEcom.LiabilityShift); // Assert.AreEqual(1500, secureEcom.Amount); // Assert.AreEqual(Currency, secureEcom.Currency); card.ThreeDSecure = secureEcom; // Create transaction var response = card.Charge(15) .WithCurrency(Currency) .Execute(); Assert.IsNotNull(response); Assert.AreEqual(SUCCESS, response?.ResponseCode); Assert.AreEqual(GetMapping(TransactionStatus.Captured), response?.ResponseMessage); }
public void FullCycle_v2_EOS_ApplyExemption() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(10.01m) .WithCurrency("EUR") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithEnableExemptionOptimization(true) .Execute(); Assert.IsNotNull(initAuth); Assert.AreEqual(ExemptReason.APPLY_EXEMPTION.ToString(), initAuth.ExemptReason); Assert.AreEqual(ExemptStatus.TRANSACTION_RISK_ANALYSIS, initAuth.ExemptStatus); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("AUTHENTICATION_SUCCESSFUL")) { Transaction response = card.Charge(10.01m) .WithCurrency("EUR") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); } else { Assert.Fail("Signature verification Assert.Failed."); } } else { Assert.Fail("Card not enrolled."); } }
public void CardHolderEnrolled_ChallengeRequired_v2_Initiate_With_IdempotencyKey() { var idempotencyKey = Guid.NewGuid().ToString(); var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); AssertThreeDSResponse(secureEcom, AVAILABLE); var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithIdempotencyKey(idempotencyKey) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); AssertThreeDSResponse(initAuth, CHALLENGE_REQUIRED); Assert.IsTrue(initAuth.ChallengeMandated); var exceptionCaught = false; try { Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithIdempotencyKey(idempotencyKey) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); } catch (GatewayException ex) { exceptionCaught = true; Assert.AreEqual("40039", ex.ResponseMessage); Assert.AreEqual("DUPLICATE_ACTION", ex.ResponseCode); Assert.AreEqual( "Status Code: Conflict - Idempotency Key seen before: id=" + secureEcom.ServerTransactionId + ", status=CHALLENGE_REQUIRED", ex.Message); } finally { Assert.IsTrue(exceptionCaught); } }
public void FullCycle_v2_with_phone_number_validation() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(10.01m) .WithCurrency("USD") .WithMobileNumber("+54", "(0341) 156-123456") .WithHomeNumber("+54", "(0341) 156-456789") .WithWorkNumber("+54", "(0341) 156-654321") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); Assert.IsNotNull(initAuth); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("AUTHENTICATION_SUCCESSFUL")) { Transaction response = card.Charge(10.01m) .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); } else { Assert.Fail("Signature verification Assert.Failed."); } } else { Assert.Fail("Card not enrolled."); } }
public void FrictionlessFullCycle_v2_Failed(string cardNumber, string status) { card.Number = cardNumber; // Check enrollment var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); Assert.IsNotNull(secureEcom); Assert.AreEqual(ENROLLED, secureEcom.Enrolled, "Card not enrolled"); Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); Assert.AreEqual(AVAILABLE, secureEcom.Status); // Initiate authentication var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); Assert.IsNotNull(initAuth); Assert.AreEqual(status, initAuth.Status); // Get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); Assert.AreEqual(status, secureEcom.Status); string liabilityShift = status == "SUCCESS_ATTEMPT_MADE" ? "YES" : "NO"; Assert.AreEqual(liabilityShift, secureEcom.LiabilityShift); card.ThreeDSecure = secureEcom; // Create transaction var response = card.Charge(Amount) .WithCurrency(Currency) .Execute(); Assert.IsNotNull(response); Assert.AreEqual(SUCCESS, response?.ResponseCode); Assert.AreEqual(GetMapping(TransactionStatus.Captured), response?.ResponseMessage); }
public void FullCycle_v2_OTB_StoredCard() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(stored) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(10.01m) .WithCurrency("USD") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithMethodUrlCompletion(MethodUrlCompletion.NO) .Execute(); Assert.IsNotNull(initAuth); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("AUTHENTICATION_SUCCESSFUL")) { Transaction response = stored.Verify() .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); } else { Assert.Fail("Signature verification failed."); } } else { Assert.Fail("Card not enrolled."); } }
public void CardHolderEnrolled_ChallengeRequired_v2_Initiate_DuplicateInitiate() { var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); AssertThreeDSResponse(secureEcom, AVAILABLE); var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .Execute(); AssertThreeDSResponse(initAuth, CHALLENGE_REQUIRED); Assert.IsTrue(initAuth.ChallengeMandated); var exceptionCaught = false; try { Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithOrderCreateDate(DateTime.Now) .WithBrowserData(browserData) .Execute(); } catch (GatewayException ex) { exceptionCaught = true; Assert.AreEqual("50139", ex.ResponseMessage); Assert.AreEqual("SYSTEM_ERROR_DOWNSTREAM", ex.ResponseCode); Assert.AreEqual( "Status Code: BadGateway - The Authentication Response is invalid, indicates an error occurred or no response was returned. The request should be considered as not authenticated.", ex.Message); } finally { Assert.IsTrue(exceptionCaught); } }
public void CardHolderEnrolled_ChallengeRequired_v2_Initiate_AcsNotPerformed() { var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); AssertThreeDSResponse(secureEcom, AVAILABLE); var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithAuthenticationSource(AuthenticationSource.BROWSER) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithShippingMethod(ShippingMethod.DIGITAL_GOODS) .WithShippingNameMatchesCardHolderName(true) .WithShippingAddressCreateDate(DateTime.Now) .WithShippingAddressUsageIndicator(AgeIndicator.LESS_THAN_THIRTY_DAYS) .Execute(); AssertThreeDSResponse(initAuth, CHALLENGE_REQUIRED); Assert.IsTrue(initAuth.ChallengeMandated); var exceptionCaught = false; try { Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); } catch (GatewayException ex) { exceptionCaught = true; Assert.AreEqual("50027", ex.ResponseMessage); Assert.AreEqual("INVALID_REQUEST_DATA", ex.ResponseCode); Assert.AreEqual( "Status Code: BadRequest - Undefined element in Message before PARes", ex.Message); } finally { Assert.IsTrue(exceptionCaught); } }
public void CardHolderEnrolled_ChallengeRequired_v2_Initiate_Without_ShippingAddress() { var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .Execute(); AssertThreeDSResponse(secureEcom, AVAILABLE); var initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(Amount) .WithCurrency(Currency) .WithOrderCreateDate(DateTime.Now) .WithBrowserData(browserData) .Execute(); AssertThreeDSResponse(initAuth, CHALLENGE_REQUIRED); Assert.IsTrue(initAuth.ChallengeMandated); }
public void FullCycle_v2_EOS_ForceSecure() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(550m) .WithCurrency("EUR") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithEnableExemptionOptimization(true) .Execute(); Assert.IsNotNull(initAuth); Assert.AreEqual("CHALLENGE_REQUIRED", initAuth.Status); Assert.AreEqual(ExemptReason.FORCE_SECURE.ToString(), initAuth.ExemptReason); Assert.IsNull(initAuth.ExemptStatus); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); Assert.IsNotNull(secureEcom); Assert.AreEqual("CHALLENGE_REQUIRED", secureEcom.Status); } else { Assert.Fail("Card not enrolled."); } }
public void CardHolderEnrolled_Frictionless_v2_Initiate_With_MobileDataAndBrowserData() { card.Number = GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1; var secureEcom = Secure3dService.CheckEnrollment(card) .WithCurrency(Currency) .WithAmount(Amount) .WithAuthenticationSource(AuthenticationSource.MOBILE_SDK) .Execute(Secure3dVersion.Two); AssertThreeDSResponse(secureEcom, AVAILABLE); Assert.AreEqual(ENROLLED, secureEcom.Enrolled); ThreeDSecure initAuth = Secure3dService .InitiateAuthentication(card, secureEcom) .WithCurrency(Currency) .WithAmount(Amount) .WithAuthenticationSource(AuthenticationSource.MOBILE_SDK) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithOrderCreateDate(DateTime.Now) .WithAddress(shippingAddress, AddressType.Shipping) .WithMobileData(mobileData) .WithBrowserData(browserData) .Execute(Secure3dVersion.Two); Assert.IsNotNull(initAuth); Assert.AreEqual(ENROLLED, initAuth.Enrolled); Assert.AreEqual(Secure3dVersion.Two, initAuth.Version); Assert.AreEqual(SUCCESS_AUTHENTICATED, initAuth.Status); Assert.AreEqual("YES", initAuth.LiabilityShift); Assert.IsFalse(initAuth.ChallengeMandated); Assert.IsNotNull(initAuth.IssuerAcsUrl); Assert.IsNotNull(initAuth.PayerAuthenticationRequest); Assert.IsNotNull(initAuth.ChallengeReturnUrl); Assert.IsNotNull(initAuth.MessageType); Assert.IsNotNull(initAuth.SessionDataFieldName); Assert.AreEqual("05", initAuth.Eci); }
public IActionResult IniciarAuth([FromQuery] Tarjeta detalles, [FromQuery] NavegadorCliente navClient, [FromQuery] RespuestaVersion3DS2 responseACSVersion) { // Configuramos los datos de nuestro comercio. Los datos son proporcionados por el equipo de Addon Payments, // en caso de duda debe llamar al 914 353 028 e indicar su número de comercio o Merchant ID ServicesContainer.ConfigureService(new GatewayConfig { MerchantId = "addonnettest", AccountId = "3ds2", SharedSecret = "secret", MethodNotificationUrl = "https://dominio.com/notificacion3ds", ChallengeNotificationUrl = "https://dominio.com/notificacionAcs", MerchantContactUrl = "https://www.dominio.com/about", Secure3dVersion = Secure3dVersion.Two }); // Tarjetas de prueba // Frictionless: 4263970000005262 // Challenge: 4012001038488884 var card = new CreditCardData { Number = detalles.cardNumber, ExpMonth = detalles.month, ExpYear = detalles.year, Cvn = detalles.cvn, CardHolderName = detalles.cardholderName }; // Indicamos la dirección de facturación Address billingAddress = new Address { StreetAddress1 = "Apartment 852", StreetAddress2 = "Complex 741", StreetAddress3 = "Unit 4", City = "Chicago", PostalCode = "50001", State = "IL", CountryCode = "840" }; // Indicamos la dirección de envío Address shippingAddress = new Address { StreetAddress1 = "Flat 456", StreetAddress2 = "House 789", StreetAddress3 = "Basement Flat", City = "Halifax", PostalCode = "W5 9HR", CountryCode = "826" }; // Indicamos los datos del navegaddor del cliente BrowserData browserData = new BrowserData { AcceptHeader = "text/html,application/xhtml+xml,application/xml;q=9,image/webp,img/apng,/;q=0.8", ColorDepth = navClient.colorDepth, IpAddress = "123.123.123.123", JavaEnabled = navClient.javaEnabled, Language = navClient.browserLanguage, ScreenHeight = navClient.screenHeight, ScreenWidth = navClient.screenWidth, ChallengeWindowSize = ChallengeWindowSize.FULL_SCREEN, Timezone = navClient.browserTimezoneZoneOffset, UserAgent = navClient.userAgent }; ThreeDSecure threeDSecureData = new ThreeDSecure { ServerTransactionId = responseACSVersion.serverTransactionId }; try { threeDSecureData = Secure3dService.InitiateAuthentication(card, threeDSecureData) .WithAmount(10.01m) .WithCurrency("EUR") .WithOrderCreateDate(DateTime.Parse("2019-09-09T11:19:12")) .WithCustomerEmail("*****@*****.**") .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithMethodUrlCompletion(MethodUrlCompletion.YES) .WithMobileNumber("44", "7123456789") .Execute(); // Informamos al cliente RespuestaVersion3DS2 respuesta = new RespuestaVersion3DS2 { acsEndVersion = threeDSecureData.AcsEndVersion, acsStartVersion = threeDSecureData.AcsStartVersion, acsTransactionId = threeDSecureData.AcsTransactionId, algorithm = threeDSecureData.Algorithm, authenticationSource = threeDSecureData.AuthenticationSource, authenticationType = threeDSecureData.AuthenticationType, authenticationValue = threeDSecureData.AuthenticationValue, cardHolderResponseInfo = threeDSecureData.CardHolderResponseInfo, cavv = threeDSecureData.Cavv, challengeMandated = threeDSecureData.ChallengeMandated, criticalityIndicator = threeDSecureData.CriticalityIndicator, directoryServerEndVersion = threeDSecureData.DirectoryServerEndVersion, directoryServerStartVersion = threeDSecureData.DirectoryServerStartVersion, directoryServerTransactionId = threeDSecureData.DirectoryServerTransactionId, eci = threeDSecureData.Eci, enrolled = threeDSecureData.Enrolled, issuerAcsUrl = threeDSecureData.IssuerAcsUrl, messageCategory = threeDSecureData.MessageCategory, messageExtensionId = threeDSecureData.MessageExtensionId, messageExtensionName = threeDSecureData.MessageExtensionName, messageVersion = threeDSecureData.MessageVersion, payerAuthenticationRequest = threeDSecureData.PayerAuthenticationRequest, paymentDataSource = threeDSecureData.PaymentDataSource, paymentDataType = threeDSecureData.PaymentDataType, sdkInterface = threeDSecureData.SdkInterface, sdkUiType = threeDSecureData.SdkUiType, serverTransactionId = threeDSecureData.ServerTransactionId, status = threeDSecureData.Status, statusReason = threeDSecureData.StatusReason, xid = threeDSecureData.Xid }; return(Ok(respuesta)); } catch (ApiException exce) { return(BadRequest(exce)); // TODO: agregue su control de excepciones aquí } }
public void OptionalPayerLevelFields() { // check enrollment ThreeDSecure secureEcom = Secure3dService.CheckEnrollment(card) .Execute(Secure3dVersion.Two); Assert.IsNotNull(secureEcom); if (secureEcom.Enrolled.Equals("True")) { Assert.AreEqual(Secure3dVersion.Two, secureEcom.Version); // initiate authentication ThreeDSecure initAuth = Secure3dService.InitiateAuthentication(card, secureEcom) .WithAmount(250m) .WithCurrency("USD") .WithOrderCreateDate(DateTime.Now) .WithAddress(billingAddress, AddressType.Billing) .WithAddress(shippingAddress, AddressType.Shipping) .WithBrowserData(browserData) .WithMethodUrlCompletion(MethodUrlCompletion.NO) // optionals .WithCustomerAccountId("6dcb24f5-74a0-4da3-98da-4f0aa0e88db3") .WithAccountAgeIndicator(AgeIndicator.LESS_THAN_THIRTY_DAYS) .WithAccountCreateDate(DateTime.Parse("2019-01-10")) .WithAccountChangeDate(DateTime.Parse("2019-01-28")) .WithAccountChangeIndicator(AgeIndicator.THIS_TRANSACTION) .WithPasswordChangeDate(DateTime.Parse("2019-01-15")) .WithPasswordChangeIndicator(AgeIndicator.LESS_THAN_THIRTY_DAYS) .WithHomeNumber("44", "123456798") .WithWorkNumber("44", "1801555888") .WithPaymentAccountCreateDate(DateTime.Parse("2019-01-01")) .WithPaymentAccountAgeIndicator(AgeIndicator.LESS_THAN_THIRTY_DAYS) .WithPreviousSuspiciousActivity(false) .WithNumberOfPurchasesInLastSixMonths(3) .WithNumberOfTransactionsInLast24Hours(1) .WithNumberOfTransactionsInLastYear(5) .WithNumberOfAddCardAttemptsInLast24Hours(1) .WithShippingAddressCreateDate(DateTime.Parse("2019-01-28")) .WithShippingAddressUsageIndicator(AgeIndicator.THIS_TRANSACTION) .Execute(); Assert.IsNotNull(initAuth); // get authentication data secureEcom = Secure3dService.GetAuthenticationData() .WithServerTransactionId(initAuth.ServerTransactionId) .Execute(); card.ThreeDSecure = secureEcom; if (secureEcom.Status.Equals("AUTHENTICATION_SUCCESSFUL")) { Transaction response = card.Charge(10.01m) .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); } else { Assert.Fail("Signature verification failed."); } } else { Assert.Fail("Card not enrolled."); } }