Package Data | |
---|---|
Maintainer Username: | hansvn |
Maintainer Contact: | hans@brandworks.be (Hansvn) |
Package Create Date: | 2015-09-10 |
Package Last Update: | 2015-09-10 |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-12-28 15:00:42 |
Package Statistics | |
---|---|
Total Downloads: | 34 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 3 |
Total Open Issues: | 0 |
This package a Laravel integration of the icepay api. The package can also be used as-is (i.e. without Laravel)
!IMPORTANT the package has not been tested yet on all platforms!
Install the hansvn/laravel-icepay
package
$ composer require hansvn/laravel-icepay
Update app/config/app.php` to activate the package
# Add `Hansvn\Icepay\IcepayServiceProvider` to the `providers` array
'providers' => array(
...
'Hansvn\Icepay\IcepayServiceProvider',
)
# Add the Icepay alias
'aliases' => array(
...
'Icepay' => 'Hansvn\Icepay\Facades\Icepay',
)
Publish the config file
$ php artisan config:publish hansvn/laravel-icepay
Update app/config/packages/hansvn/icepay/config.php
with your
Icepay API key:
return array(
'MERCHANTID' => xxxxx,//<--- Change this into your own merchant ID
'SECRETCODE' => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",//<--- Change this into your own merchant ID
...
);
Optionally, you can set the log option to true or false to keep logs of the icepay packages
return array(
...
'log' => true,
);
Below is a simple usage example of this package
Generate a payment link for €10,00:
$icepay = \Icepay::paymentObject();
$icepay->setAmount(1000)
->setCountry("BE")
->setLanguage("NL")
->setReference("My Sample Website")
->setDescription("My Sample Payment")
->setCurrency("EUR");
$basic = Icepay::basicMode();
$basic->validatePayment($icepay);
return sprintf("<a href=\"%s\">%s</a>",$basic->getURL(),$basic->getURL());
You can also take a look at my example usage repo of this package that saves the orders in a database
Contributions are welcome.