diff --git a/app/Http/Controllers/BillingController.php b/app/Http/Controllers/BillingController.php index c4fd98e..4d13b4e 100644 --- a/app/Http/Controllers/BillingController.php +++ b/app/Http/Controllers/BillingController.php @@ -6,6 +6,7 @@ use Illuminate\Http\Request; use Stripe\Stripe; use Stripe\Customer; use Stripe\PaymentIntent; +use Stripe\PaymentMethod; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Auth; @@ -29,9 +30,17 @@ class BillingController extends Controller 'amount' => $amount, 'currency' => 'usd', 'customer' => Auth::user()->customer_id, - 'metadata' => ['integration_check' => 'accept_a_payment'] + 'metadata' => ['transaction_id' => 'accept_a_payment'] ]); return $intent->client_secret; } + + public function getCards() { + Stripe::setApiKey(env('STRIPE_SECRET')); + return PaymentMethod::all([ + 'customer' => Auth::user()->customer_id, + 'type' => 'card' + ]); + } } diff --git a/config/services.php b/config/services.php index 2a1d616..cada514 100644 --- a/config/services.php +++ b/config/services.php @@ -30,4 +30,9 @@ return [ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], + 'stripe' => [ + 'key' => env('STRIPE_KEY'), + 'secret' => env('STRIPE_SECRET'), + ], + ]; diff --git a/resources/js/panel/credits.vue b/resources/js/panel/credits.vue index f547e8c..55e8700 100644 --- a/resources/js/panel/credits.vue +++ b/resources/js/panel/credits.vue @@ -19,9 +19,8 @@
-