|
|
@@ -89,13 +89,25 @@ class TillerManager extends AbstractManager |
|
|
|
foreach ($order->productOrder as $productOrder) { |
|
|
|
// v3 |
|
|
|
if($apiVersion == 'v3') { |
|
|
|
$amount = round($this->productOrderSolver->getPriceWithTax($productOrder) * 100); |
|
|
|
|
|
|
|
// classique |
|
|
|
if(is_int($productOrder->quantity)) { |
|
|
|
$quantity = $productOrder->quantity; |
|
|
|
} |
|
|
|
// vrac |
|
|
|
else { |
|
|
|
$amount = $amount * $productOrder->quantity; |
|
|
|
$quantity = 1; |
|
|
|
} |
|
|
|
|
|
|
|
$lines[] = [ |
|
|
|
'name' => $productOrder->product->name, |
|
|
|
'unitPrice' => [ |
|
|
|
'amount' => $this->productOrderSolver->getPriceWithTax($productOrder) * 100, |
|
|
|
'amount' => $amount, |
|
|
|
], |
|
|
|
'taxRate' => $productOrder->taxRate->value * 100, |
|
|
|
'quantity' => $productOrder->quantity |
|
|
|
'quantity' => $quantity |
|
|
|
]; |
|
|
|
} |
|
|
|
// v2 |
|
|
@@ -140,7 +152,7 @@ class TillerManager extends AbstractManager |
|
|
|
'payments' => [ |
|
|
|
[ |
|
|
|
'externalId' => ''.$order->id, |
|
|
|
'amount' => $this->orderSolver->getOrderAmountWithTax($order, Order::AMOUNT_PAID) * 100, |
|
|
|
'amount' => round($this->orderSolver->getOrderAmountWithTax($order, Order::AMOUNT_PAID) * 100), |
|
|
|
] |
|
|
|
] |
|
|
|
] |