2017 © Pedro Peláez
 

library laravel-icepay

Laravel integration of the icepay api

image

hansvn/laravel-icepay

Laravel integration of the icepay api

  • Thursday, September 10, 2015
  • by hansvn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Laravel Icepay

This package a Laravel integration of the icepay api. The package can also be used as-is (i.e. without Laravel), (*1)

!IMPORTANT the package has not been tested yet on all platforms!, (*2)

Requirements

  • PHP >=5.4

## Getting started

Laravel < 5.0

  1. Install the hansvn/laravel-icepay package, (*3)

    $ composer require hansvn/laravel-icepay
    
  2. Update app/config/app.php` to activate the package, (*4)

    # Add `Hansvn\Icepay\IcepayServiceProvider` to the `providers` array
    'providers' => array(
        ...
        'Hansvn\Icepay\IcepayServiceProvider',
    )
    
    # Add the Icepay alias
    'aliases' => array(
        ...
        'Icepay'          => 'Hansvn\Icepay\Facades\Icepay',
    )
    
  3. Publish the config file, (*5)

    $ php artisan config:publish hansvn/laravel-icepay
    
  4. Update app/config/packages/hansvn/icepay/config.php with your Icepay API key:, (*6)

    return array(
        'MERCHANTID'    => xxxxx,//<--- Change this into your own merchant ID
        'SECRETCODE'    => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",//<--- Change this into your own merchant ID 
        ...
    );
    
  5. Optionally, you can set the log option to true or false to keep logs of the icepay packages, (*7)

    return array(
        ...
        'log'           => true,
    );
    

Usage

Below is a simple usage example of this package, (*8)

Generate a payment link for €10,00:, (*9)

$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, (*10)

Contributing

Contributions are welcome., (*11)

Todo's

  • Write tests

The Versions

10/09 2015

dev-master

9999999-dev

Laravel integration of the icepay api

  Sources   Download

The Requires

 

by Avatar hansvn

10/09 2015

v0.1

0.1.0.0

Laravel integration of the icepay api

  Sources   Download

The Requires

 

by Avatar hansvn