public void UpdateBoardedCard() { tokenizedCard.ExpMonth = 12; tokenizedCard.ExpYear = 2025; bool success = tokenizedCard.UpdateTokenExpiry(); Assert.IsTrue(success); }
public void UpdateTokenizedPaymentMethod_WithRandomId() { var tokenizedCard = new CreditCardData { Token = "PMT_" + Guid.NewGuid().ToString(), ExpMonth = 12, ExpYear = 2030 }; Assert.IsFalse(tokenizedCard.UpdateTokenExpiry()); }
public void UpdateTokenizedPaymentMethod_WithMalformedId() { var tokenizedCard = new CreditCardData { Token = "This_is_not_a_payment_id", ExpMonth = 12, ExpYear = 2030 }; Assert.IsFalse(tokenizedCard.UpdateTokenExpiry()); }
public void UpdateToken() { var token = new CreditCardData { Token = _token, ExpMonth = 12, ExpYear = 2025 }; Assert.IsTrue(token.UpdateTokenExpiry()); // should succeed var response = token.Verify().Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); }
public void UpdateTokenizedPaymentMethod() { var tokenizedCard = new CreditCardData { Token = _token, ExpMonth = 12, ExpYear = 2030 }; Assert.IsTrue(tokenizedCard.UpdateTokenExpiry()); var response = tokenizedCard.Verify().Execute(); Assert.IsNotNull(response); Assert.AreEqual("00", response.ResponseCode); Assert.AreEqual("ACTIVE", response.ResponseMessage); }
public void UpdateTokenizedPaymentMethod() { CreditCardData tokenizedCard = new CreditCardData { Token = Token, ExpMonth = 12, ExpYear = 2030 }; Assert.IsTrue(tokenizedCard.UpdateTokenExpiry()); Transaction response = tokenizedCard.Verify() .WithCurrency("USD") .Execute(); Assert.IsNotNull(response); Assert.AreEqual("SUCCESS", response.ResponseCode); Assert.AreEqual("VERIFIED", response.ResponseMessage); }
public void UpdateTokenizedPaymentMethod() { var tokenizedCard = new CreditCardData { Token = Token, ExpMonth = 12, ExpYear = 2030 }; Assert.IsTrue(tokenizedCard.UpdateTokenExpiry()); var response = tokenizedCard.Verify() .WithCurrency(CURRENCY) .Execute(); Assert.IsNotNull(response); Assert.AreEqual(SUCCESS, response.ResponseCode); Assert.AreEqual(VERIFIED, response.ResponseMessage); }
public void UpdateTokenizedPaymentMethod_WithMalformedId() { var tokenizedCard = new CreditCardData { Token = "This_is_not_a_payment_id", ExpMonth = expMonth, ExpYear = expYear }; var exceptionCaught = false; try { tokenizedCard.UpdateTokenExpiry(); } catch (GatewayException ex) { exceptionCaught = true; Assert.AreEqual("INVALID_REQUEST_DATA", ex.ResponseCode); Assert.AreEqual("40213", ex.ResponseMessage); Assert.IsTrue(ex.Message.StartsWith("Status Code: BadRequest - payment_method.id: This_is_not_a_payment_id contains unexpected data")); } finally { Assert.IsTrue(exceptionCaught); } }
public void UpdateTokenizedPaymentMethod_WithRandomId() { var tokenizedCard = new CreditCardData { Token = "PMT_" + Guid.NewGuid(), ExpMonth = expMonth, ExpYear = expYear }; var exceptionCaught = false; try { tokenizedCard.UpdateTokenExpiry(); } catch (GatewayException ex) { exceptionCaught = true; Assert.AreEqual("RESOURCE_NOT_FOUND", ex.ResponseCode); Assert.AreEqual("40116", ex.ResponseMessage); Assert.IsTrue(ex.Message.StartsWith("Status Code: NotFound - payment_method")); } finally { Assert.IsTrue(exceptionCaught); } }
public void UpdateTokenExpiry_UsingCreditCardToken_DoesNotThrow() { var response = clearTextCredit.Verify() .WithAddress(new Address { PostalCode = "12345" }) .WithRequestMultiUseToken(true) .Execute(); Assert.IsFalse(string.IsNullOrWhiteSpace(response.Token)); try { clearTextCredit.Token = response.Token; clearTextCredit.ExpMonth = 12; clearTextCredit.ExpYear = 2022; clearTextCredit.UpdateTokenExpiry(); } catch (Exception ex) { Assert.Fail(ex.Message); } }