2017 © Pedro Peláez
 

library metacharge

Metacharge Paypoint.net Freedom Gateway +IMA (with 3d secure) gateway for Omnipay payment processing library

image

omnipay/metacharge

Metacharge Paypoint.net Freedom Gateway +IMA (with 3d secure) gateway for Omnipay payment processing library

  • Wednesday, October 29, 2014
  • by tomsowerby
  • Repository
  • 2 Watchers
  • 0 Stars
  • 46 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

Omnipay: Metacharge

Metacharge (by Paypoint.net) driver for the Omnipay PHP payment processing library, (*1)

Build Status Coverage Status Scrutinizer Quality Score Dependency Status, (*2)

Latest Stable Version Total Downloads Latest Unstable Version License, (*3)

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Paypoint.net Metacharge Gateway Freedom +IMA support for Omnipay., (*4)

Based on Paypoint.net Gateway +IMA Integration Guides: * Gateway Freedom +IMA Integration Guide 2.3 * Gateway Freedom +IMA 3D Secure Guide 3.1, (*5)

This has been created based on the documentation, and has not been fully tested yet. Changes will be made as it is tested so keep an eye on revisions., (*6)

If you are looking for the Paypoint Secpay Freedom product, a library seems to be in development by JustinBusschau here., (*7)

NOTE An active account is required for 3D secure integration (not mentioned in 3D Secure documentation - at present version 3.1). Also, 3D secure needs to be activated on the account by Secpay staff. An account in test mode, or without 3D secure activated, always returns results as though the card is not enrolled., (*8)

Installation

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

{
    "require": {
        "omnipay/metacharge": "~2.0"
    }
}

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

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

Basic Usage

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

  • Metacharge (Paypoint.net Metacharge Checkout) with 3DSecure (API v1.4)

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

Standard payment with 3D secure

/**
 * On your submission page
 */

$gateway = \Omnipay\Omnipay::create('Metacharge'); /* @var $gateway \Omnipay\Metacharge\Gateway */
$gateway->setTestMode(1);
$gateway->setInstId(123456); //Edit to your install id
$gateway->set3DSecureResponseUrl('http://www.yoursite.com/response'); //Set to your 3d secure response capture endpoint

$formInputData = array(
    'firstName' => 'Joe',
    'lastName' => 'Bloggs',
    'email' => 'test@paypoint.net',
    'postcode' => 'BA12BU',
    'number' => '1234123412341234', // This number MUST be used for 3D secure testing (based on conversation with Secpay technical team).
    'expiryMonth' => '06',
    'expiryYear' => '14',
    'cvv' => '707',
);
$card = new \Omnipay\Common\CreditCard($formInputData);

$requestParams = array(
    'amount' => 10.00,
    'currency' => 'GBP',
    'card' => $card,
    'cartID' => '654321',
    'description' => 'description of goods',
);

$request = $gateway->purchase($requestParams); /* @var $request \Omnipay\Metacharge\Message\PaymentRequest */

$response = $request->send(); /* @var $response \Omnipay\Metacharge\Message\PaymentResponse */

// Is it an immediate success, with no 3D secure?
var_dump($response->isSuccessful()); // bool
var_dump($response->getData()); // array
// Process the payment here.

// Is it a 3d secure redirect?
if($response->isRedirect()) {
    //Save bits for later.
    $transactionId = $response->getTransactionId();
    $secureToken = $response->getSecurityToken();
    $s3DTransId = $response->getS3DTransID();
    $s3DMerchantData = $response->getS3DMerchantData();
    //Save these

    //Send user off to the 3D secure page
    $response->redirect();
}

/**
 * On your 3d secure response capture page, set by $gateway->set3DSecureResponseUrl
 */

// A lot of these are the values that we saved above
$s3dParams = array(
    'transactionId' => $transactionId,
    'securityToken' => $secureToken,
    's3DTransID' => $s3DTransId,
    's3DResponse' => $_POST['PaRes'],
    's3DMerchantData' => $s3DMerchantData, //Or $_POST['MD'] should be the same
);

// Any validation of the session that you might need to do here.

// Resume the request
$request = $gateway->s3DAuthorisationResume($s3dParams); /* @var $request \Omnipay\Metacharge\Message\S3DAuthorisationResumeRequest */

$response = $request->send(); /* @var $response \Omnipay\Metacharge\Message\PaymentResponse */

// Is it a success, after 3D secure? Note, this response is the same as an initially successful payment.
var_dump($response->isSuccessful()); // bool
var_dump($response->getData()); // array

Todo

  • Pass through parameters. Supported by Metacharge using prefix "PT_"
  • Unit tests cover everything, but could be more extensive. Please report bugs and ideally provide a failing test.

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

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

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

The Versions

29/10 2014

dev-master

9999999-dev https://github.com/tomsowerby/omnipay-metacharge

Metacharge Paypoint.net Freedom Gateway +IMA (with 3d secure) gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Sowerby

payment pay gateway merchant purchase omnipay paypoint 3d secure freedom ima metacharge

29/10 2014

v2.3.1

2.3.1.0 https://github.com/tomsowerby/omnipay-metacharge

Metacharge Paypoint.net Freedom Gateway +IMA (with 3d secure) gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Sowerby

payment pay gateway merchant purchase omnipay paypoint 3d secure freedom ima metacharge

18/06 2014

v2.3.0

2.3.0.0 https://github.com/tomsowerby/omnipay-metacharge

Metacharge Paypoint.net Freedom Gateway +IMA (with 3d secure) gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Sowerby

payment pay gateway merchant purchase omnipay paypoint 3d secure freedom ima metacharge