trekkpay / omnipay-trekkpay
This package is abandoned and no longer maintained.
The author suggests using the payyo/omnipay-payyo package instead.
TrekkPay Gateway for the Omnipay payment processing library
2.0.1
2017-10-31 11:36 UTC
Requires
- php: ^7
- omnipay/common: ~2.0
- trekkpay/php-sdk: ^1.1
Requires (Dev)
- omnipay/tests: ~2.0
README
This repository is deprecated in favor of https://bitbucket.org/payyoag/payyo-omnipay as well as
payyo/omnipay-payyo
is supposed to be used instead of trekkpay/omnipay-trekkpay
Omnipay: TrekkPay
TrekkPay Gateway for the Omnipay PHP payment processing library.
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+.
The TrekkPay Omnipay library requires PHP 7.0+.
Installation
Omnipay can be installed using Composer. Installation instructions.
Run the following command to install omnipay and the TrekkPay gateway:
composer require trekkpay/omnipay-trekkpay
Basic Usage
The following parameters are required:
apiKey
Your TrekkPay API/public keysecretKey
Your TrekkPay secret keymerchantId
Your TrekkPay merchant ID
$gateway = Omnipay::create(\TrekkPay\Omnipay\HostedPaymentPageGateway::class);
$gateway->setApiKey('api_...');
$gateway->setSecretKey('sec_...');
$gateway->setMerchantId(1234);
// Send purchase request
$response = $gateway->purchase([
'transactionId' => '123456',
'description' => '1x Book',
'amount' => '10.00',
'currency' => 'USD',
'returnUrl' => 'https://example.org/success',
'cancelUrl' => 'https://example.org/abort',
])->send();
// This is a redirect gateway, so redirect right away
$response->redirect();