public void ListCharges_Test() { StripeArray response = _client.ListCharges(); Assert.NotNull(response); Assert.False(response.IsError); Assert.True(response.Any()); }
public void List_Refund_Card_Charge_Test() { dynamic charge = _client.CreateCharge(100M, "usd", _card); dynamic refund = _client.CreateRefund(charge.Id, amount: 10M); dynamic secondRefund = _client.CreateRefund(charge.Id, amount: 15M); StripeArray response = _client.ListRefunds(charge.Id, limit: 2); Assert.NotNull(response); Assert.False(response.IsError); Assert.True(response.Any()); }
public void ListCharges_TestDateRange() { var begin = new DateTimeOffset(new DateTime(2013, 1, 1)); var end = new DateTimeOffset(new DateTime(2014, 1, 1)); StripeArray response = _client.ListCharges(periodBegin: begin, periodEnd: end); Assert.NotNull(response); Assert.False(response.IsError); Assert.True(response.Any()); foreach (var obj in response) { var created = long.Parse(obj["created"].ToString()).ToDateTime(); Assert.True(created >= begin); Assert.True(created < end); } }