Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbabul committed Sep 22, 2022
1 parent 243d18d commit 8d2d16f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/Http/Controllers/paymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class paymentController extends Controller
public function payment(Request $request){
$data= customer::where('id', '=',session('loggedUser'))->first() ;
$cards= card::where('card_no' , '=', $request->card_no )->first();
$least =1;
if(!$cards){
return back()->with('fail','Card Number is wrong');
}
Expand All @@ -22,10 +23,10 @@ public function payment(Request $request){
else if( $cards->balance< $request->amount){
return back()->with('fail','Insufficient Balance');
}
else if( $cards->balance<0){
return back()->with('fail','wrong input Balance');
else if( $request->amount < $least){
return back()->with('fail',' input Balance must be positive');
}
else{
else {

$cards->balance = $cards->balance - $request->amount;

Expand Down

0 comments on commit 8d2d16f

Please sign in to comment.