migrate wallet from exchange to shipping portal

This commit is contained in:
WAKOYA_KUMSA\waqo1
2022-12-27 17:05:46 +03:00
parent 9f834faa10
commit 5ac234cb34
50 changed files with 1981 additions and 5 deletions
@@ -1,6 +1,6 @@
<?php
namespace App\Http\Controllers\Invoice;
namespace App\Http\Controllers\Transactions;
use App\Http\Controllers\Controller;
use App\Classes\Modules\Transactions\ControllersLogic\multipleInvoicesWithOnePaymentLogic;
@@ -19,6 +19,7 @@ use App\Classes\Modules\Billplzs\Services\CreatesBillplzBill;
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
use App\Classes\Modules\Wallets\Services\GeneratesWalletCode;
use App\Classes\Modules\Wallets\Services\CreatesWallet;
use APP\models\PackingList;
use App\Models\multipleInvoicesWithOnePayment;
use DB;
@@ -36,7 +37,6 @@ class MultipleInvoiceOnePaymentController extends Controller
{
// dd(json_decode($transactionsArray));
$transactions = Transaction::whereIn('id', json_decode($transactionsArray))->where('type', TransactionType::SHIPPING_INVOICE)->get();
$total = $transactions->sum('amount');
$packingList =$transactions[1]->owner;
@@ -44,6 +44,7 @@ class MultipleInvoiceOnePaymentController extends Controller
$companyModule = $order->companyModule;
$company = $companyModule->company;
$wallet = $company->wallets()->first();
// dd(json_decode($transactionsArray));
if (!$wallet) {
$object = new WalletObject($company->id, 1, $this->generatesWalletCode->execute());
@@ -58,6 +59,7 @@ class MultipleInvoiceOnePaymentController extends Controller
}
$billPlzBill = (App()->make(CreatesBillplzBill::class))->execute($company->name, 'example@gmail.com', 'This payment is credit topup for company ref. ' . $company->reference, $total, $billNumber, 'bank code', true);
$transaction_object = new TransactionObject($billNumber, TransactionType::TOP_UP, 1, $company->id, 1, PaymentMethodType::PAYMENT_GATEWAY, $total, $total, 1, 1, 1, 0, 0, null, ApprovalStatus::PENDING_SUBMISSION, [], 'test');
// $transaction = $this->createsTransaction->execute($wallet, $transaction_object);