aa
This commit is contained in:
@@ -2149,7 +2149,8 @@ Route::post('/pao1', function (Request $request) {
|
||||
dd($request->all());
|
||||
});
|
||||
|
||||
function updateCreate(Request $request) {
|
||||
function updateCreate(Request $request)
|
||||
{
|
||||
|
||||
// WEBHOOK DA GESTPAY A WOOCOMMERCE
|
||||
|
||||
@@ -2168,7 +2169,7 @@ function updateCreate(Request $request) {
|
||||
($request->status == 'processing' && $request->payment_method == 'wc_gateway_gestpay') ||
|
||||
($request->status == 'processing' && $request->payment_method == 'paypal') ||
|
||||
($request->status == 'processing' && $request->payment_method == 'test')
|
||||
) {
|
||||
) {
|
||||
$productLogger->addLog('', 'updatecreate: ARRIVATO ORDINE ' . $request->payment_method . ' ' . $request->status);
|
||||
|
||||
$myidInternet = (int) $request->id;
|
||||
@@ -2251,9 +2252,12 @@ function updateCreate(Request $request) {
|
||||
|
||||
$productLogger->addLog('', 'Cerco il customer_id: ' . $CodClienteInternet);
|
||||
|
||||
$creatoNuovoCliente = false;
|
||||
|
||||
if ($CodClienteInternet > 0) {
|
||||
$customer = Customer::find($CodClienteInternet);
|
||||
if ($customer)
|
||||
$creatoNuovoCliente = true;
|
||||
} else {
|
||||
$customer = $request;
|
||||
$customer['id'] = 0;
|
||||
@@ -2297,7 +2301,9 @@ function updateCreate(Request $request) {
|
||||
} catch (\Throwable $th) {
|
||||
$productLogger->addLog('', 'Errore: ' . $th->getMessage());
|
||||
}
|
||||
$cliente->IdInternet = $myidInternet;
|
||||
if ($creatoNuovoCliente) {
|
||||
$cliente->IdInternet = $myidInternet;
|
||||
}
|
||||
|
||||
$productLogger->addLog('', ' ...fine compilazione campi Cliente' . json_encode($cliente));
|
||||
$cliente->save();
|
||||
|
||||
Reference in New Issue
Block a user