public void Test_PayIns_BankWireDirect_Get() { try { WalletDTO wallet = this.GetJohnsWallet(); UserNaturalDTO user = this.GetJohn(); // create pay-in BANKWIRE DIRECT PayInBankWireDirectPostDTO payIn = new PayInBankWireDirectPostDTO(user.Id, wallet.Id, new Money { Amount = 10000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }); payIn.CreditedWalletId = wallet.Id; payIn.AuthorId = user.Id; PayInBankWireDirectDTO createdPayIn = this.Api.PayIns.CreateBankWireDirect(payIn); PayInBankWireDirectDTO getPayIn = this.Api.PayIns.GetBankWireDirect(createdPayIn.Id); Assert.AreEqual(getPayIn.Id, createdPayIn.Id); Assert.AreEqual(PayInPaymentType.BANK_WIRE, getPayIn.PaymentType); Assert.AreEqual(PayInExecutionType.DIRECT, getPayIn.ExecutionType); Assert.AreEqual(user.Id, getPayIn.AuthorId); Assert.AreEqual(TransactionType.PAYIN, getPayIn.Type); Assert.IsNotNull(getPayIn.WireReference); Assert.AreEqual(getPayIn.BankAccount.Type, BankAccountType.IBAN); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public async Task Test_PayIns_BankWireDirect_Create() { try { WalletDTO wallet = await this.GetJohnsWallet(); UserNaturalDTO user = await this.GetJohn(); // create pay-in BANKWIRE DIRECT PayInBankWireDirectPostDTO payIn = new PayInBankWireDirectPostDTO(user.Id, wallet.Id, new Money { Amount = 10000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }); payIn.CreditedWalletId = wallet.Id; payIn.AuthorId = user.Id; PayInDTO createPayIn = await this.Api.PayIns.CreateBankWireDirect(payIn); Assert.IsTrue(createPayIn.Id.Length > 0); Assert.AreEqual(wallet.Id, createPayIn.CreditedWalletId); Assert.AreEqual(PayInPaymentType.BANK_WIRE, createPayIn.PaymentType); Assert.AreEqual(PayInExecutionType.DIRECT, createPayIn.ExecutionType); Assert.AreEqual(user.Id, createPayIn.AuthorId); Assert.AreEqual(TransactionStatus.CREATED, createPayIn.Status); Assert.AreEqual(TransactionType.PAYIN, createPayIn.Type); Assert.IsNotNull(((PayInBankWireDirectDTO)createPayIn).WireReference); Assert.AreEqual(((PayInBankWireDirectDTO)createPayIn).BankAccount.Type, BankAccountType.IBAN); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public void Test_PayIns_BankWireDirect_Get() { try { WalletDTO wallet = TestHelper.GetJohnsWallet(); UserNaturalDTO user = TestHelper.GetJohn(); // create pay-in BANKWIRE DIRECT PayInBankWireDirectPostDTO payIn = new PayInBankWireDirectPostDTO(user.Id, wallet.Id, new Money { Amount = 10000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }); payIn.CreditedWalletId = wallet.Id; payIn.AuthorId = user.Id; PayInBankWireDirectDTO createdPayIn = _objectToTest.CreateBankWireDirect(payIn).Result; System.Threading.Thread.Sleep(1000); PayInBankWireDirectDTO getPayIn = _objectToTest.GetBankWireDirect(createdPayIn.Id).Result; Assert.Equal(getPayIn.Id, createdPayIn.Id); Assert.Equal(PayInPaymentType.BANK_WIRE, getPayIn.PaymentType); Assert.Equal(PayInExecutionType.DIRECT, getPayIn.ExecutionType); Assert.Equal(user.Id, getPayIn.AuthorId); Assert.Equal(TransactionType.PAYIN, getPayIn.Type); Assert.NotNull(getPayIn.WireReference); Assert.Equal(BankAccountType.IBAN, getPayIn.BankAccount.Type); } catch (Exception ex) { Assert.True(false, ex.Message); } }
public void Test_PayIns_BankWireDirect_Create() { try { WalletDTO wallet = TestHelper.GetJohnsWallet(); UserNaturalDTO user = TestHelper.GetJohn(); // create pay-in BANKWIRE DIRECT PayInBankWireDirectPostDTO payIn = new PayInBankWireDirectPostDTO(user.Id, wallet.Id, new Money { Amount = 10000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }); payIn.CreditedWalletId = wallet.Id; payIn.AuthorId = user.Id; PayInDTO createPayIn = _objectToTest.CreateBankWireDirect(payIn).Result; Assert.True(createPayIn.Id.Length > 0); Assert.Equal(wallet.Id, createPayIn.CreditedWalletId); Assert.Equal(PayInPaymentType.BANK_WIRE, createPayIn.PaymentType); Assert.Equal(PayInExecutionType.DIRECT, createPayIn.ExecutionType); Assert.Equal(user.Id, createPayIn.AuthorId); Assert.Equal(TransactionStatus.CREATED, createPayIn.Status); Assert.Equal(TransactionType.PAYIN, createPayIn.Type); Assert.NotNull(((PayInBankWireDirectDTO)createPayIn).WireReference); Assert.Equal(BankAccountType.IBAN, ((PayInBankWireDirectDTO)createPayIn).BankAccount.Type); } catch (Exception ex) { Assert.True(false, ex.Message); } }
public void Test_Idempotency_PayinsBankwireDirectCreate() { string key = DateTime.Now.Ticks.ToString(); WalletDTO wallet = this.GetJohnsWallet(); UserNaturalDTO user = this.GetJohn(); PayInBankWireDirectPostDTO payIn = new PayInBankWireDirectPostDTO(user.Id, wallet.Id, new Money { Amount = 10000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }); payIn.CreditedWalletId = wallet.Id; payIn.AuthorId = user.Id; Api.PayIns.CreateBankWireDirect(key, payIn); var result = Api.Idempotency.Get(key); Assert.IsInstanceOf <PayInBankWireDirectDTO>(result.Resource); }
public async Task <PayInBankWireDirectDTO> CreateBankWireDirect(string idempotencyKey, PayInBankWireDirectPostDTO payIn) { var targetUrl = $"{_baseUrl}/payins/bankwire/direct"; return(await CreateEntity <PayInBankWireDirectDTO, PayInBankWireDirectPostDTO>(targetUrl, payIn, idempotencyKey)); }
/// <summary>Creates new payin bankwire direct.</summary> /// <param name="idempotencyKey">Idempotency key for this request.</param> /// <param name="payIn">Object instance to be created.</param> /// <returns>Object instance returned from API.</returns> public PayInBankWireDirectDTO CreateBankWireDirect(String idempotencyKey, PayInBankWireDirectPostDTO payIn) { return(this.CreateObject <PayInBankWireDirectDTO, PayInBankWireDirectPostDTO>(idempotencyKey, MethodKey.PayinsBankwireDirectCreate, payIn)); }
/// <summary>Creates new payin bankwire direct.</summary> /// <param name="payIn">Object instance to be created.</param> /// <returns>Object instance returned from API.</returns> public PayInBankWireDirectDTO CreateBankWireDirect(PayInBankWireDirectPostDTO payIn) { return(CreateBankWireDirect(null, payIn)); }
/// <summary>Creates new payin bankwire direct.</summary> /// <param name="payIn">Object instance to be created.</param> /// <returns>Object instance returned from API.</returns> public async Task <PayInBankWireDirectDTO> CreateBankWireDirect(PayInBankWireDirectPostDTO payIn) { return(await CreateBankWireDirect(null, payIn)); }
/// <summary>Creates new payin bankwire direct.</summary> /// <param name="payIn">Object instance to be created.</param> /// <returns>Object instance returned from API.</returns> public PayInBankWireDirectDTO CreateBankWireDirect(PayInBankWireDirectPostDTO payIn) { return(this.CreateObject <PayInBankWireDirectDTO, PayInBankWireDirectPostDTO>(MethodKey.PayinsBankwireDirectCreate, payIn)); }
/// <summary>Creates new payin bankwire direct.</summary> /// <param name="idempotencyKey">Idempotency key for this request.</param> /// <param name="payIn">Object instance to be created.</param> /// <returns>Object instance returned from API.</returns> public async Task <PayInBankWireDirectDTO> CreateBankWireDirectAsync(String idempotencyKey, PayInBankWireDirectPostDTO payIn) { return(await this.CreateObjectAsync <PayInBankWireDirectDTO, PayInBankWireDirectPostDTO>(idempotencyKey, MethodKey.PayinsBankwireDirectCreate, payIn)); }