2017 © Pedro Peláez
 

library luhn-agorithm

Luhn Agorithm Package

image

stoufa/luhn-agorithm

Luhn Agorithm Package

  • Thursday, February 8, 2018
  • by stoufa06
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Luhn-Algorithm

Composer library for Luhn algorithm credit card Validation, (*1)

Install with composer

composer require stoufa/luhn-agorithm, (*2)

How to use

create php file index.php, (*3)

<?php  
require __DIR__."/vendor/autoload.php";

use LuhnAlgo\Card;

// Valid card number
try {
    $card_number = '378766681165445';
    $card = new Card($card_number);
    echo "$card_number credit card is valid card number". PHP_EOL;
} catch (Exception $e) {
    echo "$card_number credit card is not valid card number". PHP_EOL;
}


// Invalid card number
try {
    $card_number = '378766681165455';
    $card = new Card($card_number);
    echo "$valid_card credit card is valid card number". PHP_EOL;
} catch (Exception $e) {
    echo "$card_number credit card is not valid card number". PHP_EOL;
}

Run php file php index.php, (*4)

Run project tests

Via command line php path-to-project-code/test/test.commandline.php, (*5)

Html version http://localhost/Luhn-Algorithm/test/test.html.php, (*6)

Test data are json files located in test/testdata. These files are generated from http://www.getcreditcardnumbers.com/., (*7)

The Versions

08/02 2018

dev-master

9999999-dev

Luhn Agorithm Package

  Sources   Download

AGPL-3.0

The Requires

  • php >=7.0.0

 

by stoufa

luhn agorithm

05/02 2018

1.0.0

1.0.0.0

Luhn Agorithm Package

  Sources   Download

AGPL-3.0

The Requires

  • php >=7.0.0

 

by stoufa

luhn agorithm