public async Task When_I_process_an_ach_standalone_using_a_payment_token_credit_Then_it_should_return_a_valid_response_async() { var vaultService = SampleFactory.CreateSampleCustomerVaultService(); var profile = SampleFactory.CreateSampleProfile(); profile = await vaultService.CreateAsync(profile); var address = SampleFactory.CreateSampleAddress(profile); address = await vaultService.CreateAsync(address); var account = SampleFactory.CreatSampleAchBankAccount(profile, address); account = await vaultService.CreateAsync(account); var response = await _achDirectDebitService.SubmitAsync(StandaloneCredits.Builder() .MerchantRefNum(account.MerchantRefNum()) .Amount(10038) .Ach() .PayMethod("WEB") .PaymentToken(account.PaymentToken()) .Done() .Build()); Assert.That(response.Status(), Is.EqualTo("COMPLETED")); }
public void When_I_process_an_eft_standalone_using_a_payment_token_credit_Then_it_should_return_a_valid_response_sync() { var vaultService = SampleFactory.CreateSampleCustomerVaultService(); var profile = SampleFactory.CreateSampleProfile(); profile = vaultService.Create(profile); var address = SampleFactory.CreateSampleAddress(profile); address = vaultService.Create(address); var account = SampleFactory.CreatSampleEftBankAccount(profile, address); account = vaultService.Create(account); var response = _eftDirectDebitService.Submit(StandaloneCredits.Builder() .MerchantRefNum(account.MerchantRefNum()) .Amount(10038) .Eft() .PaymentToken(account.PaymentToken()) .Done() .Build()); Assert.That(response.Status(), Is.EqualTo("COMPLETED")); }
public static StandaloneCredits CreateSampleAchStandaloneCredits() { long accountNumber = LongRandom(1000, 99999999999999999); return(StandaloneCredits.Builder() .MerchantRefNum(Guid.NewGuid().ToString()) .Amount(10000) .Ach() .AccountHolderName("John Smith") .AccountNumber(accountNumber.ToString()) .AccountType("CHECKING") .RoutingNumber("211589828") .PayMethod("WEB") .Done() .CustomerIp("192.0.126.111") .Profile() .FirstName("John") .LastName("Smith") .Email("*****@*****.**") .Done() .BillingDetails() .Street("100 Queen Street West") .City("Los Angeles") .State("CA") .Country("US") .Zip("90210") .Phone("3102649010") .Done() .Build()); }
public static StandaloneCredits CreateSampleEftStandaloneCredits() { long accountNumber = LongRandom(100000000, 9999999999); return(StandaloneCredits.Builder() .MerchantRefNum(Guid.NewGuid().ToString()) .Amount(10000) .Eft() .AccountHolderName("John Smith") .AccountNumber(accountNumber.ToString()) .TransitNumber("22446") .InstitutionId("001") .Done() .CustomerIp("192.0.126.111") .Profile() .FirstName("John") .LastName("Smith") .Email("*****@*****.**") .Done() .BillingDetails() .Street("100 Queen Street West") .City("Los Angeles") .State("CA") .Country("US") .Zip("90210") .Phone("3102649010") .Done() .Build()); }
public async Task When_I_lookup_an_ach_standalone_using_an_id_credit_Then_it_should_return_a_valid_ach_standalone_credit_async() { _standaloneCredit = await _achDirectDebitService.SubmitAsync(_standaloneCredit); var returnedStandaloneCredit = await _achDirectDebitService.GetAsync(StandaloneCredits.Builder() .Id(_standaloneCredit.Id()) .Build()); Assert.That(StandaloneCrditsAreEquivalent(_standaloneCredit, returnedStandaloneCredit)); }
public void When_I_lookup_an_eft_standalone_credit_using_an_id_Then_it_should_return_a_valid_eft_standalone_credit_sync() { _standaloneCredit = _eftDirectDebitService.Submit(_standaloneCredit); var returnedStandaloneCredit = _eftDirectDebitService.Get(StandaloneCredits.Builder() .Id(_standaloneCredit.Id()) .Build()); Assert.That(StandaloneCrditsAreEquivalent(_standaloneCredit, returnedStandaloneCredit)); }
public void Init() { _achDirectDebitService = SampleFactory.CreateSampleAchDirectDebitService(); _achPurchase = SampleFactory.CreateSampleAchPurchase(); _eftDirectDebitService = SampleFactory.CreateSampleEftDirectDebitService(); _eftPurchase = SampleFactory.CreateSampleEftPurchase(); _standaloneCredit = SampleFactory.CreateSampleEftStandaloneCredits(); }
public async Task When_I_cancel_an_ach_standalone_credit_Then_it_should_return_a_valid_response_async() { _standaloneCredit = await _achDirectDebitService.SubmitAsync(_standaloneCredit); var response = await _achDirectDebitService.CancelAsync(StandaloneCredits.Builder() .Status("CANCELLED") .Id(_standaloneCredit.Id()) .Build()); Assert.That(response.Status(), Is.EqualTo("CANCELLED")); }
public void When_I_cancel_an_eft_standalone_credit_Then_it_should_return_a_valid_response_sync() { _standaloneCredit = _eftDirectDebitService.Submit(_standaloneCredit); var response = _eftDirectDebitService.Cancel(StandaloneCredits.Builder() .Status("CANCELLED") .Id(_standaloneCredit.Id()) .Build()); Assert.That(response.Status(), Is.EqualTo("CANCELLED")); }
public async Task When_I_lookup_an_ach_standalone_using_a_merchant_refnum_credit_Then_it_should_return_a_valid_ach_standalone_credit_async() { _standaloneCredit = await _achDirectDebitService.SubmitAsync(_standaloneCredit); var returnedStandaloneCredit = await _achDirectDebitService.GetStandaloneCreditsAsync(StandaloneCredits.Builder() .MerchantRefNum(_standaloneCredit.MerchantRefNum()) .Build()); var result = returnedStandaloneCredit.GetResults(); Assert.That(result.Count, Is.EqualTo(1)); Assert.That(StandaloneCrditsAreEquivalent(_standaloneCredit, result.First())); }
private bool StandaloneCrditsAreEquivalent(StandaloneCredits credit1, StandaloneCredits credit2) { if (!credit1.Id().Equals(credit2.Id()) || !credit1.Status().Equals(credit2.Status()) || !credit1.Amount().Equals(credit2.Amount()) || !credit1.CustomerIp().Equals(credit2.CustomerIp()) || !credit1.MerchantRefNum().Equals(credit2.MerchantRefNum()) || !ProfilesAreEquivalent(credit1.Profile(), credit2.Profile()) || !BillingDetailsAreEquivalent(credit1.BillingDetails(), credit2.BillingDetails())) { return(false); } return(true); }