|
|
|
|
|
|
|
|
$typePaymentTiller = 'CASH'; |
|
|
$typePaymentTiller = 'CASH'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$returnTiller = $tiller->postOrder([ |
|
|
|
|
|
'externalId' => $order->id, |
|
|
|
|
|
'type' => 1, |
|
|
|
|
|
'status' => 'IN_PROGRESS', |
|
|
|
|
|
'openDate' => $strDate, |
|
|
|
|
|
'closeDate' => $strDate, |
|
|
|
|
|
'lines' => $lines, |
|
|
|
|
|
'payments' => [ |
|
|
|
|
|
[ |
|
|
|
|
|
'type' => $typePaymentTiller, |
|
|
|
|
|
'amount' => $orderManager->getOrderAmountWithTax( |
|
|
|
|
|
$order, |
|
|
|
|
|
Order::AMOUNT_PAID |
|
|
|
|
|
) * 100, |
|
|
|
|
|
'status' => 'ACCEPTED', |
|
|
|
|
|
'date' => $strDate |
|
|
|
|
|
|
|
|
if(!$tiller->isSynchro($date, $order->id)) { |
|
|
|
|
|
$returnTiller = $tiller->postOrder([ |
|
|
|
|
|
'externalId' => $order->id, |
|
|
|
|
|
'type' => 1, |
|
|
|
|
|
'status' => 'IN_PROGRESS', |
|
|
|
|
|
'openDate' => $strDate, |
|
|
|
|
|
'closeDate' => $strDate, |
|
|
|
|
|
'lines' => $lines, |
|
|
|
|
|
'payments' => [ |
|
|
|
|
|
[ |
|
|
|
|
|
'type' => $typePaymentTiller, |
|
|
|
|
|
'amount' => $orderManager->getOrderAmountWithTax( |
|
|
|
|
|
$order, |
|
|
|
|
|
Order::AMOUNT_PAID |
|
|
|
|
|
) * 100, |
|
|
|
|
|
'status' => 'ACCEPTED', |
|
|
|
|
|
'date' => $strDate |
|
|
|
|
|
] |
|
|
] |
|
|
] |
|
|
] |
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
$returnTillerObject = json_decode($returnTiller); |
|
|
|
|
|
$order->tiller_external_id = '' . $returnTillerObject->id; |
|
|
|
|
|
$order->save(); |
|
|
|
|
|
|
|
|
$returnTillerObject = json_decode($returnTiller); |
|
|
|
|
|
$order->tiller_external_id = '' . $returnTillerObject->id; |
|
|
|
|
|
$order->save(); |
|
|
|
|
|
|
|
|
$return[] = $returnTiller; |
|
|
|
|
|
|
|
|
$return[] = $returnTiller; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |