Business::OnlinePayment::SagePay - SagePay backend for Business::OnlinePayment
version 0.15
use Business::OnlinePayment; my $tx = Business::OnlinePayment->new( "SagePay", "username" => "abc", ); $tx->content( type => 'VISA', login => 'testdrive', password => '', action => 'Normal Authorization', description => 'Business::OnlinePayment test', amount => '49.95', invoice_number => '100100', customer_id => 'jsk', first_name => 'Jason', last_name => 'Kohles', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', card_number => '4007000000027', expiration => '09/02', cvv2 => '1234', #optional referer => 'http://valid.referer.url/', ); $tx->set_server('simulator'); #live, simulator or test(default) $tx->submit(); if ($tx->is_success) { print "Card processed successfully: " . $tx->authorization . "\n"; } else { print "Card was rejected: " . $tx->error_message . "\n"; }
This perl module provides integration with the SagePay VSP payments system.
If the card type is set to PAYPAL then when submitted the transaction will use SagePay's PayPal integration (see http://www.sagepay.com/products_services/paypal). The URI to redirect the customer to after the page at PayPal has been completed should be set in the paypal_callback_uri atrribute in content.
PAYPAL
paypal_callback_uri
content
If result_code eq SAGEPAY_STATUS_PAYPAL_REDIRECT then user should be redirected to the uri provided in method forward_to.
result_code eq SAGEPAY_STATUS_PAYPAL_REDIRECT
forward_to
This method submits a COMPLETE transaction to SagePay to complete a PayPal transaction. authentication_id amd amount should be set in content.
authentication_id
amount
if ($tx->status_code eq $tx->SAGEPAY_STATUS_PAYPAL_REDIRECT) { # redirct to $tx->forward_to ... }
Status to check if transaction result_code requires a redirect to PayPal. Can be called as a class or object method for convenience.
Please report any bugs or feature requests to bug-business-onlinepayment-sagepay at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Business-OnlinePayment-SagePay. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-business-onlinepayment-sagepay at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Business::OnlinePayment::SagePay
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-OnlinePayment-SagePay
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Business-OnlinePayment-SagePay
CPAN Ratings
http://cpanratings.perl.org/d/Business-OnlinePayment-SagePay
Search CPAN
http://search.cpan.org/dist/Business-OnlinePayment-SagePay
Business::OnlinePayment
purge: Simon Elliott <cpan@browsing.co.uk> cubabit: Pete Smith
To Airspace Software Ltd <http://www.airspace.co.uk>, for the sponsorship. To Wallace Reis, for comments and patches.
This library is free software under the same license as perl itself.
To install Business::OnlinePayment::SagePay, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::OnlinePayment::SagePay
CPAN shell
perl -MCPAN -e shell install Business::OnlinePayment::SagePay
For more information on module installation, please visit the detailed CPAN module installation guide.