2017 © Pedro Peláez
 

library omise-php

Omise API PHP Lib

image

omise/omise-php

Omise API PHP Lib

  • Thursday, May 3, 2018
  • by omise
  • Repository
  • 34 Watchers
  • 38 Stars
  • 20,311 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 14 Forks
  • 8 Open issues
  • 22 Versions
  • 14 % Grown

The README.md

Omise PHP Library

omise-php is a PHP library designed specifically to connect with the Opn Payments API., (*1)

Security Warning

Please do NOT use Omise PHP library versions less than 2.12.0, as they are outdated and have security vulnerabilities., (*2)

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., (*3)

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:, (*4)

  1. 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:, (*5)

    {
      "require": {
        "omise/omise-php": "dev-master"
      }
    }
    
  2. Run the following command to install the Omise-PHP library:, (*6)

    php composer.phar install
    
  3. Once you run the composer install command, the Composer will generate a vendor folder in the same directory as composer.json., (*7)

    Add the following line to the PHP script to load the library:, (*8)

    require_once dirname(__FILE__).'/vendor/autoload.php';
    
  4. You are ready to start using the library. View the configuration and quick start sections for usage examples., (*9)

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., (*10)

  1. Extract the library to your project., (*11)

  2. Include the following line in your PHP file:, (*12)

    require_once 'path-to-library/omise-php/lib/Omise.php';
    
  3. You are ready to start using the library. View the configuration and quick start sections for usage examples., (*13)

Using Composer is recommended as you can easily keep the library up-to-date., (*14)

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)., (*15)

configuring omise-php, public and secret keys, (*16)

Place the following code next to the line where Omise-PHP library is loaded., (*17)

define('OMISE_PUBLIC_KEY', 'pkey_test_***');
define('OMISE_SECRET_KEY', 'skey_test_***');

Reference: API Authentication., (*18)

ー, (*19)

• 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)., (*20)

define('OMISE_API_VERSION', '2017-11-02');

API version can be found on the Opn Payments Dashboard. Log in, then go to API versions from the top-right menu., (*21)

configuring omise-php, API version, (*22)

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 clicking update Omise-API version on the dashboard., (*23)

Quick start

From the preceding sections, your code will look similar to the following code:, (*24)

<?php
require_once dirname(__FILE__).'/vendor/autoload.php';

define('OMISE_PUBLIC_KEY', 'pkey_test_***');
define('OMISE_SECRET_KEY', 'skey_test_***');
define('OMISE_API_VERSION', '2017-11-02');

Now, let's add the the code to retrieve your account information:, (*25)

$account = OmiseAccount::retrieve();

echo $account['email']; // your email will be printed on a screen.

And that's it! You have just made a request to the Opn Payments API, easy huh?, (*26)

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., (*27)

Have fun!, (*28)

Development and testing

To run an automated test suite, make sure you already have a PHPUnit in your local machine. Then run the PHPUnit:, (*29)

cp .env.example .env
make test
  • 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., (*30)

The following sections are instructions for contributors who consider submitting changes and/or issues., (*31)

Submit the changes

You're all welcome to submit pull requests., (*32)

Learn more about submitting a pull request., (*33)

Submit the issue

Submit the issue through GitHub's issue channel., (*34)

Learn more about submitting an issue., (*35)

License

Omise-PHP is open-source software released under the MIT License., (*36)

The Versions

03/05 2018

dev-master

9999999-dev https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

02/05 2018

dev-update-readme

dev-update-readme https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

21/03 2018

v2.9.1

2.9.1.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

21/03 2018

dev-release-2-9-1

dev-release-2-9-1 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

21/03 2018

dev-fix-search-with-perpage-attr

dev-fix-search-with-perpage-attr https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

09/03 2018

dev-introduce-omise-client

dev-introduce-omise-client https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

06/11 2017

v2.9.0

2.9.0.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

24/06 2017

v2.8.0

2.8.0.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

03/06 2017

dev-schedule-feature

dev-schedule-feature https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

31/03 2017

dev-dev-3-0-0

dev-dev-3-0-0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

22/03 2017

v2.7.1

2.7.1.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

21/03 2017

v2.7.0

2.7.0.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

15/12 2016

v2.6.0

2.6.0.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

01/07 2016

v2.5.0

2.5.0.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

03/12 2015

v2.4.1

2.4.1.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

13/11 2015

v2.4.0

2.4.0.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

30/09 2015

v2.3.2

2.3.2.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

29/07 2015

v2.3.1

2.3.1.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

24/06 2015

v2.3.0

2.3.0.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

08/06 2015

v2.2.0

2.2.0.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

02/06 2015

v2.1.3

2.1.3.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise

04/02 2015

v2.1.2

2.1.2.0 https://github.com/omise/omise-php.git

Omise API PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar omise

payment creditcard omise