mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 20:43:56 +00:00
c907903244
# Conflicts: # app/Models/Company.php
40 lines
1.6 KiB
PHP
40 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Transactions\Services;
|
|
|
|
use App\Classes\General\Eloquent\AbstractUpdateRecord;
|
|
use App\Classes\General\Eloquent\AbstractUpdateRelationshipRecord;
|
|
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
|
use App\Models\Wallet;
|
|
use App\Models\Transaction;
|
|
|
|
class CreatesWalletTransaction extends AbstractUpdateRelationshipRecord
|
|
{
|
|
/**
|
|
* @param TransactionObject $object
|
|
* @return \Illuminate\Database\Eloquent\Model
|
|
* @throws \App\Classes\Exceptions\MalformedRequestException
|
|
*/
|
|
public function execute(Wallet $wallet, TransactionObject $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();
|
|
|
|
return $this->handler($wallet->transactions(), $model);
|
|
|
|
}
|
|
}
|