summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
857313b)
POD, remove extra whitespace, sorted %fields, dump_contents now
sorts %contents, added myself to AUTHORS.
$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
my %fields = (
$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
my %fields = (
+ authorization => undef,
+ error_message => undef,
- result_code => undef,
- test_transaction => undef,
+ fraud_detect => undef,
+ is_success => undef,
+ maximum_risk => undef,
+ path => undef,
+ port => undef,
- transaction_type => undef,
- error_message => undef,
- authorization => undef,
- port => undef,
- path => undef,
- fraud_detect => undef,
server_response => undef,
server_response => undef,
+ test_transaction => undef,
+ transaction_type => undef,
my %parent_content = $self->content();
$parent_content{action} = 'Fraud Detect';
my %parent_content = $self->content();
$parent_content{action} = 'Fraud Detect';
- $risk_transaction->content( %parent_content );
+ $risk_transaction->content( %parent_content );
$risk_transaction->submit();
if ($risk_transaction->is_success()) {
if ( $risk_transaction->fraud_score <= $self->maximum_fraud_score()) {
$risk_transaction->submit();
if ($risk_transaction->is_success()) {
if ( $risk_transaction->fraud_score <= $self->maximum_fraud_score()) {
my ($self) = @_;
my $fraud_detection = $self->fraud_detect();
my ($self) = @_;
my $fraud_detection = $self->fraud_detect();
# early return if user does not want optional risk mgt
# early return if user does not want optional risk mgt
return $self->{_child_submit}->($self,@_) unless $fraud_detection && length $fraud_detection;
return $self->{_child_submit}->($self,@_) unless $fraud_detection && length $fraud_detection;
# Search for an appropriate FD module
# Search for an appropriate FD module
foreach my $subclass ( q(Business::OnlinePayment::) . $fraud_detection,
foreach my $subclass ( q(Business::OnlinePayment::) . $fraud_detection,
- q(Business::FraudDetect::).$fraud_detection) {
+ q(Business::FraudDetect::) . $fraud_detection) {
if (!defined(&$subclass)) {
eval "use $subclass";
if (!defined(&$subclass)) {
eval "use $subclass";
my %content = $self->content();
my $dump = "";
my %content = $self->content();
my $dump = "";
- foreach(keys %content) {
+ foreach(sort keys %content) {
$dump .= "$_ = $content{$_}\n";
}
return $dump;
$dump .= "$_ = $content{$_}\n";
}
return $dump;
=head1 SYNOPSIS
use Business::OnlinePayment;
=head1 SYNOPSIS
use Business::OnlinePayment;
my $transaction = new Business::OnlinePayment($processor, %processor_info);
$transaction->content(
type => 'Visa',
my $transaction = new Business::OnlinePayment($processor, %processor_info);
$transaction->content(
type => 'Visa',
name => 'John Q Doe',
);
$transaction->submit();
name => 'John Q Doe',
);
$transaction->submit();
if($transaction->is_success()) {
print "Card processed successfully: ".$transaction->authorization()."\n";
} else {
if($transaction->is_success()) {
print "Card processed successfully: ".$transaction->authorization()."\n";
} else {
-Business::OnlinePayment is a generic module for processing payments through
-online credit card processors, electronic cash systems, etc.
+Business::OnlinePayment is a generic module for processing payments
+through online credit card processors, electronic cash systems, etc.
=head1 METHODS AND FUNCTIONS
=head2 new($processor, %processor_options);
=head1 METHODS AND FUNCTIONS
=head2 new($processor, %processor_options);
-Create a new Business::OnlinePayment object, $processor is required, and defines the online processor to use. If necessary, processor options can be specified, currently supported options are 'Server', 'Port', and 'Path', which specify how to find the online processor (https://server:port/path), but individual processor modules should supply reasonable defaults for this information, override the defaults only if absolutely necessary (especially path), as the processor module was probably written with a specific target script in mind.
+Create a new Business::OnlinePayment object, $processor is required,
+and defines the online processor to use. If necessary, processor
+options can be specified, currently supported options are 'Server',
+'Port', and 'Path', which specify how to find the online processor
+(https://server:port/path), but individual processor modules should
+supply reasonable defaults for this information, override the defaults
+only if absolutely necessary (especially path), as the processor
+module was probably written with a specific target script in mind.
=head2 content(%content);
=head2 content(%content);
-The information necessary for the transaction, this tends to vary a little depending on the processor, so we have chosen to use a system which defines specific fields in the frontend which get mapped to the correct fields in the backend. The currently defined fields are:
+The information necessary for the transaction, this tends to vary a
+little depending on the processor, so we have chosen to use a system
+which defines specific fields in the frontend which get mapped to the
+correct fields in the backend. The currently defined fields are:
=over 4
=item * type
Transaction type, supported types are:
=over 4
=item * type
Transaction type, supported types are:
-Visa, MasterCard, American Express, Discover, Check (not all processors support all these transaction types).
+Visa, MasterCard, American Express, Discover, Check (not all
+processors support all these transaction types).
-What to do with the transaction (currently available are: Normal Authorization, Authorization Only, Credit, Post Authorization)
+What to do with the transaction (currently available are: Normal
+Authorization, Authorization Only, Credit, Post Authorization)
-A description of the transaction (used by some processors to send information to the client, normally not a required field).
+A description of the transaction (used by some processors to send
+information to the client, normally not a required field).
-The amount of the transaction, most processors dont want dollar signs and the like, just a floating point number.
+The amount of the transaction, most processors don't want dollar signs
+and the like, just a floating point number.
-An invoice number, for your use and not normally required, many processors require this field to be a numeric only field.
+An invoice number, for your use and not normally required, many
+processors require this field to be a numeric only field.
-The customers address (your processor may not require this unless you are requiring AVS Verification).
+The customers address (your processor may not require this unless you
+are requiring AVS Verification).
-The customers city (your processor may not require this unless you are requiring AVS Verification).
+The customers city (your processor may not require this unless you are
+requiring AVS Verification).
-The customers state (your processor may not require this unless you are requiring AVS Verification).
+The customers state (your processor may not require this unless you
+are requiring AVS Verification).
-The customers zip code (your processor may not require this unless you are requiring AVS Verification).
+The customers zip code (your processor may not require this unless you
+are requiring AVS Verification).
-Credit card number (obviously not required for non-credit card transactions).
+Credit card number (obviously not required for non-credit card
+transactions).
-Credit card expiration (obviously not required for non-credit card transactions).
+Credit card expiration (obviously not required for non-credit card
+transactions).
-Returns true if the transaction was submitted successfully, false if it failed (or undef if it has not been submitted yet).
+Returns true if the transaction was submitted successfully, false if
+it failed (or undef if it has not been submitted yet).
-If the transactdion failed, it can optionally return a specific failure status
-(normalized, not gateway-specific). Currently defined statuses are: "expired",
-"nsf" (non-sufficient funds), "stolen", "pickup", "blacklisted" and
-"declined" (card/transaction declines only, not other errors).
+If the transaction failed, it can optionally return a specific
+failure status (normalized, not gateway-specific). Currently defined
+statuses are: "expired", "nsf" (non-sufficient funds), "stolen",
+"pickup", "blacklisted" and "declined" (card/transaction declines
+only, not other errors).
-Note that (as of Aug 2006) this is only supported by some of the newest
-processor modules, and that, even if supported, a failure status is an entirely
-optional field that is only set for specific kinds of failures.
+Note that (as of Aug 2006) this is only supported by some of the
+newest processor modules, and that, even if supported, a failure
+status is an entirely optional field that is only set for specific
+kinds of failures.
-Returns the precise result code that the processor returned, these are normally one letter codes that don't mean much unless you understand the protocol they speak, you probably don't need this, but it's there just in case.
+Returns the precise result code that the processor returned, these are
+normally one letter codes that don't mean much unless you understand
+the protocol they speak, you probably don't need this, but it's there
+just in case.
=head2 test_transaction();
=head2 test_transaction();
-Most processors provide a test mode, where submitted transactions will not actually be charged or added to your batch, calling this function with a true argument will turn that mode on if the processor supports it, or generate a fatal error if the processor does not support a test mode (which is probably better than accidentally making real charges).
+Most processors provide a test mode, where submitted transactions will
+not actually be charged or added to your batch, calling this function
+with a true argument will turn that mode on if the processor supports
+it, or generate a fatal error if the processor does not support a test
+mode (which is probably better than accidentally making real charges).
-Providing a true argument to this module will turn on address verification (if the processor supports it).
+Providing a true argument to this module will turn on address
+verification (if the processor supports it).
=head2 transaction_type();
=head2 transaction_type();
-Retrieve the transaction type (the 'type' argument to contents();). Generally only used internally, but provided in case it is useful.
+Retrieve the transaction type (the 'type' argument to contents();).
+Generally only used internally, but provided in case it is useful.
-If the transaction has been submitted but was not accepted, this function will return the provided error message (if any) that the processor returned.
+If the transaction has been submitted but was not accepted, this
+function will return the provided error message (if any) that the
+processor returned.
-If the transaction has been submitted and accepted, this function will provide you with the authorization code that the processor returned.
+If the transaction has been submitted and accepted, this function will
+provide you with the authorization code that the processor returned.
-Retrieve or change the processor submission server address (CHANGE AT YOUR OWN RISK).
+Retrieve or change the processor submission server address (CHANGE AT
+YOUR OWN RISK).
(v3 rewrite) Ivan Kohler <ivan-business-onlinepayment@420.am>
(v3 rewrite) Ivan Kohler <ivan-business-onlinepayment@420.am>
+Phil Lobbes E<lt>phil at perkpartners dot comE<gt>
+
=head1 DISCLAIMER
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
=head1 DISCLAIMER
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
=head1 SEE ALSO
http://420.am/business-onlinepayment/
=head1 SEE ALSO
http://420.am/business-onlinepayment/