1. Go to this page and download the library: Download zenopay/zenopay-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zenopay / zenopay-php example snippets
$url = "https://api.zeno.africa";
// Data to send for creating the order
$orderData = [
'buyer_email' => 'CUSTOMER_EMAIL',
'buyer_name' => 'CUSTOMER_NAME',
'buyer_phone' => 'CUSTOMER_PHONE_NUMBER',
'amount' => 10000, // AMOUNT_TO_BE_PAID
'account_id' => 'YOUR_ACCOUNT_ID',
'api_key' => 'YOUR_API_KEY',
'webhook_url' => 'https://example.com/webhook',
'secret_key' => 'YOUR_SECRET_KEY',
'metadata' => json_encode([
"product_id" => "12345",
"color" => "blue",
"size" => "L",
"custom_notes" => "Please gift-wrap this item."
])
];
$endpointUrl = "https://api.zeno.africa/order-status";
// Order ID that you want to check the status for
$order_id = "66d5e374ccaab";
// Data to be sent in the POST request
$postData = [
'check_status' => 1,
'order_id' => $order_id,
'api_key' => 'YOUR_API_KEY',
'secret_key' => 'YOUR_SECRET_KEY'
];
// Webhook handling
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Get the raw POST data from the incoming webhook
$data = file_get_contents('php://input');
// Log the raw data with a timestamp
file_put_contents('weblogs.txt', "[" . date('Y-m-d H:i:s') . "] WebHook Data: ".$data."\n", FILE_APPEND);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.