Download the PHP package zenopay/zenopay-php without Composer

On this page you can find all versions of the php package zenopay/zenopay-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zenopay-php

ZenoPay Order Creation and Status Check Scripts

This repository contains PHP scripts for interacting with the ZenoPay API. The scripts demonstrate how to create an order and check the status of an order.

Table of Contents

Order Creation Script

Overview

This script sends a POST request to the ZenoPay API to create an order. It includes a basic error logging function to capture any issues during the request.

Script Components

API Endpoint

Order Data

The following data is sent in the POST request:

cURL Configuration

Request Format

To initiate a payment transaction, send a POST request to the API with a JSON payload that includes the following parameters:

Parameter Type Description Example
buyer_name string Full name of the buyer "John Doe"
buyer_phone string Phone number of the buyer "255712345678"
buyer_email string Email address of the buyer "[email protected]"
amount float Amount to be paid by the buyer in the transaction 1500.00
account_id string Unique account identifier for the transaction "acc_12345xyz"
api_key string Your API key for authentication. "api_key"
secret_key string Your secret key for authentication. "secret_key"

The script uses cURL to make the POST request:

Error Logging Function

Logs errors to a file:

Error Handling

To enhance error handling:

  1. Check cURL Errors:

  2. Check HTTP Status Code:

Example Usage

  1. Update Order Data: Replace placeholder values with actual information.
  2. Save the Script: Save the file as create_order.php or another preferred filename.
  3. Run the Script: Execute it via command line or web server.

Notes

Order Status Check Script

Overview

This script checks the status of an order by sending a POST request to the ZenoPay API endpoint for order status.

Script Components

API Endpoint

Post Data

The following data is sent in the POST request:

cURL Configuration

The script uses cURL to perform the POST request:

Error Handling

  1. Check cURL Errors:

  2. Handle Response: Decode and format the JSON response based on the status:

    Webhook Handling

After a payment is processed, ZenoPay may send a webhook to notify you about the status of the transaction. You can use the following PHP code to handle the webhook and log the incoming data for further processing or debugging.

Webhook PHP Example

How the Webhook Works:

  1. Receiving Webhook Data: This script listens for incoming POST requests (which ZenoPay sends for webhooks

) and reads the raw data from the request body using file_get_contents('php://input').

  1. Logging Webhook Data: The webhook data is logged to a file (weblogs.txt) along with a timestamp for reference. This log will help you debug and track transaction statuses or other data sent via the webhook.

Example Usage

  1. Update Post Data: Replace placeholder values with actual data.
  2. Save the Script: Save the file as check_order_status.php or another preferred filename.
  3. Run the Script: Execute it via command line or web server.

Notes


Feel free to modify or expand this README as needed for your specific requirements.


All versions of zenopay-php with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zenopay/zenopay-php contains the following files

Loading the files please wait ....