Skip to content

Latest commit

 

History

History
87 lines (58 loc) · 2.56 KB

README.md

File metadata and controls

87 lines (58 loc) · 2.56 KB

dummy-vpos

Stable Version Unstable Version Total Downloads License

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.

⚠️ Warning: This package created only for synthetic testing purpose. Not included real payment methods and you must use only development environment.

Table of contents

Requirements

  • PHP 7.3 or higher
  • Laravel 7.0 or higher

Installation

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"

Usage

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.

Demo

Example Project

Demo