Skip to content

Commit

Permalink
minor bug fix for batch sending in historical endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Omri Mosseri committed Oct 6, 2014
1 parent a9abb50 commit 1bcede5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions Riskified.SDK.Sample/OrderTransmissionExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ public static void SendOrdersToRiskifiedExample()
break;
case "h":
int startOrderNum = orderNum;
Order o1 = GenerateOrder(orderNum++);
o1.FinancialStatus = "paid";
Order o2 = GenerateOrder(orderNum++);
o2.FinancialStatus = "cancelled";
Order o3 = GenerateOrder(orderNum++);
o3.FinancialStatus = "chargeback";
var orders = new[] {o1,o2,o3};
var orders = new List<Order>();
var financialStatuses = new[] { "paid", "cancelled", "chargeback" };
for (int i = 0; i < 22; i++)
{
Order o = GenerateOrder(orderNum++);
o.FinancialStatus = financialStatuses[i%3];
orders.Add(o);
}
Console.WriteLine("Orders Generated with merchant order numbers: {0} to {1}",startOrderNum,orderNum-1);
// sending 3 historical orders with different processing state
Dictionary<string,string> errors;
Expand Down
2 changes: 1 addition & 1 deletion Riskified.SDK/Orders/OrdersGateway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public bool SendHistoricalOrders(IEnumerable<Order> orders,out Dictionary<string
do
{
batch.Clear();
while (enumerator.MoveNext() && batch.Count < batchSize)
while (batch.Count < batchSize && enumerator.MoveNext())
{
// validate orders and assign to next batch until full
Order order = enumerator.Current;
Expand Down

0 comments on commit 1bcede5

Please sign in to comment.