refactored Mpamba Controller, added wallet tables

This commit is contained in:
Kwesi Banson Jnr
2025-11-26 21:45:45 +00:00
parent 094efd008e
commit 1e18492dc2
19 changed files with 466 additions and 38 deletions

View File

@@ -19,10 +19,8 @@ class CollectPaymentsRequest extends FormRequest
public function messages(){
return array(
'channel.required' => 'You need to specify the channel',
'payment_mode.required' => 'You need to specify the payment mode',
'broker_id.required' => 'You need to specify the borker',
'wallet_id.required' => 'You need to specify the borker',
'refID.required' => 'No reference ID found',
// 'refID.unique' => 'Duplicate refID, check and try again'
);
}
public function responsenn(array $errors){
@@ -40,12 +38,9 @@ class CollectPaymentsRequest extends FormRequest
return [
'msisdn' => 'required|regex:/\d{10}$/',
'amount' => 'required',
'country' => 'required',
'currency' => 'required',
'channel' => 'required', //web, ussd, mobile app
'refID' => 'required',
'payment_mode' => 'required',
'broker_id' => 'required',
'wallet_id' => 'required',
];
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class MpambaTnmRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function messages(){
return array(
'channel.required' => 'You need to specify the channel',
'wallet_id.required' => 'You need to specify the borker',
'refID.required' => 'No reference ID found',
// 'refID.unique' => 'Duplicate refID, check and try again'
);
}
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'msisdn' => 'required|regex:/\d{10}$/',
'amount' => 'required',
'channel' => 'required', //web, ussd, mobile app
'refID' => 'required',
'wallet_id' => 'required',
];
}
}