Skip to content

Commit 75bfd49

Browse files
authored
Merge pull request #10 from digitickets/fix-zero-value-lines-causing-error
Skip 0 value lines, to stop API failing
2 parents 54832d8 + 69ade04 commit 75bfd49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Messages/PurchaseRequest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public function getData()
9393
$itemSummary = new \scpService_summaryData();
9494
$itemSummary->description = $itemBagItem->getName();
9595
$itemSummary->amountInMinorUnits = (int) round(100*$itemBagItem->getPrice()*$itemBagItem->getQuantity());
96+
if($itemSummary->amountInMinorUnits==0){
97+
// As per interface spec, skip 0 value lines.
98+
continue;
99+
}
96100
$itemSummary->reference = $this->getReference();
97101

98102
$lgItemItemDetails = new \scpService_lgItemDetails();

0 commit comments

Comments
 (0)