1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

Tests: Canceled payments

This commit is contained in:
Benjamin Beganović 2021-09-24 23:26:36 +02:00
parent 4a475d9ef0
commit dec33daae3
2 changed files with 32 additions and 1 deletions

View File

@ -377,7 +377,6 @@ class CompanyGateway extends BaseModel
public function webhookUrl()
{
return 'https://invoiceninja.com';
return route('payment_webhook', ['company_key' => $this->company->company_key, 'company_gateway_id' => $this->hashed_id]);
}

View File

@ -54,4 +54,36 @@ class KBCTest extends DuskTestCase
->assertSee('Completed');
});
}
public function testFailedPayment(): void
{
$this->browse(function (Browser $browser) {
$browser
->visitRoute('client.invoices.index')
->click('@pay-now')
->press('Pay Now')
->clickLink('Undefined.')
->waitForText('Test profile')
->press('CBC')
->radio('final_state', 'failed')
->press('Continue')
->waitForText('Failed.');
});
}
public function testCancelledTest(): void
{
$this->browse(function (Browser $browser) {
$browser
->visitRoute('client.invoices.index')
->click('@pay-now')
->press('Pay Now')
->clickLink('Undefined.')
->waitForText('Test profile')
->press('CBC')
->radio('final_state', 'canceled')
->press('Continue')
->waitForText('Cancelled.');
});
}
}