mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-14 21:53:15 +00:00
2.4 - Faking the Payment Gateway
This commit is contained in:
28
app/Billing/FakePaymentGateway.php
Normal file
28
app/Billing/FakePaymentGateway.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Billing;
|
||||
|
||||
class FakePaymentGateway implements PaymentGateway
|
||||
{
|
||||
private $charges;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->charges = collect();
|
||||
}
|
||||
|
||||
public function getValidTestToken()
|
||||
{
|
||||
return "valid-token";
|
||||
}
|
||||
|
||||
public function charge($amount, $token)
|
||||
{
|
||||
$this->charges[] = $amount;
|
||||
}
|
||||
|
||||
public function totalCharges()
|
||||
{
|
||||
return $this->charges->sum();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user