restore composer.json, add mysqli extension
This commit is contained in:
20
app/Http/Controllers/Payments/after_pay.php
Executable file
20
app/Http/Controllers/Payments/after_pay.php
Executable file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Billing;
|
||||
use App\Models\Order;
|
||||
use App\Api\Sms;
|
||||
|
||||
$billing = Billing::find($transaction->transactionable_id);
|
||||
$billing->status = 'payed';
|
||||
$billing->transaction_id = $transaction->system_transaction_id;
|
||||
$billing->save();
|
||||
|
||||
|
||||
$sms = new Sms();
|
||||
|
||||
$order = Order::find($billing->order_id);
|
||||
$order->payment_status = 'payed';
|
||||
$order->save();
|
||||
|
||||
$message = "Quyoshli vash zakaz: {$order->id} uspeshno oplachen!";
|
||||
$sms->send($order->user->phone, $message);
|
||||
8
app/Http/Controllers/Payments/before_pay.php
Executable file
8
app/Http/Controllers/Payments/before_pay.php
Executable file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Order;
|
||||
|
||||
$order_id = $model->order_id;
|
||||
Order::query()->where('id', $order_id)->update([
|
||||
'payment_status' => "waiting"
|
||||
]);
|
||||
2
app/Http/Controllers/Payments/before_response.php
Executable file
2
app/Http/Controllers/Payments/before_response.php
Executable file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
return $response;
|
||||
19
app/Http/Controllers/Payments/cancel_pay.php
Executable file
19
app/Http/Controllers/Payments/cancel_pay.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
use App\Api\Sms;
|
||||
use App\Models\Billing;
|
||||
use App\Models\Order;
|
||||
|
||||
$billing = Billing::find($transaction->transactionable_id);
|
||||
$billing->status = 'refused';
|
||||
$billing->save();
|
||||
|
||||
|
||||
$sms = new Sms();
|
||||
|
||||
$order = Order::find($billing->order_id);
|
||||
$order->status = 'cancelled';
|
||||
$order->payment_status = 'cancelled';
|
||||
$order->save();
|
||||
|
||||
$message = "Quyoshli vash zakaz: {$order->id} otmenen!";
|
||||
$sms->send($order->user->phone, $message);
|
||||
10
app/Http/Controllers/Payments/is_proper.php
Executable file
10
app/Http/Controllers/Payments/is_proper.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if ($model->payment_system == 'payme') {
|
||||
$amount = $amount / 100;
|
||||
}
|
||||
|
||||
if ($model->amount == $amount) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
13
app/Http/Controllers/Payments/key_model.php
Executable file
13
app/Http/Controllers/Payments/key_model.php
Executable file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
$id = (int) $key;
|
||||
|
||||
$billing = \App\Models\Billing::find($id);
|
||||
if (!empty($billing)) {
|
||||
if ($billing->status == 'waiting') {
|
||||
return $billing;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
|
||||
3
app/Http/Controllers/Payments/model_key.php
Executable file
3
app/Http/Controllers/Payments/model_key.php
Executable file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
return $model->id;
|
||||
|
||||
1
app/Http/Controllers/Payments/paying.php
Executable file
1
app/Http/Controllers/Payments/paying.php
Executable file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
Reference in New Issue
Block a user