Skip to content

Commit

Permalink
Update CanBePaid.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Babichev Maxim committed Nov 7, 2018
1 parent a05a975 commit d38f7ef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Traits/CanBePaid.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ public function refund(Product $product): bool
->firstOrFail();

return DB::transaction(function () use ($product, $transfer) {
return $transfer->update(['refund', 1]) && $product
->transfer($this, $product->getAmountProduct(), $product->getMetaProduct())
->exists;
$product->transfer($this, $product->getAmountProduct(), $product->getMetaProduct());
return $transfer->update(['refund' => 1]);
});
}

Expand Down

0 comments on commit d38f7ef

Please sign in to comment.