2017 © Pedro Peláez
 

library omnipay-safecharge

SafeCharge Gateway driver for the Omnipay PHP payment processing library

image

mfauveau/omnipay-safecharge

SafeCharge Gateway driver for the Omnipay PHP payment processing library

  • Wednesday, October 26, 2016
  • by mfauveau
  • Repository
  • 1 Watchers
  • 0 Stars
  • 841 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Omnipay: SafeCharge

SafeCharge Direct Gateway driver for the Omnipay PHP payment processing library, (*1)

Build Status Latest Stable Version Total Downloads, (*2)

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements SafeCharge Gateway support for Omnipay., (*3)

If you are looking for the "SafeCharge Cashier" implementation see Omnipay Gate2Shop. It's the same thing except for the endpoint URL., (*4)

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:, (*5)

{
    "require": {
        "mfauveau/omnipay-safecharge": "~2.0"
    }
}

And run composer to update your dependencies:, (*6)

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Usage

The following gateways are provided by this package:, (*7)

  • SafeCharge Direct Gateway (without support for 3D secure at this time, feel free to do a PR ;))

For general usage instructions, please see the main Omnipay repository., (*8)

Setup

$gateway = Omnipay::create('Safecharge');
$gateway->initialize(array(
    'username' => 'AccountTestTRX',
    'password' => 'password',
    'testMode' => true,
    'vendorId' => 'Vendor ID',
    'websiteId' => 'Website ID'
));

Authorize

$cardData = [
    'name'          => 'John Doe',
    'number'        => '4000021059386316',
    'expiryMonth'   => '06',
    'expiryYear'    => '2016',
    'cvv'           => '123'
];

try {
    $response = $gateway->authorize([
        'amount' => '100.00',
        'currency' => 'USD',
        'card' => $cardData
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}

Purchase

$cardData = [
    'name'          => 'John Doe',
    'number'        => '4000021059386316',
    'expiryMonth'   => '06',
    'expiryYear'    => '2016',
    'cvv'           => '123'
];

try {
    $response = $gateway->purchase([
        'amount'    => '100.00',
        'currency'  => 'USD',
        'card'      => $cardData
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}

Purchase using a Token

try {
    $response = $gateway->purchase([
        'amount'        => '100.00',
        'currency'      => 'USD',
        'token'         => 'XXXXXXXXXXXXXXXXXXXXX',
        'transactionId' => '123456789'
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}

Void

try {
    $response = $gateway->void([
        'amount'        => '100.00',
        'currency'      => 'USD',
        'token'         => 'XXXXXXXXXXXXXXXXXXXXX',
        'transactionId' => '123456789',
        'authCode'      => '12345',
        'expMonth'      => '06',
        'expYear'       => '2016'
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}

Refund

try {
    $response = $gateway->refund([
        'amount'        => '100.00',
        'currency'      => 'USD',
        'token'         => 'XXXXXXXXXXXXXXXXXXXXX',
        'transactionId' => '123456789',
        'authCode'      => '12345',
        'expMonth'      => '06',
        'expYear'       => '2016'
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found., (*9)

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to., (*10)

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request., (*11)

The Versions

26/10 2016

dev-master

9999999-dev https://github.com/mfauveau/omnipay-safecharge

SafeCharge Gateway driver for the Omnipay PHP payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matthieu Fauveau

payment pay gateway merchant purchase omnipay safecharge

26/10 2016

2.0.3

2.0.3.0 https://github.com/mfauveau/omnipay-safecharge

SafeCharge Gateway driver for the Omnipay PHP payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matthieu Fauveau

payment pay gateway merchant purchase omnipay safecharge

10/09 2015

2.0.2

2.0.2.0 https://github.com/mfauveau/omnipay-safecharge

SafeCharge Gateway driver for the Omnipay PHP payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matthieu Fauveau

payment pay gateway merchant purchase omnipay safecharge

16/07 2015

2.0.1

2.0.1.0 https://github.com/mfauveau/omnipay-safecharge

SafeCharge Gateway driver for the Omnipay PHP payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matthieu Fauveau

payment pay gateway merchant purchase omnipay safecharge

07/07 2015

2.0.0

2.0.0.0 https://github.com/mfauveau/omnipay-safecharge

SafeCharge Gateway driver for the Omnipay PHP payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matthieu Fauveau

payment pay gateway merchant purchase omnipay safecharge