refactoring, airtelmoney test
This commit is contained in:
@@ -18,7 +18,11 @@ class CollectPaymentsRequest extends FormRequest
|
||||
|
||||
public function messages(){
|
||||
return array(
|
||||
'product_name.required' => 'You need to specify the product name'
|
||||
'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',
|
||||
'refID.required' => 'No reference ID found',
|
||||
// 'refID.unique' => 'Duplicate refID, check and try again'
|
||||
);
|
||||
}
|
||||
public function responsenn(array $errors){
|
||||
@@ -34,11 +38,14 @@ class CollectPaymentsRequest extends FormRequest
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'msisdn' => 'required|regex:/^(0)[89]\d{8}$/',
|
||||
'msisdn' => 'required|regex:/\d{10}$/',
|
||||
'amount' => 'required',
|
||||
'product_name' => 'required',
|
||||
'country' => 'required',
|
||||
'currency' => 'required',
|
||||
'channel' => 'required', //web, ussd, mobile app
|
||||
'refID' => 'required',
|
||||
'country' => 'required'
|
||||
'payment_mode' => 'required',
|
||||
'broker_id' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
32
app/Http/Requests/ConfirmPaymentsRequest.php
Normal file
32
app/Http/Requests/ConfirmPaymentsRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ConfirmPaymentsRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'confirmation_number' => 'sometimes',
|
||||
'supplier_transaction_id' => 'sometimes',
|
||||
'refID' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user