wip
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
use App\Models\Auth\Verification;
|
||||
use App\Models\Ecommerce\Channel\Channel;
|
||||
use App\Models\Ecommerce\Product\Inventory\Inventory;
|
||||
use App\Models\System\Settings\Settings;
|
||||
use App\Repositories\Ecommerce\Product\Barcode\BarcodeRepository;
|
||||
use Illuminate\Http\Client\PendingRequest;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -71,21 +70,21 @@ if (! function_exists('sendSMS')) {
|
||||
function sendSMS(string|int $phone, string|int $message): mixed
|
||||
{
|
||||
$response = Http::retry(
|
||||
times: 3,
|
||||
sleepMilliseconds: 50,
|
||||
throw: false,
|
||||
when: function (Exception $exception, PendingRequest $request) {
|
||||
Log::channel('sms_api_error')
|
||||
->error('Exception: ', [
|
||||
'message' => $exception->getMessage(),
|
||||
'line' => $exception->getLine(),
|
||||
]);
|
||||
times: 3,
|
||||
sleepMilliseconds: 50,
|
||||
throw: false,
|
||||
when: function (Exception $exception, PendingRequest $request) {
|
||||
Log::channel('sms_api_error')
|
||||
->error('Exception: ', [
|
||||
'message' => $exception->getMessage(),
|
||||
'line' => $exception->getLine(),
|
||||
]);
|
||||
|
||||
return true;
|
||||
})
|
||||
return true;
|
||||
})
|
||||
->post('http://216.250.14.144:3000/api/data', [
|
||||
'phone' => '+993'.$phone,
|
||||
'code' => $message,
|
||||
'phone' => '+993'.$phone,
|
||||
'code' => $message,
|
||||
]);
|
||||
|
||||
return $response->body();
|
||||
@@ -355,7 +354,7 @@ if (! function_exists('calculateProductPriceAmount')) {
|
||||
*/
|
||||
function halkbankCredentials(string $key = ''): int|string|array
|
||||
{
|
||||
return match($key) {
|
||||
return match ($key) {
|
||||
'username' => 516122500260,
|
||||
'password' => 'MrZsO9wfgWOBjf4',
|
||||
default => [
|
||||
@@ -368,7 +367,7 @@ function halkbankCredentials(string $key = ''): int|string|array
|
||||
/**
|
||||
* Create halkbank order
|
||||
*
|
||||
* @param string $price
|
||||
* @param string $price
|
||||
* @return array{status: string, url: string|null}
|
||||
*/
|
||||
function createHalkbankOrder($price = 123): array
|
||||
|
||||
@@ -47,14 +47,14 @@ class OrderController extends Controller
|
||||
$url = $response['url'];
|
||||
|
||||
$order->update([
|
||||
'halkbank_id' => $response['orderId']
|
||||
'halkbank_id' => $response['orderId'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->rest([
|
||||
'order_id' => $order->id,
|
||||
'payment_url' => $url
|
||||
'payment_url' => $url,
|
||||
], 201);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class OnlinePaymentController extends Controller
|
||||
public function index(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'orderId' => ['required', 'string']
|
||||
'orderId' => ['required', 'string'],
|
||||
]);
|
||||
|
||||
$resource = Order::query()->where('halkbank_id', $request->orderId)->first();
|
||||
@@ -46,7 +46,7 @@ class OnlinePaymentController extends Controller
|
||||
}
|
||||
|
||||
public function view(
|
||||
$status = false,
|
||||
$status,
|
||||
$message,
|
||||
string $pnr = '-',
|
||||
string $branch_name = 'MM.COM.TM',
|
||||
|
||||
@@ -33,8 +33,6 @@ class TestController extends Controller
|
||||
public function ok()
|
||||
{
|
||||
|
||||
|
||||
|
||||
if (! app()->isProduction()) {
|
||||
auth()->login(User::where('email', 'nurmuhammet@mail.com')->first());
|
||||
|
||||
|
||||
@@ -99,13 +99,13 @@ class SendOrderCreatedNotification implements ShouldQueue
|
||||
// Log::channel('order_sms_notification_sent_activity')
|
||||
// ->info(sprintf('SMS_SENT_FOR_ORDER[id, phone]: %s, %s', $order->id, orderAdminNumber()));
|
||||
|
||||
// User::where('phone_number', orderAdminNumber())->first()->notify(
|
||||
// NovaNotification::make()
|
||||
// ->message('Täze sargyt.')
|
||||
// ->action('Gör', sprintf('/turkmenpostadmin/resources/orders/%s', $order->id))
|
||||
// ->icon('download')
|
||||
// ->type('info')
|
||||
// );
|
||||
// User::where('phone_number', orderAdminNumber())->first()->notify(
|
||||
// NovaNotification::make()
|
||||
// ->message('Täze sargyt.')
|
||||
// ->action('Gör', sprintf('/turkmenpostadmin/resources/orders/%s', $order->id))
|
||||
// ->icon('download')
|
||||
// ->type('info')
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user