Browse Source

Use cache for stripe calls in user controller

tags/v0.1.0
Immanuel Onyeka 3 years ago
parent
commit
51d4e47f22
3 changed files with 4 additions and 19535 deletions
  1. +1
    -0
      .gitignore
  2. +3
    -3
      app/Http/Controllers/UserController.php
  3. +0
    -19532
      package-lock.json

+ 1
- 0
.gitignore View File

@@ -4,6 +4,7 @@ node_modules
ses
resources/assets
vendor/
package-lock.json


# local env files


+ 3
- 3
app/Http/Controllers/UserController.php View File

@@ -25,7 +25,7 @@ class UserController extends Controller
'password' => 'required|confirmed|min:8|regex:/[a-z]/|regex:/[A-Z]/|regex:/[0-9]/'
]);

Stripe::setApiKey(env('STRIPE_SECRET'));
Stripe::setApiKey(config('services.stripe.secret'));

$user = new User;
$user->name = $request->name;
@@ -100,7 +100,7 @@ class UserController extends Controller
$validated = $request->validate([
'name' => 'required|max:30'
]);
Stripe::setApiKey(env('STRIPE_SECRET'));
Stripe::setApiKey(config('services.stripe.secret'));
$user = Auth::user();
$user->name = $request->name;
Customer::update($user->customer_id, ['name' => $request->name]);
@@ -122,7 +122,7 @@ class UserController extends Controller
}

public function resetEmail(Request $request) {
Stripe::setApiKey(env('STRIPE_SECRET'));
Stripe::setApiKey(config('services.stripe.secret'));

if (! $request->hasValidSignature()) {
abort(401);


+ 0
- 19532
package-lock.json
File diff suppressed because it is too large
View File


Loading…
Cancel
Save