Business::PayPal

Perl extension for automating PayPal transactions
Download

Business::PayPal Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Gabor Szabo
  • Publisher web site:
  • http://search.cpan.org/~szabgab/

Business::PayPal Tags


Business::PayPal Description

Business::PayPal is a Perl module that makes the automation of PayPal transactions as simple as doing credit card transactions through a regular processor. It includes methods for creating PayPal buttons and for validating the Instant Payment Notification that is sent when PayPal processes a payment.SYNOPSISTo generate a PayPal button for use on your site Include something like the following in your CGI use Business::PayPal; my $paypal = Business::PayPal->new; my $button = $paypal->button( business => 'dr@dursec.com', item_name => 'CanSecWest Registration Example', return => 'http://www.cansecwest.com/return.cgi', cancel_return => 'http://www.cansecwest.com/cancel.cgi', amount => '1600.00', quantity => 1, notify_url => http://www.cansecwest.com/ipn.cgi ); my $id = $paypal->id;Store $id somewhere so we can get it back again laterStore current context with $id.Print button to the browser.Note, button is an HTML form, already enclosed in tagsTo validate the Instant Payment Notification from PayPal for the button used above include something like the following in your 'notify_url' CGI. use CGI; my $query = CGI->new; my %query = $query->Vars; my $id = $query{custom}; my $paypal = Business::PayPal->new(id => $id); my ($txnstatus, $reason) = $paypal->ipnvalidate(\%query); die "PayPal failed: $reason" unless $txnstatus; my $money = $query{payment_gross}; my $paystatus = $query{payment_status};check if paystatus eq 'Completed' check if $money is the ammount you expected save payment status information to store as $idTo tell the user if their payment succeeded or not, use something like the following in the CGI pointed to by the 'return' parameter in your PayPal button. use CGI; my $query = CGI->new; my $id = $query{custom}; #get payment status from store for $id #return payment status to customerProduct's homepage


Business::PayPal Related Software