Download the PHP package omise/omise-php without Composer
On this page you can find all versions of the php package omise/omise-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download omise/omise-php
More information about omise/omise-php
Files in omise/omise-php
Package omise-php
Short Description A PHP library designed specifically to connect with Omise API.
License MIT
Homepage https://www.omise.co
Rated 4.00 based on 2 reviews
Informations about the package omise-php
Omise PHP Library
omise-php
is a PHP library designed specifically to connect with the Opn Payments API.
Security Warning
Please do NOT use Omise PHP library versions less than 2.12.0, as they are outdated and have security vulnerabilities.
Requirements
- PHP v7.4 and higher.
- Built-in libcurl support.
Note: Due to the PHP END OF LIFE cycle, we encourage you to run the Omise-PHP library on PHP version 7.4 or higher as there is no longer security support for any PHP version lower than 7.4. Lack of support could cause security vulnerabilities.
Installation
Using Composer
You can install the library via Composer. If you don't already have Composer installed, first install it by following one of these instructions, depending on your OS:
- Composer installation instruction for Windows
- Composer installation instruction for Mac OS X and Linux
-
After Composer is installed, you can declare Omise-PHP as a project dependency by creating a
composer.json
file at the root of your project directory, with the following content: -
Run the following command to install the Omise-PHP library:
-
Once you run the
composer install
command, the Composer will generate avendor
folder in the same directory ascomposer.json
.Add the following line to the PHP script to load the library:
- You are ready to start using the library. View the configuration and quick start sections for usage examples.
Manually
If you are not using Composer, you can download the latest version of Omise-PHP. Then, follow the instructions to install Omise-PHP to the project.
-
Extract the library to your project.
-
Include the following line in your PHP file:
- You are ready to start using the library. View the configuration and quick start sections for usage examples.
Using Composer is recommended as you can easily keep the library up-to-date.
Configuration
• Configure your public and secret keys
Before you make the first request to the Opn Payments API, you will need to configure your public key and secret key (these can be found on the Opn Payments Dashboard. Log in, then go to Keys from the sidebar menu).
Place the following code next to the line where Omise-PHP library is loaded.
Reference: API Authentication.
ー
• API version
To enforce the API version that the application must use, define OMISE_API_VERSION
.
The version specified by this settings will override the version setting in your account. This is useful if you have multiple environments with different API versions (e.g. development on the latest but production on the older version).
API version can be found on the Opn Payments Dashboard. Log in, then go to API versions from the top-right menu.
It is highly recommended to set
OMISE_API_VERSION
to the current version that you are using to prevent any issues that might arise from accidentally clickingupdate Omise-API version
on the dashboard.
Quick start
From the preceding sections, your code will look similar to the following code:
Now, let's add the the code to retrieve your account information:
And that's it! You have just made a request to the Opn Payments API, easy huh?
Feel free to integrate the Opn Payment Gateway service as you desire to make it fit with your business flow.
Also, read the documents and view the example code to get more information if you need help.
Have fun!
Development and testing
To run an automated test suite, make sure you already have a PHPUnit in your local machine. Then run the PHPUnit:
- To generate a code coverage test report, run
make coverage
.
Contributing
Thanks for your interest in contributing to Omise PHP. We are looking forward to hearing your thoughts and are willing to review your changes.
The following sections are instructions for contributors who consider submitting changes and/or issues.
Submit the changes
You're all welcome to submit pull requests.
Learn more about submitting a pull request.
Submit the issue
Submit the issue through GitHub's issue channel.
Learn more about submitting an issue.
License
Omise-PHP is open-source software released under the MIT License.