lennon-mudenda / omnipay-dpo
DPO Payments driver for the Omnipay PHP payment processing library
Requires
- php: ^8.0
- ext-simplexml: *
- dpo/dpo-pay-common: ^1.0
- nyholm/psr7: ^1.8
- omnipay/common: ^3
- php-http/httplug: ^2.4
- symfony/http-client: ^6.0
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-11-09 11:14:06 UTC
README
Omnipay is a collection of packages that offer a consistent set interface for the handling of payments online. The packages depend on the omnipay/common package to ensure provision of this interface consistently. DPO had no gateway among the list of currently supported gateways which is the reason why this package was born. The package is geared towards ensuring the community has a DPO Payments gateway among the Omnipay packages and will also give rise to an updated package that extends the features of the dpo/dpo-pay-common package which seems to have limited functionality or flexibility considering what most PHP projects may need.
Installation
You can install the package via composer:
composer require lennon-mudenda/omnipay-dpo
Usage
use Omnipay\DPO\Gateway; // Declare a transaction array here $paymentData = [ 'testMode' => true, // You would need to switch this to false once your application goes live 'amount' => 85, 'paymentCurrency' => 'USD', 'companyToken' => '', // Pass your DPO company token here. 'serviceType' => '', // Pass your DPO product service id here. ]; $gateway = new Gateway(); $request = $gateway->purchase( $paymentData ); $response = $request->send(); // After this you can call methods on the response object. $response->isRedirect(); // Tells you if the response will redirect us to the DPO Payments page. $response->isSuccessful(); // Tells you if the DPO request was successful $response->getMessage(); // Gets the DPO request message $response->getTransactionReference(); // Gets the DPO transaction message $response->isCancelled(); // Tells you if the transaction was cancelled or not
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email lensig13@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
PHP Package Boilerplate
This package was generated using the PHP Package Boilerplate by Beyond Code.