This package enables Laravel to communicate with the Monopay payment system
Run the following command to pull in the latest version:
composer require swissfreecommerce/monopay-merchant-laravel
Add the service provider to the providers array in the config/app.php config file as follows:
'providers' => [
...
SwissFreeCommerce\PaymentMerchant\Providers\MonopayServiceProvider::class,
]
Copy the config
file from vendor/swissfreecommerce/monopay-merchant-laravel/config/config.php
to config
folder of your Laravel application and rename it to monopay.php
Run the following command to publish the package config file:
php artisan vendor:publish --provider="SwissFreeCommerce\PaymentMerchant\Providers\MonopayServiceProvider"
You should now have a config/monopay.php
file that allows you to configure the basics of this package.
In order to receive all the currencies, a request must be sent in the following form
use MonopayService;
$service = new MonopayService;
$result = $service->getCurrency();
To send a request, the request must be sent in the following form
use MonopayService;
use SwissFreeCommerce\PaymentMerchant\Data\DataRequest;
$service = new MonopayService;
$data = new DataRequest('currency iso code', 'order id in your system', 'float amount');
$result = $service->request($data);
To send a verify, the request must be sent in the following form
use MonopayService;
use SwissFreeCommerce\PaymentMerchant\Data\TrackingCode;
$service = new MonopayService;
$data = new TrackingCode('tracking code');
$result = $service->verify($data);
To send a status, the request must be sent in the following form
use MonopayService;
use SwissFreeCommerce\PaymentMerchant\Data\TrackingCode;
$service = new MonopayService;
$data = new TrackingCode('tracking code');
$result = $service->status($data);