Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/PaymentsMollieTest.php
Show First 20 Lines • Show All 711 Lines • ▼ Show 20 Lines | public function testRefundAndChargeback(): void | ||||
$wallet->refresh(); | $wallet->refresh(); | ||||
$this->assertEquals(-101, $wallet->balance); | $this->assertEquals(-101, $wallet->balance); | ||||
$transactions = $wallet->transactions()->where('type', Transaction::WALLET_REFUND)->get(); | $transactions = $wallet->transactions()->where('type', Transaction::WALLET_REFUND)->get(); | ||||
$this->assertCount(1, $transactions); | $this->assertCount(1, $transactions); | ||||
$this->assertSame(101, $transactions[0]->amount); | $this->assertSame(-101, $transactions[0]->amount); | ||||
$this->assertSame(Transaction::WALLET_REFUND, $transactions[0]->type); | $this->assertSame(Transaction::WALLET_REFUND, $transactions[0]->type); | ||||
$this->assertSame("refund desc", $transactions[0]->description); | $this->assertSame("refund desc", $transactions[0]->description); | ||||
$payments = $wallet->payments()->where('id', 're_123456')->get(); | $payments = $wallet->payments()->where('id', 're_123456')->get(); | ||||
$this->assertCount(1, $payments); | $this->assertCount(1, $payments); | ||||
$this->assertSame(-101, $payments[0]->amount); | $this->assertSame(-101, $payments[0]->amount); | ||||
$this->assertSame(PaymentProvider::STATUS_PAID, $payments[0]->status); | $this->assertSame(PaymentProvider::STATUS_PAID, $payments[0]->status); | ||||
Show All 40 Lines | public function testRefundAndChargeback(): void | ||||
$wallet->refresh(); | $wallet->refresh(); | ||||
$this->assertEquals(-116, $wallet->balance); | $this->assertEquals(-116, $wallet->balance); | ||||
$transactions = $wallet->transactions()->where('type', Transaction::WALLET_CHARGEBACK)->get(); | $transactions = $wallet->transactions()->where('type', Transaction::WALLET_CHARGEBACK)->get(); | ||||
$this->assertCount(1, $transactions); | $this->assertCount(1, $transactions); | ||||
$this->assertSame(15, $transactions[0]->amount); | $this->assertSame(-15, $transactions[0]->amount); | ||||
$this->assertSame(Transaction::WALLET_CHARGEBACK, $transactions[0]->type); | $this->assertSame(Transaction::WALLET_CHARGEBACK, $transactions[0]->type); | ||||
$this->assertSame('', $transactions[0]->description); | $this->assertSame('', $transactions[0]->description); | ||||
$payments = $wallet->payments()->where('id', 'chb_123456')->get(); | $payments = $wallet->payments()->where('id', 'chb_123456')->get(); | ||||
$this->assertCount(1, $payments); | $this->assertCount(1, $payments); | ||||
$this->assertSame(-15, $payments[0]->amount); | $this->assertSame(-15, $payments[0]->amount); | ||||
$this->assertSame(PaymentProvider::STATUS_PAID, $payments[0]->status); | $this->assertSame(PaymentProvider::STATUS_PAID, $payments[0]->status); | ||||
Show All 30 Lines |