2017 © Pedro Peláez
 

library laravel-cardcom

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

image

yadahan/laravel-cardcom

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

  • Tuesday, January 16, 2018
  • by yadahan
  • Repository
  • 1 Watchers
  • 1 Stars
  • 378 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 10 % Grown

The README.md

Laravel Cardcom

Build Status StyleCI Total Downloads GitHub license, (*1)

Installation

Note: Laravel Cardcom is currently in beta., (*2)

Laravel Cardcom requires Laravel 5.4 or higher, and PHP 7.0+. You may use Composer to install Laravel Cardcom into your Laravel project:, (*3)

composer require yadahan/laravel-cardcom

Configuration

Laravel 5.5 and higher the service provider and facade will automatically get registered., (*4)

In Laravel 5.4, after installing the Laravel Cardcom, register the Yadahan\Cardcom\CardcomServiceProvider in your config/app.php configuration file:, (*5)

'providers' => [
    // Other service providers...

    Yadahan\Cardcom\CardcomServiceProvider::class,
],

Also, add the Cardcom facade to the aliases array in your app configuration file:, (*6)

'Cardcom' => Yadahan\Cardcom\Facades\Cardcom::class,

Next, publish its config using the vendor:publish Artisan command:, (*7)

php artisan vendor:publish --tag="cardcom-config"

You will also need to add credentials for your terminal. These credentials should be placed in your config/cardcom.php configuration file, For example:, (*8)

'terminals' => [
    'default' => [
        'terminal' => 'your-terminal',
        'username' => 'your-username',
        'api_name' => 'your-api-name',
        'api_password' => 'your-api-password',
    ]
]

Basic Usage

Charge a credit card:, (*9)

Cardcom::card('4580000000000000', '01', '2020')->charge(10, 'ILS');
// With optional payments parameter
Cardcom::card('4580000000000000', '01', '2020')->charge(10, 'ILS', 3);

Refund a credit card:, (*10)

Cardcom::card('4580000000000000', '01', '2020')->refund(10, 'ILS');
// With optional payments parameter
Cardcom::card('4580000000000000', '01', '2020')->refund(10, 'ILS', 3);

Cancel a transaction:, (*11)

// The first (required) parameter is the transaction number
// The second (optional, default false) parameter, is cancel or refund transaction
Cardcom::cancel('12345678', true);
// With optional pertialy amount parameter (The second parameter must be false)
Cardcom::cancel('12345678', false, 10);

Create a credit card token:, (*12)

Cardcom::card('4580000000000000', '01', '2020')->createToken();

Create and charge a credit card token:, (*13)

$response = Cardcom::card('4580000000000000', '01', '2020')->createToken();

Cardcom::token($response['token'], '01', '2020')->charge(10, 'ILS');

Charge and create invoice, (*14)

Cardcom::card('4580000000000000', '01', '2020')->charge(10, 'ILS')
    ->invoice([
        'customer_name'    => 'Test Test',
        'send_email'       => 'true',
        'invoice_language' => 'he',
        'email'            => 'test@test.com',
        'address_1'        => 'Address line 1',
        'address_2'        => 'Address line 2',
        'city'             => 'Test city',
        'phone'            => '031234567',
        'mobile'           => '0501234567',
        'customer_id'      => '1',
        'comments'         => 'Test comments',
        'currency'         => 'ILS',
        'vat_free'         => 'false',
        'account'          => 'true',
        'key'              => '1',
    ])
    ->invoiceItem([
        'description' => 'Test Product 1',
        'price'       => '10',
        'quantity'    => '1',
        'id'          => '1',
        'vat_free'    => 'false',
    ]);

Of course you can config the terminal you want to use:, (*15)

Cardcom::setConfig(config('cardcom.terminals.other'))->card('4580000000000000', '01', '2020')->charge(10, 'ILS');
// Or
Cardcom::setConfig(['terminal' => '1000', 'username' => 'barak9611'])->card('4580000000000000', '01', '2020')->charge(10, 'ILS');

Contributing

Thank you for considering contributing to the Laravel Cardcom., (*16)

License

Laravel Cardcom is open-sourced software licensed under the MIT license., (*17)

The Versions

16/01 2018

dev-master

9999999-dev

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yaakov Dahan

laravel cardcom

16/01 2018

v0.4.0

0.4.0.0

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yaakov Dahan

laravel cardcom

16/01 2018

v0.4.1

0.4.1.0

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yaakov Dahan

laravel cardcom

19/11 2017

v0.3.0

0.3.0.0

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yaakov Dahan

laravel cardcom

16/08 2017

v0.2.0

0.2.0.0

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yaakov Dahan

laravel cardcom

30/07 2017

v0.1.1

0.1.1.0

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yaakov Dahan

laravel cardcom

30/07 2017

v0.1.0

0.1.0.0

Laravel Cardcom provides an expressive, fluent interface to Cardcom's billing services.

  Sources   Download

MIT

The Requires

 

by Yaakov Dahan

laravel cardcom