diff --git a/app/Http/Controllers/BillingController.php b/app/Http/Controllers/BillingController.php index a76eb4c..a823c40 100644 --- a/app/Http/Controllers/BillingController.php +++ b/app/Http/Controllers/BillingController.php @@ -93,7 +93,7 @@ class BillingController extends Controller $transaction = Transaction::where('intent_id', $charge->payment_intent)->first(); if ($event->type == 'charge.succeeded') { - $this->creditUser($transaction->id) + $this->creditUser($transaction->id); } else { $transaction->status = $charge->status; $transaction->save(); @@ -174,15 +174,14 @@ class BillingController extends Controller $arHash[] = $secret; $signature = strtoupper(hash('sha256', implode(':', $arHash))); - if ($signature == $request->m_sign && $request->m_status == 'success') - { - $this->creditUser((int) $request->m_orderid) + if ($signature == $request->m_sign && $request->m_status == 'success'){ + $this->creditUser((int) $request->m_orderid); return $request->m_orderid.'|success'; } else { - return $request->m_orderid.'|error'; $transaction = Transaction::find($request->orderid); $transaction->status = 'error'; $transaction->save(); + return $request->m_orderid.'|error'; } } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 6e01f32..0cb00f3 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -94,7 +94,7 @@ class UserController extends Controller //This should limit non pending orders to 50. Should also return a json of all services public function getOrders(Request $request) { return Auth::user()->orders()->with('service')->withCasts(['updated_at' - => 'datetime:d-m-Y'])->latest()->get(); + => 'datetime:d-m-Y'])->latest()->limit(100)->get(); } public function changeName(Request $request) { diff --git a/resources/js/panel/credits.vue b/resources/js/panel/credits.vue index 638234b..41a61bb 100644 --- a/resources/js/panel/credits.vue +++ b/resources/js/panel/credits.vue @@ -87,9 +87,9 @@ function getSecret() { function pay() { if (this.method == 'payeer') { - this.payPayeer(); + this.payPayeer() } else if (this.method == 'pm') { - this.payPm(); + this.payPm() } } @@ -122,7 +122,6 @@ function payPayeer() { form.appendChild(this.makeInput('m_params', data.params)) form.appendChild(this.makeInput('m_cipher_method', 'AES-256-CBC')) form.submit() - /* console.log(data.description) */ /* console.log(data.signature) */ }) diff --git a/resources/js/panel/panel.vue b/resources/js/panel/panel.vue index fdcf779..ad6af1f 100644 --- a/resources/js/panel/panel.vue +++ b/resources/js/panel/panel.vue @@ -42,7 +42,8 @@ v-else-if="active === '#settings'"> - diff --git a/resources/js/panel/transaction-endpoint.vue b/resources/js/panel/transaction-endpoint.vue index 50222a5..68d6da6 100644 --- a/resources/js/panel/transaction-endpoint.vue +++ b/resources/js/panel/transaction-endpoint.vue @@ -1,12 +1,12 @@