mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-10 16:51:31 +00:00
57 - Don't Mock What You Don't Own
This commit is contained in:
24
app/Billing/Alternate/StripePaymentGateway.php
Normal file
24
app/Billing/Alternate/StripePaymentGateway.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Billing\Alternate;
|
||||
|
||||
use App\Billing\PaymentGateway;
|
||||
|
||||
class StripePaymentGateway implements PaymentGateway
|
||||
{
|
||||
private $stripeClient;
|
||||
|
||||
public function __construct(\Stripe\ApiClient $stripeClient)
|
||||
{
|
||||
$this->stripeClient = $stripeClient;
|
||||
}
|
||||
|
||||
public function charge($amount, $token)
|
||||
{
|
||||
$this->stripeClient->createCharge([
|
||||
'amount' => $amount,
|
||||
'source' => $token,
|
||||
'currency' => 'usd',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user