diff --git a/app/Http/Controllers/BillingController.php b/app/Http/Controllers/BillingController.php index 2493718..f43d8c1 100644 --- a/app/Http/Controllers/BillingController.php +++ b/app/Http/Controllers/BillingController.php @@ -18,8 +18,8 @@ class BillingController extends Controller public function __construct() { - $this->stripe = new \Stripe\StripeClient(env('STRIPE_SECRET')); - Stripe::setApiKey(env('STRIPE_SECRET')); + $this->stripe = new \Stripe\StripeClient(config('services.stripe.secret')); + Stripe::setApiKey(config('services.stripe.secret')); $this->user = Auth::user(); } @@ -28,8 +28,6 @@ class BillingController extends Controller //was bought later. //Should validate that all amounts are positive integers in a reasonable range public function secret(Request $request) { - Stripe::setApiKey(env('STRIPE_SECRET')); - $user = Auth::user(); $amount = $request->packs[ 'credits10' ]*1099 + $request->packs[ 'credits50' ]*5499 + $request->packs[ 'credits100' ]*10999 @@ -71,8 +69,6 @@ class BillingController extends Controller } public function getCards() { - Stripe::setApiKey(env('STRIPE_SECRET')); - return PaymentMethod::all([ 'customer' => Auth::user()->customer_id, 'type' => 'card' @@ -80,7 +76,6 @@ class BillingController extends Controller } public function chargeEvent(Request $request) { - Stripe::setApiKey(env('STRIPE_SECRET')); $event = \Stripe\Event::constructFrom($request->all()); $charge = $event->data->object; $transaction = Transaction::where('intent_id', $charge->payment_intent); diff --git a/artisan b/artisan old mode 100755 new mode 100644 diff --git a/build.sh b/build.sh old mode 100755 new mode 100644 diff --git a/config/mail.php b/config/mail.php index 54299aa..8f76d63 100644 --- a/config/mail.php +++ b/config/mail.php @@ -42,7 +42,7 @@ return [ 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'timeout' => null, - 'auth_mode' => null, + 'auth_mode' => env('MAIL_AUTH_MODE'), ], 'ses' => [ diff --git a/resources/js/main.js b/resources/js/main.js index a6c9a3f..0a78a0d 100644 --- a/resources/js/main.js +++ b/resources/js/main.js @@ -65,6 +65,9 @@ function resendLink(event) { } else { event.target.parentNode.getElementsByTagName('h3')[0].innerText = `${response.status} : ${response.statusText}` + response.json().then((data) => { + event.target.parentNode.getElementsByTagName('h3')[0].innerText = data + }) } }) event.preventDefault();