Skip to content

Commit f212db4

Browse files
committed
fixed a bug with which you can earn by buying and selling goods
1 parent c954623 commit f212db4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Models/Transfer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
* @property bool $refund
2020
* @property string $uuid
2121
* @property int $fee
22+
*
23+
* @property Transaction $deposit
24+
* @property Transaction $withdraw
2225
*/
2326
class Transfer extends Model
2427
{

src/Traits/CanBePaid.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ public function refund(Product $product, bool $force = false): bool
104104

105105
return DB::transaction(function() use ($product, $transfer, $force) {
106106
if ($force) {
107-
$product->forceTransfer($this, $product->getAmountProduct(), $product->getMetaProduct());
107+
$product->forceTransfer($this, $transfer->deposit->amount, $product->getMetaProduct());
108108
} else {
109-
$product->transfer($this, $product->getAmountProduct(), $product->getMetaProduct());
109+
$product->transfer($this, $transfer->deposit->amount, $product->getMetaProduct());
110110
}
111111

112112
return $transfer->update(['refund' => 1]);

0 commit comments

Comments
 (0)