Dummy virtual POS integration for some weird testing cases.
For example some companies do not provide virtual pos in the test environment (there is only direct success or fail response). You can perform a virtual POS payment scenarios with fake integration.
- PHP 7.3 or higher
- Laravel 7.0 or higher
To get the latest version of dummy-vpos
, simply require the project using Composer:
$ composer require egoistdeveloper/dummy-vpos
Publish service provider:
$ php artisan vendor:publish --provider="DummyVpos\ServiceProvider"
Grab your response parameters then build http query and redirect to dummy-vpos.show
route.
$params = [
'test' => true,
'id' => hash('md5', time()),
'name' => 'John Doe',
'price' => 999.99,
'successCallback' => route('success'),
'errorCallback' => route('fail'),
...
];
$vposUrl = route('dummy-vpos.show') . '?' . http_build_query($params);
successCallback, errorCallback and price are required for testing. Also price should be bigger than 0.
After reached fake virtual pos screen there are four possibility.
- Success
- Fail
- Wrong password
- Cancelation
- Timeout
All cases returns back to callback url (with sended parameters except callback urls) and success and fail code/messages can found be in dummy-vpos.php
config file.