mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-07 18:50:23 +00:00
2.9 - Handling Failed Charges
This commit is contained in:
@@ -18,6 +18,9 @@ class FakePaymentGateway implements PaymentGateway
|
||||
|
||||
public function charge($amount, $token)
|
||||
{
|
||||
if ($token !== $this->getValidTestToken()) {
|
||||
throw new PaymentFailedException;
|
||||
}
|
||||
$this->charges[] = $amount;
|
||||
}
|
||||
|
||||
|
||||
5
app/Billing/PaymentFailedException.php
Normal file
5
app/Billing/PaymentFailedException.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Billing;
|
||||
|
||||
class PaymentFailedException extends \RuntimeException {}
|
||||
Reference in New Issue
Block a user