diff --git a/app/Billing/StripePaymentGateway.php b/app/Billing/StripePaymentGateway.php new file mode 100644 index 0000000..6f5a988 --- /dev/null +++ b/app/Billing/StripePaymentGateway.php @@ -0,0 +1,24 @@ +apiKey = $apiKey; + } + + public function charge($amount, $token) + { + Charge::create([ + 'amount' => $amount, + 'source' => $token, + 'currency' => 'usd', + ], ['api_key' => $this->apiKey]); + } +} diff --git a/tests/unit/Billing/StripePaymentGatewayTest.php b/tests/unit/Billing/StripePaymentGatewayTest.php index 07fb0fb..119c160 100644 --- a/tests/unit/Billing/StripePaymentGatewayTest.php +++ b/tests/unit/Billing/StripePaymentGatewayTest.php @@ -1,5 +1,6 @@ [