Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

instride-ch/omnipay-datatrans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3a5dcc1 Β· Mar 7, 2024

History

25 Commits
Mar 7, 2024
Mar 7, 2024
Jan 9, 2017
Jan 9, 2017
Jan 10, 2017
Jan 10, 2018
Mar 7, 2024
Mar 7, 2024
Mar 7, 2024
Jan 9, 2017

Repository files navigation

Omnipay: Datatrans

Datatrans Gateway for the Omnipay PHP payment processing library.

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version Latest Unstable Version License

Omnipay is a framework-agnostic, multi-gateway payment processing library for PHP 5.3+.

This Gateway implements offsite payments via Datatrans. Purchase and Authorization are available, capturing an authorized payment has to be performed via Datatrans backend (not currently implemented for this Gateway).

Installation

Omnipay can be installed using Composer. Installation instructions.

Run the following command to install omnipay and the datatrans gateway:

composer require instride/omnipay-datatrans:^1.0.0

Basic Usage

Payment requests to the Datatrans Gateway must at least supply the following parameters:

  • merchantId Your merchant ID
  • transactionId unique transaction ID
  • amount monetary amount
  • currency currency
  • sign Your sign identifier. Can be found in datatrans backend.
$gateway = Omnipay::create('Datatrans');
$gateway->setMerchantId('merchantId');
$gateway->setSign('sign');

// Send purchase request
$response = $gateway->purchase(
    [
        'transactionId' => '17',
        'amount' => '10.00',
        'currency' => 'CHF'
    ]
)->send();

// This is a redirect gateway, so redirect right away
$response->redirect();