mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-22 14:04:01 +00:00
Merge branch 'refund-booking' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into development
This commit is contained in:
@@ -11,6 +11,7 @@ use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -73,7 +74,25 @@ class UpdateGroupTransferFeeLogic extends AbstractControllerLogic
|
||||
$fee, $fee, $group->original_currency_id, $group->original_currency_id,
|
||||
1, 0, 0, null, ApprovalStatus::APPROVED);
|
||||
|
||||
$this->createsTransaction->execute($group, $object);
|
||||
$model = new Transaction();
|
||||
$model->bill_no = $object->getBillNo();
|
||||
$model->type = $object->getTransactionType();
|
||||
$model->issuer = $object->getIssuer();
|
||||
$model->receiver = $object->getReceiver();
|
||||
$model->recipient_bank_account_id = $object->getRecipientBankAccountId();
|
||||
$model->payment_method = $object->getPaymentMethod();
|
||||
$model->amount = $object->getAmount();
|
||||
$model->original_amount = $object->getOriginalAmount();
|
||||
$model->currency_id = $object->getCurrencyId();
|
||||
$model->original_currency_id = $object->getOriginalCurrencyId();
|
||||
$model->currency_rate = $object->getCurrencyRate();
|
||||
$model->tax = $object->getTax();
|
||||
$model->service_charge = $object->getServiceCharge();
|
||||
$model->expires_on = $object->getExpiresOn();
|
||||
$model->status = $object->getStatus();
|
||||
$model->payment_reference = $object->getPaymentReference();
|
||||
|
||||
$group->morphTransactions()->save($model);
|
||||
}
|
||||
|
||||
return $this->resourceResponse(new GroupResource($group));
|
||||
|
||||
+2
-2
@@ -100,7 +100,7 @@ class UpdateRefundTransactionStatusLogic extends AbstractControllerLogic
|
||||
|
||||
$booking = $paymentTransaction->owner;
|
||||
|
||||
$reference = $refundTransaction->amount == $paymentTransaction->amount ? 'Fully Refund for Ref. ' . $booking->marking : 'Partially Refund for Ref. ' . $booking->marking;
|
||||
$reference = $refundTransaction->amount - $paymentTransaction->amount < 0.01 ? 'Fully Refund for Ref. ' . $booking->marking : 'Partially Refund for Ref. ' . $booking->marking;
|
||||
|
||||
$refundAmount = $this->calculatesBookingRefundAmount->calculateRefundAmount($paymentTransaction, $booking->fix_currency_id);
|
||||
|
||||
@@ -114,7 +114,7 @@ class UpdateRefundTransactionStatusLogic extends AbstractControllerLogic
|
||||
$this->updatesTransactionStatus->execute($po_transaction, (float) number_format($po_transaction->amount, 2, '.', '') === (float) number_format((float)$booking->fix_amount - $refundAmount, 2, '.', '') ? ApprovalStatus::PENDING_VERIFICATION : ApprovalStatus::PENDING_SUBMISSION);
|
||||
}
|
||||
|
||||
$request['fix_amount'] = $booking->fix_amount - $refundAmount;
|
||||
$request['fix_amount'] = $paidAmount;
|
||||
$request->route()->setParameter('id', $booking->id);
|
||||
$this->updateBookingAmountLogic->execute($request);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace App\Classes\Modules\Transactions\Services;
|
||||
use App\Classes\General\Eloquent\AbstractUpdateRelationshipRecord;
|
||||
use App\Classes\General\Interfaces\Transactionable;
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
||||
use App\Models\Group;
|
||||
use App\Models\Transaction;
|
||||
|
||||
class CreatesTransaction extends AbstractUpdateRelationshipRecord
|
||||
@@ -16,7 +15,7 @@ class CreatesTransaction extends AbstractUpdateRelationshipRecord
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(Transactionable|Group $transactionable, TransactionObject $object) {
|
||||
public function execute(Transactionable $transactionable, TransactionObject $object) {
|
||||
$model = new Transaction();
|
||||
$model->bill_no = $object->getBillNo();
|
||||
$model->type = $object->getTransactionType();
|
||||
@@ -35,10 +34,6 @@ class CreatesTransaction extends AbstractUpdateRelationshipRecord
|
||||
$model->status = $object->getStatus();
|
||||
$model->payment_reference = $object->getPaymentReference();
|
||||
|
||||
if ($transactionable instanceof Group) {
|
||||
return $this->handler($transactionable->morphTransactions(), $model);
|
||||
}
|
||||
|
||||
return $this->handler($transactionable->transactions(), $model);
|
||||
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
return {
|
||||
error: '',
|
||||
parameters: {
|
||||
fee: (Math.round((this.transfer_fee + Number.EPSILON) * 10000) / 10000).toFixed(5)
|
||||
fee: (Math.round((this.transfer_fee + Number.EPSILON) * 100) / 100).toFixed(2)
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -93,8 +93,8 @@
|
||||
</div>
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<p class="no-margin" v-if="serviceType.id === 1">Recipient will receive the transfer on the <span class="text-success bold">next working day</span>. Check out our three-day transfer option to get a better rate!</p>
|
||||
<p class="no-margin" v-if="serviceType.id === 3">Enjoy a <span class="bold text-underline">better rate</span> with this option! The recipient will receive the transfer after <span class="text-success bold">three working days</span>.</p>
|
||||
<p class="no-margin" v-if="serviceType.id === 1">The recipient can expect to receive the transfer within <span class="text-success bold">1-3 working days</span>. Explore our BANK TRANSFER (SAVER) option for a better rate!</p>
|
||||
<p class="no-margin" v-if="serviceType.id === 3">Enjoy a <span class="bold text-underline">better rate</span> with this option! The recipient will receive the transfer after <span class="text-success bold">3-5 working days.</span>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user