I have two variables
$order_phone = $orders[$x]['phone'];
$order_mobile = $orders[$x]['mobile'];
Using a function out of the API i create a new array. Inside the array these variables will be set like this:
'telephone' => $order_phone . $order_mobile ,
Now I am getting into trouble when the length exceeds 20 characters. then I get this error:
Fatal error: Uncaught exception 'SendCloudApiException' with message 'telephone: "Ensure this field has no more than 20 characters."
Can I let the inserted variable be a choice? If 1 of the 2 is filled out let that variable be chosen or else always take the mobile number?
Below is the rest of the created array:
$createdParcel = $apiSend->parcels->create(
array(
'name'=> ($order_firstName . $order_middleName . $order_lastName),
'company_name' => $order_companyName,
'address' => ($order_addressBillingStreet . $order_addressBillingStreet2 . $order_addressBillingNumber . $order_addressBillingExtension),
'city' => $order_addressBillingCity,
'postal_code' => $order_addressBillingZipcode,
'telephone' => $order_phone . $order_mobile ,
'requestShipment' => false, // set to true when you want to request a shipment
'email' => $order_email,
'country' => strtoupper($order_addressBillingCountry['code']),
'order_number' => $order_number
)
);