Business::OnlinePayment::Litle - Business::OnlinePayment::Litle - Vantiv (was Litle & Co.) Backend for Business::OnlinePayment
version 0.958
This is a plugin for the Business::OnlinePayment interface. Please refer to that documentation for general usage, and here for Vantiv specific usage.
In order to use this module, you will need to have an account set up with Vantiv http://www.vantiv.com/
Originally created for the Litle & Co. API, which became a part of the Vantiv corporation.
use Business::OnlinePayment;
my $tx = Business::OnlinePayment->new(
"Litle",
default_Origin => 'NEW',
);
$tx->content(
type => 'CC',
login => 'testdrive',
password => '123qwe',
action => 'Normal Authorization',
description => 'FOO*Business::OnlinePayment test',
amount => '49.95',
customer_id => 'tfb',
name => 'Tofu Beast',
address => '123 Anystreet',
city => 'Anywhere',
state => 'UT',
zip => '84058',
card_number => '4007000000027',
expiration => '09/02',
cvv2 => '1234', #optional
invoice_number => '54123',
);
$tx->submit();
if($tx->is_success()) {
print "Card processed successfully: ".$tx->authorization."\n";
} else {
print "Card was rejected: ".$tx->error_message."\n";
}
Returns the response error code.
Returns the response error description text.
Returns 1 if the request was a duplicate, 0 otherwise
Return the card token if present. You will need to have the card tokenization feature enabled for this feature to make sense.
Return the Litle specific response code for the tokenization request
Return the Litle human readable response to the tokenization request
Returns the complete request that was sent to the server. The request has been stripped of card_num, cvv2, and password. So it should be safe to log.
Returns the complete request that was sent to the server. This could contain data that is NOT SAFE to log. It should only be used in a test environment, or in a PCI compliant manner.
Returns the complete response from the server. The response has been stripped of card_num, cvv2, and password. So it should be safe to log.
Returns the complete response from the server. This could contain data that is NOT SAFE to log. It should only be used in a test environment, or in a PCI compliant manner.
The following actions are valid
normal authorization
authorization only
post authorization
credit
void
auth reversal
Most data fields not part of the BOP standard can be added to the content hash directly, and will be used
Most data fields will truncate extra characters to conform to the Litle XML length requirements. Some fields (mostly amount fields) will error if your data exceeds the allowed length.
Part of the enhanced data for level III Interchange rates
products => [
{ description => 'First Product',
sku => 'sku',
quantity => 1,
units => 'Months'
amount => '5.00',
discount => 0,
code => 1,
cost => '5.00',
},
{ description => 'Second Product',
sku => 'sku',
quantity => 1,
units => 'Months',
amount => 1500,
discount => 0,
code => 2,
cost => '5.00',
}
],
Return the introspection hash for BOP 3.x
Get/set the server used for processing transactions. Possible values are Live, Certification, and Sandbox Default: Live
#Live
$self->test_transaction(0);
#Certification
$self->test_transaction(1);
#Sandbox
$self->test_transaction('sandbox');
#Read current value
$val = $self->test_transaction();
A new method not directly supported by BOP. Used internally to guarantee that XML data will conform to the Litle spec. field - The hash key we are checking against maxLen - The maximum length allowed (extra bytes will be truncated) minLen - The minimum length allowed errorOnLength - boolean 0 - truncate any extra bytes 1 - error if the length is out of bounds isRequired - boolean 0 - ignore undefined values 1 - error if the value is not defined
$tx->format_misc_field( \%content, [field, maxLen, minLen, errorOnLength, isRequired] );
$tx->format_misc_field( \%content, ['amount', 0, 12, 0, 0] );
A new method not directly supported by BOP. Used internally to change amounts from the BOP "5.00" format to the format expected by Litle "500"
$tx->format_amount_field( \%content, 'amount' );
A new method not directly supported by BOP. Used internally to strip invalid characters from phone numbers. IE "1 (800).TRY-THIS" becomes "18008788447"
$tx->format_phone_field( \%content, 'company_phone' );
Converts the BOP data to something that Litle can use.
A new method not directly supported by BOP. Retrieve a currently uploaded file
$tx->content(
login => 'testdrive',
password => '123qwe',
merchantid => '123456',
case_id => '001',
filename => 'mydoc.pdf',
);
$tx->chargeback_retrieve_support_doc();
$myFileData = $tx->{'fileContent'};
A new method not directly supported by BOP. Delete a currently uploaded file. Follows the same format as chargeback_retrieve_support_doc
A new method not directly supported by BOP. Upload a new file
$tx->content(
login => 'testdrive',
password => '123qwe',
merchantid => '123456',
case_id => '001',
filename => 'mydoc.pdf',
filecontent => $binaryPdfData,
mimetype => 'application/pdf',
);
$tx->chargeback_upload_support_doc();
A new method not directly supported by BOP. Replace a previously uploaded file. Follows the same format as chargeback_upload_support_doc
A new method not directly supported by BOP. Return a hashref that contains a list of files that already exist on the server.
$tx->content(
login => 'testdrive',
password => '123qwe',
merchantid => '123456',
case_id => '001',
);
my $ret = $tx->chargeback_list_support_docs();
Currently this returns in this format
$ret = {
'file1' => {},
'file2' => {},
};
Litle does not currently send any file attributes. However the hash is built for future expansion.
A new method not directly supported by BOP. Interface to adding multiple entries, so we can write and interface with batches
my %content = (
action => 'Account Update',
card_number => 4111111111111111,
expiration => 1216,
customer_id => $card->{'uid'},
invoice_number => 123,
type => 'VI',
login => $merchant->{'login'},
);
$tx->add_item( \%content );
A new method not directly supported by BOP. Send the current batch to Litle.
$tx->add_item( $item1 );
$tx->add_item( $item2 );
$tx->add_item( $item3 );
my $opts = {
login => 'testdrive',
password => '123qwe',
merchantid => '123456',
batch_id => '001',
method => 'https', # sftp or https
ftp_username=> 'fred',
ftp_password=> 'pancakes',
};
$tx->content();
$tx->create_batch( %$opts );
A new method not directly supported by BOP.
A new method not directly supported by BOP. Get a list of available batch result files.
my $opts = {
ftp_username=> 'fred',
ftp_password=> 'pancakes',
};
my $ret = $tx->retrieve_batch( %$opts );
my @filelist = @$ret if $tx->is_success;
A new method not directly supported by BOP. Delete a batch from Litle.
my $opts = {
login => 'testdrive',
password => '123qwe',
batch_id => '001',
ftp_username=> 'fred',
ftp_password=> 'pancakes',
};
$tx->retrieve_batch_delete( %$opts );
A new method not directly supported by BOP. Get a batch from Litle.
my $opts = {
login => 'testdrive',
password => '123qwe',
batch_id => '001',
batch_return=> '', # If present, this will be used instead of downloading from Litle
ftp_username=> 'fred',
ftp_password=> 'pancakes',
};
$tx->content();
$tx->retrieve_batch( %$opts );
Return a arrayref that contains a list of Business::OnlinePayment::Litle::ChargebackActivityResponse objects
$tx->content(
login => 'testdrive',
password => '123qwe',
activity_date => '2012-04-30',
);
my $ret = $tx->chargeback_activity_request();
Return a arrayref that contains a list of Business::OnlinePayment::Litle::ChargebackActivityResponse objects
$tx->content(
login => 'testdrive',
password => '123qwe',
case_id => '1600010045',
merchant_activity_id => '1555',
activity => 'Merchant Accepts Liability',
);
$tx->chargeback_update_request();
$tx->result_code(); # 0 - success, 1 invalid xml
$tx->error_message(); # Text version of the error message, if any
$tx->phoenixTxnId(); # Unique identifier provided by Litle.
$tx->is_success(); # Boolean, did the request work
See Business::OnlinePayment for the complete list. The following methods either override the methods in Business::OnlinePayment or provide additional functions.
Currently uses the Litle XML specifications version 11.0 and chargeback version 2.2
In order to run the provided test suite, you will first need to apply and get your account setup with Litle. Then you can use the test account information they give you to run the test suite. The scripts will look for three environment variables to connect: BOP_USERNAME, BOP_PASSWORD, BOP_MERCHANTID
Currently the description field also uses a fixed descriptor. This will possibly need to be changed based on your arrangements with Litle.
The default card scrubbing leaves the first 6 and last 4 of the card number for logging.
If you want to provide your own card number scrubber code ref, pass in the default_Scrubber option to the constructor. It takes the card number as the first parameter and should return the masked version.
my $tx = Business::OnlinePayment->new(
"Litle",
default_Origin => 'NEW',
default_Scrubber => sub {
return substr($_[0],-4,4);
}
);
Certain features are not yet implemented (no current personal business need), though the capability of support is there, and the test data for the verification suite is there.
Capture Given Auth
applepay
paypage
return objects for bounce pages (sepa|ideal)
Please report any bugs or feature requests to bug-business-onlinepayment-litle at rt.cpan.org
. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You may also add to the code via github, at http://github.com/Jayceh/Business--OnlinePayment--Litle.git
You can find documentation for this module with the perldoc command.
perldoc Business::OnlinePayment::Litle
You can also look for information at:
Documentation and specs are available on github at http://litleco.github.io/
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Heavily based on Jeff Finucane's l<Business::OnlinePayment::IPPay> because it also required dynamically writing XML formatted docs to a gateway.
perl(1). Business::OnlinePayment
Jason Hall <[email protected]>
Daina Pettit <[email protected]>
David Bartle <[email protected]>
Jason Hall <[email protected]>
Jason (Jayce^) Hall <[email protected]>
Jason Terry <[email protected]>
This software is copyright (c) 2017 by Jason Hall.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.