Files
ticketbeast/app/Billing/StripePaymentGateway.php
2016-12-29 20:41:29 -05:00

25 lines
438 B
PHP

<?php
namespace App\Billing;
use Stripe\Charge;
class StripePaymentGateway implements PaymentGateway
{
private $apiKey;
public function __construct($apiKey)
{
$this->apiKey = $apiKey;
}
public function charge($amount, $token)
{
Charge::create([
'amount' => $amount,
'source' => $token,
'currency' => 'usd',
], ['api_key' => $this->apiKey]);
}
}