feerdispzoo
Verified User
- Joined
- Jan 17, 2022
- Messages
- 189
I use this CURL library fo Codeigniter 3 framework:
github.com
I write function post order to external api, but when I run controller I get empty white page without error, but order not created. I checked in Insomia API client, and with this credentials and data json I created order sucess.
How can I check any log / error log for curl ? Where I should find this or some any other onfirmation what is happen when I run this function.
I ask external website API, and they not see any request from our end.
GitHub - josantonius/php-curl: Make HTTP requests through PHP's cURL library.
Make HTTP requests through PHP's cURL library. Contribute to josantonius/php-curl development by creating an account on GitHub.
I write function post order to external api, but when I run controller I get empty white page without error, but order not created. I checked in Insomia API client, and with this credentials and data json I created order sucess.
Code:
public function create_order()
{
$curl = new Curl();
$curl->setHeader('CustomerId', 'xxxxxxx');
$curl->setHeader('UserName', 'xxxxxxxxxx');
$curl->setHeader('ActionApiKey', 'xxxxxxxxxxxxxxx');
$order = array(
"createEmpty" => false,
"header" => array(
"comment" => "string",
"country" => "Polska",
"currency" => "PLN",
"isFileRequired" => true,
"actionCustomerId" => "81790",
"payer" => "EndCustomer",
"paymentType" => "CashOnDelivery",
"partnerOrderId" => "81790",
"deliveryAddresType" => "EndCustomer",
"cashOnDeliveryType" => "FullRate",
"cashOnDelivery" => 155,
"deliveryCompanyName" => "TEST API ORDER DO NOT SHIP",
"deliveryCity" => "Poznań",
"deliveryPhone" => "xxxxxxx",
"deliveryStreet" => "xxxxxxxxxx",
"deliveryZipCode" => "xxxxxxx"
),
"items" => array(
array(
"actionProductId" => "MULLOGKAM0087",
"quantity" => 1,
"price" => 122,
"backOrderType" => "BackOrder"
)
)
);
$curl->setHeader('Content-Type', 'application/json');
$curl->post('xxxxxxxxxxxxxxxxxxxxx/v2/Order', json_encode($order));
if ($curl->error) {
echo 'Error: ' . $curl->error_code . ': ' . $curl->error_message;
} else {
echo 'Respone: ' . $curl->response;
}
}
How can I check any log / error log for curl ? Where I should find this or some any other onfirmation what is happen when I run this function.
I ask external website API, and they not see any request from our end.