I hope someone could help me to debug this PHP script. My problem is in line 40 which corresponds to customermobile
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.snipcart.com/api/orders/76328829-55d0-4037-884b-a7413b0fa0d2',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Basic OlNfTW1ReVl6TmxNRGd0T0dNeU5TMDBPREZoTFRsalpXTXRNREV5Tm1ZMFlqVTFNVGcyTmpNM09UWXpPRFkyTkRrd01UazJNekEz'
),
));
$moredata = curl_exec($curl);
curl_close($curl);
echo $moredata;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://g.payx.ph/payment_request',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'x-public-key' => 'pk_9219da5bc038b18ac8146e04f4984320',
'amount' => '100',
'customername' => 'Jane Doe',
'customermobile' => ($moredata->billingAddress->phone), // <--- this is the problem
'customeremail' => 'janedoe@fakeemail.com',
'description' => 'Payment for products',
),
));
$response = json_decode(curl_exec($curl));
$err = curl_error($curl);
curl_close($curl);
header('Location: '.$response->data->checkouturl);
?>
The field accepts up to 11 digits. I can't even pass the data from other fields like postal code.