Business-CCProcessor
view release on metacpan or search on metacpan
lib/Business/CCProcessor.pm view on Meta::CPAN
__END__
=head1 NAME
Business::CCProcessor - Pass transaction off to secure processor
=head1 VERSION
This document describes Business::CCProcessor version 0.05
=head1 SYNOPSIS
use Business::CCProcessor;
use CGI::FormBuilder; # this is optional
my $cc = Business::CCProcessor->new();
my %data = (
'processor_settings' => \%processor_settings,
'credit_card_owner' => \%credit_card_owner,
);
See below for details about how those two hash references
ought to be structured.
You may then create a button to include in a web page, like this:
my $html_button = $cc->button_factory(\%data);
or use any one of the following three methods to get a
hash of fields, you can use if you want some additional
control over how the button is rendered.
my $fields = $cc->verisign(\%data);
my $fields = $cc->dia(\%data);
my $fields = $cc->paypal(\%data);
The data in the $fields hashref can then be used to
construct a web form submission button which will take
a browser to the credit card forms for these providers.
You might consider using CGI::FormBuilder, CGI, CGI::Simple
or even hand rolled html fed to print statements, to then
render the form with that data.
=head1 DESCRIPTION
At present this module and its methods are trivially simple
in what they do, offering as its one service, the ability to
hide how to munge your web form's data into a post call to a
supported credit card processor.
Business::CCProcessor will permit a script to collect
non-financial data locally and then using an http POST call,
hand that data off to a secure credit card processor which
then collects the credit card parameters, and processes
the transaction between the credit card owners account and
the script owners account. This is a poor man's variant on
Business::OnlinePayment for clients who cannot afford the video
camera watched locked cages around their dedicated server,
to collect credit card payments from their buyers or donors,
in a real-time interaction with the credit card owner.
This module is for you if you need to accept online credit card
payments for your organization or services but are not prepared
to invest in an ssl certificate, a dedicated IP address, a
dedicated server and the monitored restricted access to your
server which the privacy of your customers or donors requires.
Initially this module offers five public methods: a constructor,
a button_factory and methods for munging data for three (so
far) credit card processors, but additional methods to handle
additional credit card processors who permit this sort of
interaction should be straight forward to add.
Each of the credit card processor methods takes a reference to
a hash of values which you will have to create before calling
the method. This data is generally of the form:
my %data = (
'processor_settings' => \%processor_settings,
'credit_card_owner' => \%credit_card_owner,
);
The second part of the hash is fairly consistent across the methods,
with some methods offering additional options for passing data than
others, but generally, this hash looks like this:
%credit_card_owner = (
'fname' => '',
'lname' => '',
'addr1' => '',
'addr2' => '',
'city' => '',
'state' => '',
'postal_code' => '',
'comments' => '',
'comments1' => '',
'phone' => '',
'email' => '',
'employer' => '',
'occupation' => '',
'amount' => '',
'notes' => '',
'button_label' => '',
);
The %processor_settings hash's structure is dependent on which
credit card processor method you are using.
As this module develops, I anticipate also providing for a
mode, to permit this module to be switched from 'commercial',
to 'non-profit', to 'electoral_campaign' mode, to account
for variances in how what data is collected for each of these
types of users.
=head2 my $cc = Business::CCProcessor->new();
This method creates an object permitting access to the other
methods provided by this module.
( run in 1.934 second using v1.01-cache-2.11-cpan-39bf76dae61 )