diff --git a/app/Http/Controllers/CinetpayController.php b/app/Http/Controllers/CinetpayController.php index 93913c2..d2c3341 100644 --- a/app/Http/Controllers/CinetpayController.php +++ b/app/Http/Controllers/CinetpayController.php @@ -180,8 +180,8 @@ class CinetpayController extends Controller 'customer_name' => 'nullable|string', 'customer_surname' => 'required|string', 'customer_phone_number' => ['nullable','string',(new Phone())->country(['CI','SN','ML','CM','TG','BF','CD','GN','BJ'])], - 'customer_address' => 'required|string', - 'customer_city' => 'required|string', + 'customer_address' => 'nullable|string', + 'customer_city' => 'nullable|string', 'customer_country' => 'required|string|size:2|in:CI,SN,ML,CM,TG,BF,CD,GN,BJ', 'reason' => 'required|string' ]); @@ -194,6 +194,7 @@ class CinetpayController extends Controller $phoneNumber = str_replace(' ','',$request->input('customer_phone_number')); $phone = new PhoneNumber($phoneNumber, $country_code); + $phoneNumber = str_replace(' ','',$phone->formatInternational()); $nationalPhone = str_replace(' ','',$phone->formatNational()); $phonePrefix = substr($phoneNumber, 1, strlen($phoneNumber) - strlen($nationalPhone) - 1);