支払いゲートウェイから支払いステータス情報を受け取るコールバック URL を設定する方法を見つけようとしています。
全体の構成をまとめておきます。Laravel 5.8 で構築されたバックエンド (API エンドポイント) があり、反応アプリとモバイル アプリによって消費されます。どちらのアプリも、支払いゲートウェイの Web SDK とモバイル SDK を使用して支払いトランザクションを開始します。
次に、セットアップが必要なコールバック API を呼び出して、支払いゲートウェイが支払いステータスで応答する必要があります。
このようなことをするのはこれが初めての試みです。
コールバック エンドポイント
Route::post('order/payment/status', 'PaymentController@getStatus'); // receives payment status
PaymentControllergetstatus()メソッド
public function getStatus(Request $request)
{
$paymentMethod = $request->paymentMethod;
$amount = $request->amount;
$providerCode = $request->provider;
$customerName = $request->customerName;
$customerEmail = $request->customerEmail;
$paymentDescription = $request->paymentDescription;
$paymentStatus = $request->paaymentStatus;
$transactionReference = $request->transactionReference;
// update my record based on the paymentStatus
}
これは適切な方法ですか?getではなくリクエストであるべきだと思いpostます。助けてください。