Add update transaction status to refunded transaction

This commit is contained in:
ahmedsophyudden
2021-08-28 10:39:00 +08:00
parent 338b8dd648
commit f63f57ad57
3 changed files with 4 additions and 3 deletions
@@ -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 {
+1
View File
@@ -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');