lennon-mudenda/omnipay-dpo

DPO Payments driver for the Omnipay PHP payment processing library

v1.0.0 2024-07-09 04:48 UTC

This package is auto-updated.

Last update: 2024-11-09 11:14:06 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

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.