mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
Add update transaction status to refunded transaction
This commit is contained in:
@@ -75,6 +75,8 @@ class CreateBookingRefundLogic extends AbstractControllerLogic
|
||||
$booking = Booking::find($request->route('id'));
|
||||
|
||||
$transaction = $this->fetchesTransaction->execute(['id' => $request->route('payment_id')]);
|
||||
|
||||
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::REFUNDED);
|
||||
|
||||
$paymentAttemptLimit = $this->fetchesCompanyPaymentAttemptLimit->execute($booking->company);
|
||||
|
||||
@@ -87,8 +89,6 @@ class CreateBookingRefundLogic extends AbstractControllerLogic
|
||||
$transaction->tax, $transaction->service_charge, Carbon::now()->addMinutes($paymentAttemptLimit), ApprovalStatus::PENDING_VERIFICATION);
|
||||
|
||||
$transaction = $this->createsTransaction->execute($booking, $object);
|
||||
|
||||
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::REFUNDED);
|
||||
|
||||
return $this->resourceResponse(new TransactionResource($transaction));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class CreateBookingRefundController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param CreateBookingPaymentLogic $logic
|
||||
* @param CreateBookingRefundLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function create(Request $request, CreateBookingRefundLogic $logic): JsonResponse {
|
||||
|
||||
@@ -20,6 +20,7 @@ Route::group(['prefix' => 'booking', 'as' => 'booking.', 'namespace' => 'Booking
|
||||
|
||||
Route::group(['prefix' => '{id}/refund', 'as' => 'refund.'], function () {
|
||||
Route::post('{payment_id}/create', 'CreateBookingRefundController@create')->name('create');
|
||||
Route::post('{payment_id}/credit_note/create', 'CreateBookingRefundCreditNoteController@create')->name('credit_note.create');
|
||||
});
|
||||
|
||||
Route::post('{id}/purchase_order/verification', 'ApprovePurchaseOrderController@approve')->name('po.approval');
|
||||
|
||||
Reference in New Issue
Block a user