110 lines
3.6 KiB
RPMSpec
110 lines
3.6 KiB
RPMSpec
#
|
|
# spec file for package perl-Business-CreditCard
|
|
#
|
|
# Copyright (c) 2024 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%define cpan_name Business-CreditCard
|
|
Name: perl-Business-CreditCard
|
|
Version: 0.390.0
|
|
Release: 0
|
|
# 0.39 -> normalize -> 0.390.0
|
|
%define cpan_version 0.39
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
|
Summary: Validate/generate credit card checksums/names
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
Source0: https://cpan.metacpan.org/authors/id/I/IV/IVAN/%{cpan_name}-%{cpan_version}.tar.gz
|
|
Source1: cpanspec.yml
|
|
Source100: README.md
|
|
BuildArch: noarch
|
|
BuildRequires: perl
|
|
BuildRequires: perl-macros
|
|
Provides: perl(Business::CreditCard) = %{version}
|
|
%undefine __perllib_provides
|
|
%{perl_requires}
|
|
|
|
%description
|
|
These subroutines tell you whether a credit card number is self-consistent
|
|
-- whether the last digit of the number is a valid checksum for the
|
|
preceding digits.
|
|
|
|
The validate_card() subroutine returns 1 if the card number provided passes
|
|
the checksum test, and 0 otherwise.
|
|
|
|
The cardtype() subroutine returns a string containing the type of card. The
|
|
list of possible return values is more comprehensive than it used to be,
|
|
but additions are still most welcome.
|
|
|
|
Possible return values are:
|
|
|
|
VISA card
|
|
MasterCard
|
|
Discover card
|
|
American Express card
|
|
enRoute
|
|
JCB
|
|
BankCard
|
|
Switch
|
|
Solo
|
|
China Union Pay
|
|
Laser
|
|
Isracard
|
|
Unknown
|
|
|
|
"Not a credit card" is returned on obviously invalid data values.
|
|
|
|
Versions before 0.31 may also have returned "Diner's Club/Carte Blanche"
|
|
(these cards are now recognized as "Discover card").
|
|
|
|
cardtype() will accept a partial card masked with "x", "X", ".", "*" or
|
|
"_". Only the first 2-6 digits and the length are significant; whitespace
|
|
and dashes are removed. With two digits, Visa, MasterCard, Discover and
|
|
Amex are recognized (versions before 0.36 needed four digits to recognize
|
|
all Discover cards). With four digits, almost all cards except some Switch
|
|
cards are recognized. With six digits (the full "BIN" or "IIN"), all cards
|
|
are recognized. Six digits are also required for receipt_cardtype().
|
|
|
|
The generate_last_digit() subroutine computes and returns the last digit of
|
|
the card given the preceding digits. With a 16-digit card, you provide the
|
|
first 15 digits; the subroutine returns the sixteenth.
|
|
|
|
This module does _not_ tell you whether the number is on an actual card,
|
|
only whether it might conceivably be on a real card. To verify whether a
|
|
card is real, or whether it's been stolen, or to actually process charges,
|
|
you need a Merchant account. See Business::OnlinePayment.
|
|
|
|
These subroutines will also work if you provide the arguments as numbers
|
|
instead of strings, e.g. 'validate_card(5276440065421319)'.
|
|
|
|
%prep
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
|
|
|
%build
|
|
perl Makefile.PL INSTALLDIRS=vendor
|
|
%make_build
|
|
|
|
%check
|
|
make test
|
|
|
|
%install
|
|
%perl_make_install
|
|
%perl_process_packlist
|
|
%perl_gen_filelist
|
|
|
|
%files -f %{name}.files
|
|
%doc BINS Changes CONTRIBUTING.md README
|
|
|
|
%changelog
|