public async Task When_I_verify_a_card_using_a_payment_token_Then_it_should_return_a_valid_response_async() { var cardService = SampleFactory.CreateSampleCardPaymentService(); var vaultService = SampleFactory.CreateSampleCustomerVaultService(); var profile = SampleFactory.CreateSampleProfile(); profile = await vaultService.CreateAsync(profile); var address = SampleFactory.CreateSampleAddress(profile); address = await vaultService.CreateAsync(address); var card = SampleFactory.CreateSampleCard(profile, address); card = await vaultService.CreateAsync(card); var response = await cardService.VerifyAsync(Verification.Builder() .MerchantRefNum(Guid.NewGuid().ToString()) .Card() .PaymentToken(card.PaymentToken()) .Done() .Build()); Assert.That(response.Status(), Is.EqualTo("COMPLETED")); }
public static Verification CreateSampleVerification() { return(Verification.Builder() .MerchantRefNum(Guid.NewGuid().ToString()) .Card() .CardNum("4111111111111111") .CardExpiry() .Month(DateTime.Now.Month) .Year(DateTime.Now.Year) .Done() .Cvv("123") .Done() .Profile() .FirstName("Joe") .LastName("Smith") .Email("*****@*****.**") .Done() .BillingDetails() .Street("100 Queen Street West") .City("Toronto") .State("ON") .Country("CA") .Zip("M5H2N2") .Done() .CustomerIp("204.91.0.12") .Description("This is a test transaction") .Build()); }
public void When_I_lookup_a_verification_using_a_merchant_refNum_Then_it_should_return_a_valid_verification_sync() { var ver = SampleFactory.CreateSampleVerification(); ver = _cardService.Verify(ver); Pagerator <Verification> verifications = _cardService.GetVerifications(Verification.Builder() .MerchantRefNum(ver.MerchantRefNum()) .Build()); var verList = verifications.GetResults(); Assert.That(verList.Count, Is.EqualTo(1)); Assert.That(VerificationsAreEquivalent(ver, verList.First())); }