w-vision / omnipay-datatrans
This package is abandoned and no longer maintained.
The author suggests using the academe/omnipay-datatrans package instead.
Datatrans Gateway for the Omnipay payment processing library
1.0.0
2018-01-10 13:40 UTC
Requires
- omnipay/common: ~2.0
Requires (Dev)
- omnipay/tests: ~2.0
This package is auto-updated.
Last update: 2024-03-07 14:03:00 UTC
README
Datatrans Gateway for the Omnipay PHP payment processing library.
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 w-vision/omnipay-datatrans:^1.0.0
Basic Usage
Payment requests to the Datatrans Gateway must at least supply the following parameters:
merchantId
Your merchant IDtransactionId
unique transaction IDamount
monetary amountcurrency
currencysign
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();