|
|
|
|
|
|
|
|
] ; |
|
|
] ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$typePaymentTiller = '' ; |
|
|
|
|
|
if($order->mean_payment == MeanPayment::MONEY |
|
|
|
|
|
|| $order->mean_payment == MeanPayment::CREDIT |
|
|
|
|
|
|| $order->mean_payment == MeanPayment::TRANSFER |
|
|
|
|
|
|| $order->mean_payment == MeanPayment::OTHER) { |
|
|
|
|
|
$typePaymentTiller = 'CASH' ; |
|
|
|
|
|
} |
|
|
|
|
|
if($order->mean_payment == MeanPayment::CREDIT_CARD) { |
|
|
|
|
|
$typePaymentTiller = 'CARD' ; |
|
|
|
|
|
} |
|
|
|
|
|
if($order->mean_payment == MeanPayment::CHEQUE) { |
|
|
|
|
|
$typePaymentTiller = 'BANK_CHECK' ; |
|
|
|
|
|
} |
|
|
|
|
|
if(!strlen($typePaymentTiller) || !$order->mean_payment) { |
|
|
|
|
|
$typePaymentTiller = 'CASH' ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$tiller->postOrder([ |
|
|
$tiller->postOrder([ |
|
|
'externalId' => $order->id, |
|
|
'externalId' => $order->id, |
|
|
'type' => 1, |
|
|
'type' => 1, |
|
|
|
|
|
|
|
|
'closeDate' => $strDate, |
|
|
'closeDate' => $strDate, |
|
|
'lines' => $lines, |
|
|
'lines' => $lines, |
|
|
'payments' => [[ |
|
|
'payments' => [[ |
|
|
'type' => 'CASH', |
|
|
|
|
|
|
|
|
'type' => $typePaymentTiller, |
|
|
'amount' => $order->getAmount(Order::AMOUNT_TOTAL) * 100, |
|
|
'amount' => $order->getAmount(Order::AMOUNT_TOTAL) * 100, |
|
|
'status' => 'ACCEPTED', |
|
|
'status' => 'ACCEPTED', |
|
|
'date' => $strDate |
|
|
'date' => $strDate |