diff --git a/app/Http/Controllers/WebpayController.php b/app/Http/Controllers/WebpayController.php index cd1a79d..b19d093 100644 --- a/app/Http/Controllers/WebpayController.php +++ b/app/Http/Controllers/WebpayController.php @@ -24,10 +24,10 @@ public function create() { $createTx = [ - 'buyOrder' => "O-" . rand(1, 10000), - "sessionId" => "S-" . rand(1, 10000), + 'buyOrder' => "O-" . random_int(1, 10000), + "sessionId" => "S-" . random_int(1, 10000), 'returnUrl' => url('/') . '/webpay-plus/commit', - 'amount' => rand(1000, 2000) + 'amount' => random_int(1000, 2000) ]; diff --git a/app/Http/Controllers/WebpayPlusDeferredController.php b/app/Http/Controllers/WebpayPlusDeferredController.php index 8586d60..35c5b83 100644 --- a/app/Http/Controllers/WebpayPlusDeferredController.php +++ b/app/Http/Controllers/WebpayPlusDeferredController.php @@ -22,10 +22,10 @@ public function create() { $createTx = [ - 'buyOrder' => "O-" . rand(1, 10000), - "sessionId" => "S-" . rand(1, 10000), + 'buyOrder' => "O-" . random_int(1, 10000), + "sessionId" => "S-" . random_int(1, 10000), 'returnUrl' => url('/') . '/webpay-plus-diferido/commit', - 'amount' => rand(1000, 2000) + 'amount' => random_int(1000, 2000) ]; diff --git a/app/Http/Controllers/WebpayPlusMallController.php b/app/Http/Controllers/WebpayPlusMallController.php index 4234d20..e5085e3 100644 --- a/app/Http/Controllers/WebpayPlusMallController.php +++ b/app/Http/Controllers/WebpayPlusMallController.php @@ -21,19 +21,19 @@ public function create() { $createTx = [ - "buy_order" => "O-" . rand(1, 10000), - "session_id" => "S-" . rand(1, 10000), + "buy_order" => "O-" . random_int(1, 10000), + "session_id" => "S-" . random_int(1, 10000), "return_url" => url("/") . "/webpay-mall/commit", "details" => [ [ "amount" => 10000, "commerce_code" => 597055555536, - "buy_order" => "ordenCompraDetalle1234" + "buy_order" => "ordenCompraDetalle" . random_int(1, 10000) ], [ "amount" => 12000, "commerce_code" => 597055555537, - "buy_order" => "ordenCompraDetalle4321" + "buy_order" => "ordenCompraDetalle" . random_int(1, 10000) ], ] ]; diff --git a/app/Http/Controllers/WebpayPlusMallDeferredController.php b/app/Http/Controllers/WebpayPlusMallDeferredController.php index 931d160..144ccd7 100644 --- a/app/Http/Controllers/WebpayPlusMallDeferredController.php +++ b/app/Http/Controllers/WebpayPlusMallDeferredController.php @@ -21,19 +21,19 @@ public function create() { $createTx = [ - 'buy_order' => "O-" . rand(1, 10000), - "session_id" => "S-" . rand(1, 10000), + 'buy_order' => "O-" . random_int(1, 10000), + "session_id" => "S-" . random_int(1, 10000), 'return_url' => url('/') . '/webpay-mall-diferido/commit', 'details' => [ [ "amount" => 10000, "commerce_code" => 597055555582, - "buy_order" => "ordenCompraDetalle" . rand(1, 10000) + "buy_order" => "ordenCompraDetalle" . random_int(1, 10000) ], [ "amount" => 12000, "commerce_code" => 597055555583, - "buy_order" => "ordenCompraDetalle" . rand(1, 10000) + "buy_order" => "ordenCompraDetalle" . random_int(1, 10000) ], ] ];