https://www.youtube.com/watch?v=03Q6RQQJAs0
Gość trochę słabo tłumaczy na jakiej zasadzie przychodzi informacja zwrotna, bo do mnie nie przychodzi:
Plik .env
PRZELEWY24_MERCHANT_ID="000000(id)" PRZELEWY24_POS_ID="000000 (id)" PRZELEWY24_CRC="Klucz do CRC (sandbox)" PRZELEWY24_REPORT_KEY="Klucz do raportów (sandbox)" PRZELEWY24_URL_RETURN="https://electroit.pl/payment/order" PRZELEWY24_URL_STATUS="https://electroit.pl/payment/status" PRZELEWY24_TEST_SERVER=true PRZELEWY24_WAIT_FOR_RESULT=true
plik web.php
Route::post("/payment/status", [\App\Http\Controllers\PaymentController::class, "status"])->withoutMiddleware(['csrf']);
PaymentController.php
<?php namespace App\Http\Controllers; use App\Enums\PaymentsStatus; use App\Models\Payment; use Devpark\Transfers24\Requests\Transfers24; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; class PaymentController extends Controller { private Transfers24 $transfers24; public function __construct(Transfers24 $transfers24) { $this->transfers24 = $transfers24; } public function status(Request $request): void { Log::error(json_encode($request)); $response = $this->transfers24->receive($request); $payment = Payment::where("session_id", $response->getSessionId())->firstOrFail(); if ($response->isSuccess()) { Log::error("Poprawnie"); $payment->status = PaymentsStatus::SUCCESS; } else { $payment->status = PaymentsStatus::FAIL; Log::error("Zle"); } $payment->save(); } }
I nie mam żadnej informacji zwrotnej... Status wcale mi się nie wykonuje... Rozmawiałem z supportem i piszą że w odpowiedzi na notyfikacje otrzymują poniższe responseBody:
Kod
[responseBody] => Page Expired
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}a{background-color:transparent}code{font-family:monospace,monospace;font-size:1em}[hidden]{display:none}html{font-family:sy
[httpResponseCode] => 419
[connectionTotalTime] => 0.156787
[error] =>
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}a{background-color:transparent}code{font-family:monospace,monospace;font-size:1em}[hidden]{display:none}html{font-family:sy
[httpResponseCode] => 419
[connectionTotalTime] => 0.156787
[error] =>
zrobiłem... respond musiałem przenieść na api, a następnie komenda:
Kod
php artisan config:cache
no i działa