File: D:/HostingSpaces/SBogers10/blije-gasten.komma.pro/app/Komma/Shop/Payment/PaymentRoutes.php
<?php declare(strict_types = 1);
namespace App\Komma\Shop\Payment;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Route;
class PaymentRoutes
{
public static function web()
{
// PHP redirect after payment hook, after that it will redirect to the right route.
Route::get('transaction/redirect/{order}', PSPResponseController::class.'@redirectHook')->name('transaction.redirectHook');
Route::get('transaction/pay-later/{order}', PSPResponseController::class.'@payLater')->name('transaction.payLater')->middleware('signed');
Route::get('transaction/deposit-payment/{order}', PSPResponseController::class.'@depositPayment')->name('transaction.depositPayment')->middleware('signed');
Route::get('transaction/intake/redirect/{order}', PSPResponseController::class.'@redirectIntakeHook')->name('transaction.intake.redirectHook');
}
public static function pspapi()
{
//PSP webhook url. The url which a PSP can use to update a transaction status.
Route::post('transaction/statusupdate/{order}', PSPResponseController::class.'@processPaymentProviderResponse')->name('transaction.statusupdate');
Route::post('transaction/intake/statusupdate/{order}', PSPResponseController::class.'@processIntakePaymentProviderResponse')->name('transaction.intake.statusupdate');
// Route::get('transaction/statusupdate/{order}', PSPResponseController::class.'@processPaymentProviderResponse')->name('transaction.statusupdate');
//PSP REDIRECT URLS that DO NOT and MUST NOT update a transactions status. They must only inform a user about the status of a transaction and what is going to happen next. Returning a blade HTML view.
//For use with some psp's which only have one redirect url after a user payed at their environment
// Route::get('transaction/result/general/{order?}', PSPResponseController::class.'@showGeneralTransactionResult')->name('transaction.view.general');
//For use with psp's that have the ability to redirect a user after a payment was successful
// Route::get('transaction/result/accepted/{order?}', PSPResponseController::class.'@showAcceptedTransactionResult')->name('transaction.view.accepted');
//For use with psp's that have the ability to redirect a user after a payment was declined
// Route::get('transaction/result/declined/{order?}', PSPResponseController::class.'@showDeclinedTransactionResult')->name('transaction.view.declined');
//For use with psp's that have the ability to redirect a user after an error occured at the PSP and the transaction status is unknown (e.g. requires human intervention)
// Route::get('transaction/result/exception/{order?}', PSPResponseController::class.'@showExceptionTransactionResult')->name('transaction.view.exception');
//For use with psp's that have the ability to redirect a user after the customer canceled the transaction
// Route::get('transaction/result/canceled/{order?}', PSPResponseController::class.'@showCanceledTransactionResult')->name('transaction.view.canceled');
if(App::environment() !== 'production') { //WARNING. Never allow this route on production as it could be misused to update unpaid orders / transactions to paid
//A fake PSP page where you can specify an order status for testing purposes
Route::get('fakepsp/{order}', PSPResponseController::class.'@showFakePSPPage')->name('fakepsp');
}
}
}