Giter Club home page Giter Club logo

merchant-esolutions-php's Introduction

Build Status

Introduction

merchant-esolutions-php is designed to make it easier to use the various payment APIs provided by Merchant e-Solutions.

If you find any bugs, or have feature requests, please file an issue in GitHub or open a pull request.

Installation

Composer

Ensure that composer is installed on your machine. You will need to create a composer.json file in the root directory of your application.

{
    "require": {
        "opendns/merchant-solutions-php": "~0.1"
    }
}

Once the composer.json file is created, follow these steps from composer to install the merchant-esolutions-php package.

Composer creates its own autoloader. Include vendor/autoload.php in your application config file and you will have full access to the merchant-esolutions-php client.

APIs

This readme has a short description of the APIs and an example of each, but there's also a full api reference available on this project's Github page.

Trident

Trident is the payment gateway API, providing most card operations. A simple transaction might look like this:

use OpenDNS\MES\Trident\Sale;

$response = Sale::factory(Sale::ENV_TEST)
    ->setAuthenticationInfo('xxxxxxxxxxx', 'yyyyyyy')
    ->setAmount(13.37)
    ->setCardNumber('3499-999999-99991')
    ->setCardExpiration(12, 2018)
    ->setCvv2(1234)
    ->execute();

echo $response['transaction_id'];

Reporting

The reporting API offers full access to any of the MeS gateway's reports as CSV data. Here's a sample report:

use OpenDNS\MES\Reporting\Report;

$response = Report::factory(Report::ENV_PROD)
    ->setAuthenticationInfo('xxxxxxxxxxx', 'yyyyyyy')
    ->setNodeId('zzzzzzzzzz')
    ->setReportId(Report::REPORT_SETTLEMENT_SUMMARY)
    ->setBeginDate(new \DateTime('-1 week', new \DateTimeZone('UTC')))
    ->setEndDate(new \DateTime('now', new \DateTimeZone('UTC')))
    ->setIncludeTridentTransactionId(true)
    ->execute();

$stream = $response->getResponseBodyStream();
while ($row = fgetcsv($stream)) {
    echo implode(',', $row);
}

Recurring Billing

The recurring billing API allows you to create and manage recurring billing profiles.

Note: If you're building a new application, it's probably better to use the Trident API to store a card and issue additional Sale transactions against it

Further Note: The recurring billing API support is experimental, please feel free to open bugs/pull requests if you find yourself using it.

merchant-esolutions-php's People

Contributors

jeveleth avatar tabacco avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.