SHARE
TWEET

Untitled

a guest Nov 21st, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function cancelDeal(Deal $deal)
  2.     {
  3.         $cancellation_fee = Helpers::getSetting('fees');
  4.         $service_fee = Helpers::getSetting('service_charge');
  5.         $user_id = auth()->id();
  6.         $buyer_id = $deal->buyer_id;
  7.         $seller_id = $deal->post->user_id;
  8.  
  9.         $deposit = $deal->post->require_deposit;
  10.         $subTotal = $deal->price*$deal->qty;
  11.         $serviceCharge = (100-$service_fee)/100;
  12.         $seller_total_earn = $subTotal*$serviceCharge;
  13.  
  14.         // update available qty post
  15.         $deal->post()->increment('available_qty',$deal->qty);
  16.  
  17.         // update amount left
  18.         $deal->update([
  19.             'release_payment' => NULL,
  20.             'status' => 'Cancelled Deal',
  21.             'amount_left' => 0.00
  22.         ]);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top