Download the PHP package fidele007/bakong-khqr-php without Composer

On this page you can find all versions of the php package fidele007/bakong-khqr-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 bakong-khqr-php

Bakong KHQR PHP

tests badge

This is a complete implementation of the bakong-khqr npm module, including all the available API calls documented here: https://api-bakong.nbc.gov.kh/document.

Installation

Usage

All available methods are exposed through the BakongKHQR class:

Static methods (no token is required):

Non-static methods (token is required):

Generate KHQR for an individual

[!IMPORTANT] Starting from v1.1.0 (the v1.0.18 equivalent of the npm package) The expirationTimestamp parameter is required for dynamic KHQR, i.e. KHQR with a transaction amount. The expected format is a timestamp string in milliseconds.

Output:

Generate KHQR for a merchant

Output:

Decode KHQR

Output:

Decode Non-KHQR

Output:

Verify KHQR

Output:

API - Generate KHQR with Deep Link

Output:

API - Generate KHQR with Deep Link by Providing URL

Bakong API has two available URLs:

So the deep link API URLs can be different according to the environment you want to use:

This method can be used with any of the above URLs. For example:

Output:

API - Check Bakong Account Existence

Output:

API - Check Bakong Account Existence by Providing URL

Just like the Deep Link API, you can use any of the available Bakong API URLs to check for a Bakong account existence:

Output:

API - Checking if a Bakong API Token is Expired

Output:

API - Renewing an expired Bakong API Token

If your token has expired, you will get a KHQRException when calling authorized Bakong API requests:

You can renew your token with the renewToken method:

Output:

In case your email is not registered:

API - Check Transaction Status

A valid token is required to check transaction status. You can get one by registering on the Bakong website: https://api-bakong.nbc.gov.kh/register. At the moment of writing this README the token has to be renewed every 90 days. Then you can create a BakongKHQR instance with the token:

Check Transaction by MD5

Check Transaction by MD5 List

Check Transaction by Full Hash

Check Transaction by Full Hash List

Check Transaction by Short Hash

Check Transaction by Instruction Reference

Check Transaction by External Reference

Testing

To run the tests:

Static Code Analysis

To run static code analysis:

Code Style

To run the code style fixer:

Code Refactoring

Troubleshooting

PHP curl does not work correctly on Windows

It may be due to the fact that your PHP configuration does not include a valid certificate file. This can be confirmed by disabling the SSL verification:

or by checking with phpinfo():

If that's true, the certificate file can be downloaded from https://curl.se/ca/cacert.pem, and include in php.ini file:

After that, restart your services or your terminal and retest.


All versions of bakong-khqr-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 fidele007/bakong-khqr-php contains the following files

Loading the files please wait ....