Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Reseller/PaymentsMollieTest.php
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | public function testMandates(): void | ||||
$this->assertSame('success', $json['status']); | $this->assertSame('success', $json['status']); | ||||
$this->assertMatchesRegularExpression('|^https://www.mollie.com|', $json['redirectUrl']); | $this->assertMatchesRegularExpression('|^https://www.mollie.com|', $json['redirectUrl']); | ||||
// Assert the proper payment amount has been used | // Assert the proper payment amount has been used | ||||
$payment = Payment::where('id', $json['id'])->first(); | $payment = Payment::where('id', $json['id'])->first(); | ||||
$this->assertSame(2010, $payment->amount); | $this->assertSame(2010, $payment->amount); | ||||
$this->assertSame($wallet->id, $payment->wallet_id); | $this->assertSame($wallet->id, $payment->wallet_id); | ||||
$this->assertSame(\config('app.name') . " Auto-Payment Setup", $payment->description); | $this->assertSame($reseller->tenant->title . " Auto-Payment Setup", $payment->description); | ||||
$this->assertSame(PaymentProvider::TYPE_MANDATE, $payment->type); | $this->assertSame(PaymentProvider::TYPE_MANDATE, $payment->type); | ||||
// Test fetching the mandate information | // Test fetching the mandate information | ||||
$response = $this->actingAs($reseller)->get("api/v4/payments/mandate"); | $response = $this->actingAs($reseller)->get("api/v4/payments/mandate"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$json = $response->json(); | $json = $response->json(); | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |