Download the PHP package omnipay/metacharge without Composer

On this page you can find all versions of the php package omnipay/metacharge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package metacharge

Omnipay: Metacharge

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

Build Status Coverage Status Scrutinizer Quality Score Dependency Status

Latest Stable Version Total Downloads Latest Unstable Version License

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.

Based on Paypoint.net Gateway +IMA Integration Guides:

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.

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

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.

Installation

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

And run composer to update your dependencies:

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

Basic Usage

The following gateways are provided by this package:

For general usage instructions, please see the main Omnipay repository.

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' => '[email protected]',
    '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

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.

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.

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.


All versions of metacharge with dependencies

PHP Build Version
Package Version
Requires omnipay/common Version ~2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package omnipay/metacharge contains the following files

Loading the files please wait ....