Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/PaymentsMollieTest.php
Show First 20 Lines • Show All 922 Lines • ▼ Show 20 Lines | public function testRefundAndChargebackForeignCurrency(): void | ||||
$responseStack->append(new Response(200, [], json_encode($mollie_response2))); | $responseStack->append(new Response(200, [], json_encode($mollie_response2))); | ||||
$post = ['id' => $payment->id]; | $post = ['id' => $payment->id]; | ||||
$response = $this->post("api/webhooks/payment/mollie", $post); | $response = $this->post("api/webhooks/payment/mollie", $post); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$wallet->refresh(); | $wallet->refresh(); | ||||
$this->assertEquals(-112, $wallet->balance); | $this->assertTrue($wallet->balance <= -108); | ||||
$this->assertTrue($wallet->balance >= -114); | |||||
$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(-112, $payments[0]->amount); | $this->assertTrue($payments[0]->amount <= -108); | ||||
$this->assertTrue($payments[0]->amount >= -114); | |||||
$this->assertSame(-101, $payments[0]->currency_amount); | $this->assertSame(-101, $payments[0]->currency_amount); | ||||
$this->assertSame('EUR', $payments[0]->currency); | $this->assertSame('EUR', $payments[0]->currency); | ||||
$this->unmockMollie(); | $this->unmockMollie(); | ||||
} | } | ||||
/** | /** | ||||
* Create Mollie's auto-payment mandate using our API and Chrome browser | * Create Mollie's auto-payment mandate using our API and Chrome browser | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |