Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 committed Jan 8, 2025
2 parents b4db0bb + 0c9f981 commit 09ec2d0
Show file tree
Hide file tree
Showing 27 changed files with 268 additions and 255 deletions.
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,8 @@
}
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"suggest": {
"fintech/reload": "To use payment via interac-e-transfer"
}
}
4 changes: 2 additions & 2 deletions config/remit.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
*/
'wallet_transfer_model' => WalletTransfer::class,

//** Model Config Point Do not Remove **//
// ** Model Config Point Do not Remove **//

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -207,7 +207,7 @@

\Fintech\Remit\Interfaces\WalletTransferRepository::class => WalletTransferRepository::class,

//** Repository Binding Config Point Do not Remove **//
// ** Repository Binding Config Point Do not Remove **//
],

];
3 changes: 3 additions & 0 deletions database/seeders/RemitSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ private function data(): array
'logo_png' => "{$image_png}wallet_transfer.png",
'service_type_is_parent' => 'yes',
'service_type_is_description' => 'no',
'service_settings' => [
'beneficiary_type_id' => intval(Banco::beneficiaryType()->findWhere(['slug' => 'wallet-transfer'])?->id ?? 1),
],
],
];
}
Expand Down
3 changes: 1 addition & 2 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
});
Route::post('wallet-verification', WalletVerificationController::class)->name('wallet-verification');
Route::get('islami-bank-account-type-code', [VendorTestController::class, 'islamiBankAccountTypeCode'])->name('islami-bank-account-type-code');

//DO NOT REMOVE THIS LINE//
// DO NOT REMOVE THIS LINE//

Route::prefix('charts')->name('charts.')->group(function () {
Route::get('withdraw-partner-summary', WithdrawPartnerSummaryController::class)
Expand Down
4 changes: 2 additions & 2 deletions routes/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
Route::get('islami-bank-account-type-code', [VendorTestController::class, 'islamiBankAccountTypeCode'])
->name('islami-bank-account-type-code');

//MEGHNABANK
// MEGHNABANK
Route::get('meghna-bank-api-connection-check', [VendorTestController::class, 'meghnaBankConnectionCheck'])
->name('meghna-bank-api-connection-check');

//SSL VR
// SSL VR
Route::get('ssl-vr-api-connection-check', [VendorTestController::class, 'sslVRConnectionCheck'])
->name('ssl-vr-api-connection-check');
2 changes: 1 addition & 1 deletion src/Commands/AgraniBankSetupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private function addServiceVendor(): void
}
}

//add country code all country
// add country code all country
public function addCountryCodeToCountries(): void
{
if (Core::packageExists('MetaData')) {
Expand Down
10 changes: 5 additions & 5 deletions src/Http/Controllers/BankTransferController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Fintech\Core\Exceptions\RestoreOperationException;
use Fintech\Core\Exceptions\StoreOperationException;
use Fintech\Core\Exceptions\UpdateOperationException;
use Fintech\Remit\Events\RemitTransferRequested;
use Fintech\Remit\Facades\Remit;
use Fintech\Remit\Http\Requests\ImportBankTransferRequest;
use Fintech\Remit\Http\Requests\IndexBankTransferRequest;
Expand Down Expand Up @@ -90,6 +89,7 @@ public function store(StoreBankTransferRequest $request): JsonResponse
return response()->created([
'message' => __('core::messages.transaction.request_created', ['service' => 'Bank Transfer']),
'id' => $bankTransfer->getKey(),
'order_number' => $bankTransfer->order_number ?? $bankTransfer->order_data['purchase_number'],
]);

} catch (Exception $exception) {
Expand Down Expand Up @@ -372,7 +372,7 @@ public function storeWithoutInsufficientBalance(StoreBankTransferRequest $reques
throw new Exception('Master User Account not found for '.$request->input('source_country_id', $depositor->profile?->country_id).' country');
}

//set pre defined conditions of deposit
// set pre defined conditions of deposit
$inputs['transaction_form_id'] = Transaction::transactionForm()->findWhere(['code' => 'money_transfer'])->getKey();
$inputs['user_id'] = $user_id ?? $depositor->getKey();
$delayCheck = Transaction::order()->transactionDelayCheck($inputs);
Expand All @@ -392,7 +392,7 @@ public function storeWithoutInsufficientBalance(StoreBankTransferRequest $reques
$inputs['order_data']['created_by_mobile_number'] = $depositor->mobile;
$inputs['order_data']['created_at'] = now();
$inputs['order_data']['master_user_name'] = $masterUser['name'];
//$inputs['order_data']['operator_short_code'] = $request->input('operator_short_code', null);
// $inputs['order_data']['operator_short_code'] = $request->input('operator_short_code', null);
$inputs['order_data']['assign_order'] = 'no';
$inputs['order_data']['system_notification_variable_success'] = 'bank_transfer_success';
$inputs['order_data']['system_notification_variable_failed'] = 'bank_transfer_failed';
Expand All @@ -413,7 +413,7 @@ public function storeWithoutInsufficientBalance(StoreBankTransferRequest $reques
$bankTransfer->order_data = $order_data;
$userUpdatedBalance = Remit::bankTransfer()->debitTransaction($bankTransfer);
$depositedAccount = Transaction::userAccount()->findWhere(['user_id' => $depositor->getKey(), 'country_id' => $bankTransfer->source_country_id]);
//update User Account
// update User Account
$depositedUpdatedAccount = $depositedAccount->toArray();
$depositedUpdatedAccount['user_account_data']['spent_amount'] = (float) $depositedUpdatedAccount['user_account_data']['spent_amount'] + (float) $userUpdatedBalance['spent_amount'];
$depositedUpdatedAccount['user_account_data']['available_amount'] = (float) $userUpdatedBalance['current_amount'];
Expand All @@ -434,7 +434,7 @@ public function storeWithoutInsufficientBalance(StoreBankTransferRequest $reques
'target_status' => OrderStatus::Success->value,
]));
}
//TODO ALL Beneficiary Data with bank and branch data
// TODO ALL Beneficiary Data with bank and branch data
$beneficiaryData = Banco::beneficiary()->manageBeneficiaryData($order_data);
$order_data['beneficiary_data'] = $beneficiaryData;

Expand Down
9 changes: 5 additions & 4 deletions src/Http/Controllers/CashPickupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function store(StoreCashPickupRequest $request): JsonResponse
return response()->created([
'message' => __('core::messages.transaction.request_created', ['service' => 'Cash Pickup']),
'id' => $cashPickup->getKey(),
'order_number' => $cashPickup->order_number ?? $cashPickup->order_data['purchase_number'],
]);

} catch (Exception $exception) {
Expand Down Expand Up @@ -320,7 +321,7 @@ public function storeWithoutInsufficientBalance(StoreCashPickupRequest $request)
throw new Exception('Master User Account not found for '.$request->input('source_country_id', $depositor->profile?->country_id).' country');
}

//set pre defined conditions of deposit
// set pre defined conditions of deposit
$inputs['transaction_form_id'] = Transaction::transactionForm()->findWhere(['code' => 'money_transfer'])->getKey();
$inputs['user_id'] = $user_id ?? $depositor->getKey();
$delayCheck = Transaction::order()->transactionDelayCheck($inputs);
Expand All @@ -340,7 +341,7 @@ public function storeWithoutInsufficientBalance(StoreCashPickupRequest $request)
$inputs['order_data']['created_by_mobile_number'] = $depositor->mobile;
$inputs['order_data']['created_at'] = now();
$inputs['order_data']['master_user_name'] = $masterUser['name'];
//$inputs['order_data']['operator_short_code'] = $request->input('operator_short_code', null);
// $inputs['order_data']['operator_short_code'] = $request->input('operator_short_code', null);
$inputs['order_data']['assign_order'] = 'no';
$inputs['order_data']['system_notification_variable_success'] = 'cash_pickup_success';
$inputs['order_data']['system_notification_variable_failed'] = 'cash_pickup_failed';
Expand All @@ -362,7 +363,7 @@ public function storeWithoutInsufficientBalance(StoreCashPickupRequest $request)
$cashPickup->order_data = $order_data;
$userUpdatedBalance = Remit::cashPickup()->debitTransaction($cashPickup);
$depositedAccount = Transaction::userAccount()->findWhere(['user_id' => $depositor->getKey(), 'country_id' => $cashPickup->source_country_id]);
//update User Account
// update User Account
$depositedUpdatedAccount = $depositedAccount->toArray();
$depositedUpdatedAccount['user_account_data']['spent_amount'] = (float) $depositedUpdatedAccount['user_account_data']['spent_amount'] + (float) $userUpdatedBalance['spent_amount'];
$depositedUpdatedAccount['user_account_data']['available_amount'] = (float) $userUpdatedBalance['current_amount'];
Expand All @@ -382,7 +383,7 @@ public function storeWithoutInsufficientBalance(StoreCashPickupRequest $request)
'target_status' => OrderStatus::Success->value,
]));
}
//TODO ALL Beneficiary Data with bank and branch data
// TODO ALL Beneficiary Data with bank and branch data
$beneficiaryData = Banco::beneficiary()->manageBeneficiaryData($order_data);
$order_data['beneficiary_data'] = $beneficiaryData;

Expand Down
12 changes: 6 additions & 6 deletions src/Http/Controllers/VendorTestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function islamiBankFetchMobileBankingMCash(): void
$repo = app()->make(OrderService::class);
$order = $repo->list(['service_id' => 19, 'sort' => 'orders.id', 'dir' => 'desc'])->first();
$order_data = $order->order_data;
//$order_data['beneficiary_data']['receiver_information']['beneficiary_data']['wallet_account_number'] = '016147470541';
// $order_data['beneficiary_data']['receiver_information']['beneficiary_data']['wallet_account_number'] = '016147470541';
dump($vendor->fetchAccountDetail($order_data));
}

Expand Down Expand Up @@ -110,8 +110,8 @@ public function islamiBankRemittanceCard(): void
{
$vendor = app()->make(IslamiBankApi::class);
$repo = app()->make(OrderService::class);
//$order = $repo->find(265);
//$order_data = $order->order_data;
// $order = $repo->find(265);
// $order_data = $order->order_data;
$order = [
'id' => 265,
'source_country_id' => 231,
Expand Down Expand Up @@ -145,7 +145,7 @@ public function islamiBankRemittanceCard(): void
$order_data['beneficiary_data']['reference_no'] = 'TEST'.time();
$order_data['sending_amount'] = $order['amount'];
$order_data['sending_currency'] = $order['currency'];
//dd($order_data);
// dd($order_data);
dump($vendor->directCreditRemittance($order_data));
}

Expand All @@ -155,7 +155,7 @@ public function islamiBankValidateBeneficiaryWalletBkash(): void
$repo = app()->make(OrderService::class);
$order = $repo->list(['service_id' => 16, 'sort' => 'orders.id', 'dir' => 'desc'])->first();
$order_data = $order->order_data;
//$order_data['beneficiary_data']['receiver_information']['beneficiary_data']['wallet_account_number'] = '016147470541';
// $order_data['beneficiary_data']['receiver_information']['beneficiary_data']['wallet_account_number'] = '016147470541';
dump($vendor->validateBeneficiaryWallet($order_data));
}

Expand All @@ -177,7 +177,7 @@ public function islamiBankValidateBeneficiaryWalletNagad(): void
$repo = app()->make(OrderService::class);
$order = $repo->list(['service_id' => 17, 'sort' => 'orders.id', 'dir' => 'desc'])->first();
$order_data = $order->order_data;
//$order_data['beneficiary_data']['receiver_information']['beneficiary_data']['wallet_account_number'] = '016147470541';
// $order_data['beneficiary_data']['receiver_information']['beneficiary_data']['wallet_account_number'] = '016147470541';
dump($vendor->validateBeneficiaryWallet($order_data));
}

Expand Down
9 changes: 5 additions & 4 deletions src/Http/Controllers/WalletTransferController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function store(StoreWalletTransferRequest $request): JsonResponse
return response()->created([
'message' => __('core::messages.transaction.request_created', ['service' => 'Wallet Transfer']),
'id' => $walletTransfer->getKey(),
'order_number' => $walletTransfer->order_number ?? $walletTransfer->order_data['purchase_number'],
]);

} catch (Exception $exception) {
Expand Down Expand Up @@ -321,7 +322,7 @@ public function storeWithoutInsufficientBalance(StoreWalletTransferRequest $requ
throw new Exception('Master User Account not found for '.$request->input('source_country_id', $depositor->profile?->country_id).' country');
}

//set pre defined conditions of deposit
// set pre defined conditions of deposit
$inputs['transaction_form_id'] = Transaction::transactionForm()->findWhere(['code' => 'wallet_transfer'])->getKey();
$inputs['user_id'] = $user_id ?? $depositor->getKey();
$delayCheck = Transaction::order()->transactionDelayCheck($inputs);
Expand All @@ -341,7 +342,7 @@ public function storeWithoutInsufficientBalance(StoreWalletTransferRequest $requ
$inputs['order_data']['created_by_mobile_number'] = $depositor->mobile;
$inputs['order_data']['created_at'] = now();
$inputs['order_data']['master_user_name'] = $masterUser['name'];
//$inputs['order_data']['operator_short_code'] = $request->input('operator_short_code', null);
// $inputs['order_data']['operator_short_code'] = $request->input('operator_short_code', null);
$inputs['order_data']['assign_order'] = 'no';
$inputs['order_data']['system_notification_variable_success'] = 'wallet_transfer_success';
$inputs['order_data']['system_notification_variable_failed'] = 'wallet_transfer_failed';
Expand All @@ -363,7 +364,7 @@ public function storeWithoutInsufficientBalance(StoreWalletTransferRequest $requ
$walletTransfer->order_data = $order_data;
$userUpdatedBalance = Remit::walletTransfer()->debitTransaction($walletTransfer);
$depositedAccount = Transaction::userAccount()->findWhere(['user_id' => $depositor->getKey(), 'country_id' => $walletTransfer->source_country_id]);
//update User Account
// update User Account
$depositedUpdatedAccount = $depositedAccount->toArray();
$depositedUpdatedAccount['user_account_data']['spent_amount'] = (float) $depositedUpdatedAccount['user_account_data']['spent_amount'] + (float) $userUpdatedBalance['spent_amount'];
$depositedUpdatedAccount['user_account_data']['available_amount'] = (float) $userUpdatedBalance['current_amount'];
Expand All @@ -383,7 +384,7 @@ public function storeWithoutInsufficientBalance(StoreWalletTransferRequest $requ
'target_status' => OrderStatus::Success->value,
]));
}
//TODO ALL Beneficiary Data with bank and branch data
// TODO ALL Beneficiary Data with bank and branch data
$beneficiaryData = Banco::beneficiary()->manageBeneficiaryData($order_data);
$order_data['beneficiary_data'] = $beneficiaryData;

Expand Down
15 changes: 15 additions & 0 deletions src/Http/Requests/StoreBankTransferRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function authorize(): bool
public function rules(): array
{
return [
'allow_insufficient_balance' => ['nullable', 'boolean'],
'user_id' => ['nullable', 'integer', 'min:1'],
'source_country_id' => ['required', 'integer', 'min:1', 'master_currency'],
'destination_country_id' => ['required', 'integer', 'min:1', 'master_currency'],
Expand All @@ -34,6 +35,8 @@ public function rules(): array
'order_data' => ['nullable', 'array'],
'reverse' => ['nullable', 'boolean'],
'order_data.request_from' => ['string', 'required'],
'order_data.business_type' => ['string', 'nullable', 'in:personal,corporate'],
'order_data.transaction_type' => ['string', 'nullable', 'in:fast,low'],
'order_data.beneficiary_type_id' => ['integer', 'nullable'],
'order_data.beneficiary_id' => ['integer', 'nullable'],
'order_data.bank_id' => ['integer', 'nullable'],
Expand All @@ -46,8 +49,20 @@ public function rules(): array

protected function prepareForValidation()
{
$this->mergeIfMissing(['allow_insufficient_balance' => false]);

$order_data = $this->input('order_data');

$order_data['request_from'] = request()->platform()->value;

if (empty($order_data['business_type'])) {
$order_data['business_type'] = 'personal';
}

if (empty($order_data['transaction_type'])) {
$order_data['transaction_type'] = 'low';
}

$this->merge(['order_data' => $order_data]);
}

Expand Down
15 changes: 15 additions & 0 deletions src/Http/Requests/StoreCashPickupRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function authorize(): bool
public function rules(): array
{
return [
'allow_insufficient_balance' => ['nullable', 'boolean'],
'user_id' => ['nullable', 'integer', 'min:1'],
'source_country_id' => ['required', 'integer', 'min:1', 'master_currency'],
'destination_country_id' => ['required', 'integer', 'min:1', 'master_currency'],
Expand All @@ -34,6 +35,8 @@ public function rules(): array
'order_data' => ['nullable', 'array'],
'reverse' => ['nullable', 'boolean'],
'order_data.request_from' => ['string', 'required'],
'order_data.business_type' => ['string', 'nullable', 'in:personal,corporate'],
'order_data.transaction_type' => ['string', 'nullable', 'in:fast,low'],
'order_data.beneficiary_type_id' => ['integer', 'nullable'],
'order_data.beneficiary_id' => ['integer', 'nullable'],
'order_data.cash_id' => ['integer', 'nullable'],
Expand All @@ -44,8 +47,20 @@ public function rules(): array

protected function prepareForValidation()
{
$this->mergeIfMissing(['allow_insufficient_balance' => false]);

$order_data = $this->input('order_data');

$order_data['request_from'] = request()->platform()->value;

if (empty($order_data['business_type'])) {
$order_data['business_type'] = 'personal';
}

if (empty($order_data['transaction_type'])) {
$order_data['transaction_type'] = 'low';
}

$this->merge(['order_data' => $order_data]);
}

Expand Down
Loading

0 comments on commit 09ec2d0

Please sign in to comment.