Przeglądaj źródła

Fix single element array bug

tags/v0.1.0
Immanuel Onyeka 3 lat temu
rodzic
commit
ca33810392
5 zmienionych plików z 3 dodań i 6 usunięć
  1. +1
    -1
      app/Http/Controllers/BillingController.php
  2. +0
    -2
      resources/js/main.js
  3. +1
    -1
      resources/js/panel/credits.vue
  4. +1
    -1
      resources/js/panel/services.vue
  5. +0
    -1
      resources/views/panel.blade.php

+ 1
- 1
app/Http/Controllers/BillingController.php Wyświetl plik

@@ -78,7 +78,7 @@ class BillingController extends Controller
public function chargeEvent(Request $request) { public function chargeEvent(Request $request) {
$event = \Stripe\Event::constructFrom($request->all()); $event = \Stripe\Event::constructFrom($request->all());
$charge = $event->data->object; $charge = $event->data->object;
$transaction = Transaction::where('intent_id', $charge->payment_intent);
$transaction = Transaction::where('intent_id', $charge->payment_intent)->first();
$user = $transaction->user; $user = $transaction->user;


if ($event->type == 'charge.succeeded') { if ($event->type == 'charge.succeeded') {


+ 0
- 2
resources/js/main.js Wyświetl plik

@@ -65,8 +65,6 @@ function resendLink(event) {
} else { } else {
event.target.parentNode.getElementsByTagName('h3')[0].innerText = event.target.parentNode.getElementsByTagName('h3')[0].innerText =
`${response.status} : ${response.statusText}` `${response.status} : ${response.statusText}`
response.json().then((data) => {
event.target.parentNode.getElementsByTagName('h3')[0].innerText = data
}) })
} }
}) })


+ 1
- 1
resources/js/panel/credits.vue Wyświetl plik

@@ -107,7 +107,7 @@ function pay() {
document.getElementById('payment-error').textContent = document.getElementById('payment-error').textContent =
result.error.message result.error.message
} else if (result.paymentIntent.status === 'succeeded') { } else if (result.paymentIntent.status === 'succeeded') {
setTimeout(() => {this.$emit('purchaseComplete')}, 4000)
this.$emit('purchaseComplete')
this.complete = true this.complete = true
} else { } else {
document.getElementById('payment-error').textContent = document.getElementById('payment-error').textContent =


+ 1
- 1
resources/js/panel/services.vue Wyświetl plik

@@ -81,7 +81,7 @@


</template> </template>


<credits @purchase-complete="$emit('updateUser')" :preferred="preferred" :token="token" v-if="page == 'credits'"></credits>
<credits @purchase-complete="setTimeout(() => {updateUser, 4000)" :preferred="preferred" :token="token" v-if="page == 'credits'"></credits>


</div> </div>
</template> </template>


+ 0
- 1
resources/views/panel.blade.php Wyświetl plik

@@ -5,7 +5,6 @@


@section('head-metas') @section('head-metas')
@parent @parent
<link rel="stylesheet" href="{{asset('main.css')}}">
@endsection @endsection


@section('content') @section('content')


Ładowanie…
Anuluj
Zapisz