2017 © Pedro Peláez
 

library ogone

Wrapper class to make Ogone implementations a lot easier

image

matthiasmullie/ogone

Wrapper class to make Ogone implementations a lot easier

  • Tuesday, February 24, 2015
  • by matthiasmullie
  • Repository
  • 1 Watchers
  • 4 Stars
  • 3,915 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 3 Versions
  • 8 % Grown

The README.md

Ogone

Example usage

/*
 * Build your Ogone object; you'll need to do this to build the submission form
 * as well as to process the result from Ogone.
 */

// order details
$orderID = 1;
$amount = 50;
$currency = 'EUR';

// your Ogone config setup (see Ogone class phpdoc for more info)
$pspId = '<your-PSP-id>';
$shaIn = '<your-SHA-In>';
$shaOut = '<your-SHA-Out>';
$digest = 'SHA512'; // value can be either SHA1', 'SHA256' or 'SHA512
$environment = 'test'; // value can be either 'test' or 'prod'
$method = 'post'; // value can be either 'get' or 'post'
$verification = 'each'; // value can be either 'main' or 'each'

// create Ogone-object
use MatthiasMullie\Ogone;
$ogone = new Ogone\Ogone($orderID, $amount, $pspId, $currency, $shaIn, $shaOut, $digest);

// define test or production (for real payments) Ogone environment
$ogone->setEnvironment($environment);
$ogone->setMethod($method);
$ogone->setVerification($verification);


/*
 * Initialize a payment: build the form data to submit to Ogone.
 */

// add parameters (see parameter list: https://secure.ogone.com/ncol/Ogone_e-Com-ADV_EN.pdf)
// here are some sample parameters
$ogone->setParameter('LANGUAGE', 'nl');
$ogone->setParameter('CN', 'Matthias Mullie');
$ogone->setParameter('EMAIL', 'ogone-example@mullie.eu');
$ogone->setParameter('OWNERADDRESS', '');
$ogone->setParameter('OWNERZIP', '');
$ogone->setParameter('OWNERTOWN', '');
$ogone->setParameter('OWNERCTY', '');
$ogone->setParameter('ACCEPTURL', '');
$ogone->setParameter('DECLINEURL', '');
$ogone->setParameter('EXCEPTIONURL', '');
$ogone->setParameter('CANCELURL', '');
$ogone->setParameter('TP', '');
// ...

// build form to submit
$form = '

'; $parameters = $ogone->getFormParameters(); foreach($parameters as $key => $value) { $form .= ''; } $form .= ''; $form .= '
'; /* * Verify a payment. */ // verify the SHA signature if($ogone->isCorrectSHA()) { // fetch all details retrieved from Ogone... $ogoneResponse = $ogone->getDetail(); // no parameter // ... or retrieve a specific value $status = $ogone->getDetail('status'); // 'status' parameter // your business logic here }

Installation

Simply add a dependency on matthiasmullie/ogone to your composer.json file if you use Composer to manage the dependencies of your project:, (*1)

composer require matthiasmullie/ogone

Although it's recommended to use Composer, you can actually include these files anyway you want., (*2)

License

Ogone is MIT licensed., (*3)

The Versions

24/02 2015

dev-master

9999999-dev https://github.com/matthiasmullie/ogone

Wrapper class to make Ogone implementations a lot easier

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-mbstring *

 

payment ogone

11/12 2014

1.0.1

1.0.1.0 https://github.com/matthiasmullie/ogone

Wrapper class to make Ogone implementations a lot easier

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-mbstring *

 

15/04 2013

1.0.0

1.0.0.0 https://github.com/matthiasmullie/ogone

Wrapper class to make Ogone implementations a lot easier

  Sources   Download

MIT

The Requires

  • php >=5.3.0