public async Task Test_Events_GetAll_SortByCreationDate() { try { PayInCardWebDTO payIn1 = await GetJohnsNewPayInCardWeb(); PayInCardWebDTO payIn2 = await GetJohnsNewPayInCardWeb(); FilterEvents eventsFilter = new FilterEvents(); eventsFilter.BeforeDate = payIn2.CreationDate.AddSeconds(1); eventsFilter.AfterDate = payIn1.CreationDate; eventsFilter.Type = EventType.PAYIN_NORMAL_CREATED; Sort sort = new Sort(); sort.AddField("Date", SortDirection.desc); Pagination pagination = new Pagination(); ListPaginated <EventDTO> result = await this.Api.Events.GetAllAsync(pagination, eventsFilter, sort); Assert.IsNotNull(result); Assert.IsTrue(result.Count > 1); Assert.IsTrue(result[0].Date >= result[1].Date); } catch (Exception ex) { Assert.Fail(ex.Message); } }
protected PayInCardWebDTO GetNewPayInCardWeb() { WalletDTO wallet = this.GetJohnsWallet(); UserNaturalDTO user = this.GetJohn(); PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(user.Id, new Money { Amount = 1000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }, wallet.Id, "https://test.com", CountryIso.FR, CardType.CB_VISA_MASTERCARD); BaseTest._johnsPayInCardWeb = this.Api.PayIns.CreateCardWeb(payIn); return(BaseTest._johnsPayInCardWeb); }
protected PayInCardWebDTO GetJohnsPayInCardWeb(string walletId) { if (BaseTest._johnsPayInCardWeb == null) { UserNaturalDTO user = this.GetJohn(); PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(user.Id, new Money { Amount = 1000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }, walletId, "https://test.com", CultureCode.FR, CardType.CB_VISA_MASTERCARD); BaseTest._johnsPayInCardWeb = this.Api.PayIns.CreateCardWeb(payIn); } return(BaseTest._johnsPayInCardWeb); }
protected async Task <PayInCardWebDTO> GetJohnsPayInCardWeb() { if (BaseTest._johnsPayInCardWeb == null) { WalletDTO wallet = await this.GetJohnsWallet(); UserNaturalDTO user = await this.GetJohn(); PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(user.Id, new Money { Amount = 1000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }, wallet.Id, "https://test.com", CultureCode.FR, CardType.CB_VISA_MASTERCARD); BaseTest._johnsPayInCardWeb = await this.Api.PayIns.CreateCardWeb(payIn); } return(BaseTest._johnsPayInCardWeb); }
protected PayInCardWebDTO GetJohnsPayInCardWeb(string walletId) { if (BaseTest._johnsPayInCardWeb == null) { UserNaturalDTO user = this.GetJohn(); PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(user.Id, new Money { Amount = 1000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }, walletId, "https://test.com", CultureCode.FR, CardType.CB_VISA_MASTERCARD); //Add TemplateURLOptionsCard for tests payIn.TemplateURLOptionsCard = new TemplateURLOptionsCard { PAYLINEV2 = "https://www.maysite.com/payline_template/" }; BaseTest._johnsPayInCardWeb = this.Api.PayIns.CreateCardWeb(payIn); } return(BaseTest._johnsPayInCardWeb); }
protected PayInCardWebDTO GetJohnsNewPayInCardWeb() { BaseTest._johnsPayInCardWeb = null; return(GetJohnsPayInCardWeb()); }
protected async Task <PayInCardWebDTO> GetJohnsNewPayInCardWeb() { BaseTest._johnsPayInCardWeb = null; return(await GetJohnsPayInCardWeb()); }