Explorar el Código

Retrieve the stripe key through the cache

tags/v0.1.0
Immanuel Onyeka hace 3 años
padre
commit
800fe00a1f
Se han modificado 5 ficheros con 6 adiciones y 8 borrados
  1. +2
    -7
      app/Http/Controllers/BillingController.php
  2. +0
    -0
      artisan
  3. +0
    -0
      build.sh
  4. +1
    -1
      config/mail.php
  5. +3
    -0
      resources/js/main.js

+ 2
- 7
app/Http/Controllers/BillingController.php Ver fichero

@@ -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);


+ 0
- 0
artisan Ver fichero


+ 0
- 0
build.sh Ver fichero


+ 1
- 1
config/mail.php Ver fichero

@@ -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' => [


+ 3
- 0
resources/js/main.js Ver fichero

@@ -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();


Cargando…
Cancelar
Guardar