diff --git a/include/controllers/default/crunchbutton/api/restaurant/index.php b/include/controllers/default/crunchbutton/api/restaurant/index.php index 18a7dd580..1cc7348de 100644 --- a/include/controllers/default/crunchbutton/api/restaurant/index.php +++ b/include/controllers/default/crunchbutton/api/restaurant/index.php @@ -148,6 +148,7 @@ class Controller_api_restaurant extends Crunchbutton_Controller_Rest { if ($r->id_restaurant) { $r->balanced_id = c::config()->balanced->sharedMerchant; $r->save(); + echo json_encode( [ 'success' => 'success' ] ); } break; @@ -155,6 +156,7 @@ class Controller_api_restaurant extends Crunchbutton_Controller_Rest { if ($r->id_restaurant) { $r->balanced_id = null; $r->save(); + echo json_encode( [ 'success' => 'success' ] ); } break; @@ -162,6 +164,7 @@ class Controller_api_restaurant extends Crunchbutton_Controller_Rest { if ($r->id_restaurant) { $r->balanced_bank = null; $r->save(); + echo json_encode( [ 'success' => 'success' ] ); } break; diff --git a/include/library/Crunchbutton/Order.php b/include/library/Crunchbutton/Order.php index 7a13b011b..9c7e2daf6 100644 --- a/include/library/Crunchbutton/Order.php +++ b/include/library/Crunchbutton/Order.php @@ -216,7 +216,7 @@ class Crunchbutton_Order extends Cana_Table { } } - Log::debug(['giftcardValue'=> $this->giftcardValue]); + Log::debug([ 'issue' => '#1551', 'method' => 'process', '$this->final_price' => $this->final_price, 'giftcardValue'=> $this->giftcardValue ]); $res = $this->verifyPayment(); @@ -382,11 +382,10 @@ class Crunchbutton_Order extends Cana_Table { $chargedByCredit = Crunchbutton_Credit::calcDebitFromUserCredit( $final_price, $this->id_user, $this->id_restaurant, $this->id_order, true ); $final_price = $final_price - $chargedByCredit; } - Log::debug([ '$this->final_price' => $this->final_price, 'giftcardValue'=> $this->giftcardValue, 'final_price' => $final_price, ]); + Log::debug([ 'issue' => '#1551', 'method' => 'calcFinalPriceMinusUsersCredit', '$this->final_price' => $this->final_price, 'giftcardValue'=> $this->giftcardValue, 'final_price' => $final_price, ]); if( $final_price < 0 ){ $final_price = 0; } return Util::ceil( $final_price, 2 ); } - return $final_price; } @@ -476,6 +475,7 @@ class Crunchbutton_Order extends Cana_Table { } $amount = $this->calcFinalPriceMinusUsersCredit(); + Log::debug([ 'issue' => '#1551', 'method' => 'verifyPayment', '$this->final_price' => $this->final_price, 'giftcardValue'=> $this->giftcardValue, 'amount' => $amount ]); // If the amount is 0 it means that the user used his credit. if( $amount > 0 ){ diff --git a/include/library/Crunchbutton/Restaurant.php b/include/library/Crunchbutton/Restaurant.php index 9d2c47068..58b191d49 100644 --- a/include/library/Crunchbutton/Restaurant.php +++ b/include/library/Crunchbutton/Restaurant.php @@ -271,6 +271,7 @@ class Crunchbutton_Restaurant extends Cana_Table_Trackchange { $info = $this->merchant()->addBankAccount($bank); $this->balanced_bank = $bank->id; $this->save(); + echo json_encode( [ 'success' => 'success' ] ); } catch (Exception $e) { print_r($e); exit; diff --git a/include/views/default/cockpit/restaurants/pay.phtml b/include/views/default/cockpit/restaurants/pay.phtml index 3e91daf27..7a03f4597 100644 --- a/include/views/default/cockpit/restaurants/pay.phtml +++ b/include/views/default/cockpit/restaurants/pay.phtml @@ -52,6 +52,7 @@