diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a19272 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +Business-PayPal-API-* +META.yml +Makefile +Makefile.old +blib +pm_to_blib +MANIFEST +MANIFEST.bak + diff --git a/Changes b/Changes index 2097ab3..5bbc22c 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,19 @@ Revision history for Perl extension Business::PayPal::API. + +- Merge in changes from Ron Phipps. + - Reduce SOAP version requirement. + - Protection eligibility support. +- Merge in changes from Tomas Doran. + - CPAN packaging enhancements. +- Extract out more payer details from XML. (PayerName, NameSuffix, PayerCountry). +- Fix warning in Perl 5.14.x (hopefully). https://rt.cpan.org/Public/Bug/Display.html?id=70424 +- Fix https://rt.cpan.org/Public/Bug/Display.html?id=67386 + +Release 0.69 - As currently release to CPAN +------------------------------------------- + +(Changelog corrected). + Release 0.68 - First hembreed release ------------------------------------- I've moved the module's scm to http://github.com/hembreed/Business-PayPal-API so others may share my pain. CPAN will be updated from there. diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index cc89e32..0000000 --- a/MANIFEST +++ /dev/null @@ -1,30 +0,0 @@ -Changes -Makefile.PL -MANIFEST -README -eg/paypal-checkout-example.pl -lib/Business/PayPal/API.pm -lib/Business/PayPal/API/AuthorizationRequest.pm -lib/Business/PayPal/API/CaptureRequest.pm -lib/Business/PayPal/API/DirectPayments.pm -lib/Business/PayPal/API/ExpressCheckout.pm -lib/Business/PayPal/API/GetTransactionDetails.pm -lib/Business/PayPal/API/MassPay.pm -lib/Business/PayPal/API/ReauthorizationRequest.pm -lib/Business/PayPal/API/RecurringPayments.pm -lib/Business/PayPal/API/RefundTransaction.pm -lib/Business/PayPal/API/TransactionSearch.pm -lib/Business/PayPal/API/VoidRequest.pm -t/API.pl -t/Business-PayPal-API.t -t/DirectPayments.t -t/ExpressCheckout.t -t/ExpressOrder.t -t/GetTransactionDetails.t -t/MassPay.t -t/RecurringPayments.t -t/RefundTransaction.t -t/TransactionSearch.t -auth.sample.3token -auth.sample.cert -META.yml diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP new file mode 100644 index 0000000..211c366 --- /dev/null +++ b/MANIFEST.SKIP @@ -0,0 +1,11 @@ +^Business-PayPal-API- +\.git +blib/ +\.DS_Store$ +pm_to_blib$ +Makefile$ +MANIFEST\.SKIP$ +MANIFEST\.bak$ +Makefile\.old$ +\.shipit + diff --git a/META.yml b/META.yml deleted file mode 100644 index c03527c..0000000 --- a/META.yml +++ /dev/null @@ -1,11 +0,0 @@ -# http://module-build.sourceforge.net/META-spec.html -#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# -name: Business-PayPal-API -version: 0.62 -version_from: lib/Business/PayPal/API.pm -installdirs: site -requires: - SOAP::Lite: 0.67 - -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.30 diff --git a/Makefile.PL b/Makefile.PL index fa1faa6..4fd997f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,6 +6,11 @@ WriteMakefile( NAME => 'Business::PayPal::API', VERSION_FROM => 'lib/Business/PayPal/API.pm', PREREQ_PM => { SOAP::Lite => 0.67 }, + META_ADD => { + resources => { + repository => 'git://github.com/hembreed/Business-PayPal-API.git', + }, + }, ($] >= 5.005 ? (ABSTRACT_FROM => 'lib/Business/PayPal/API.pm', AUTHOR => 'Scott Wiersdorf ') : ()), diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..1a643d0 --- /dev/null +++ b/debian/control @@ -0,0 +1,31 @@ +Source: libbusiness-paypal-api-perl +Section: perl +Priority: optional +Build-Depends: debhelper (>= 5.0.0) +Build-Depends-Indep: perl (>= 5.8.8-12), libsoap-lite-perl +Maintainer: Dave Lambley +Standards-Version: 3.7.2 +Homepage: http://search.cpan.org/dist/Business-PayPal-API/ + +Package: libbusiness-paypal-api-perl +Architecture: all +Depends: ${perl:Depends}, ${misc:Depends}, libsoap-lite-perl +Description: PayPal API + Business::PayPal::API supports both certificate authentication and + the new 3-token "Signature" authentication. + . + It also support PayPal's development sandbox for testing. See the + sandbox parameter to new() below for details. + . + Business::PayPal::API can import other API derived classes: + . + use Business::PayPal::API qw( RefundTransaction ); + . + This allows for much more concise and intuitive usage. For example, + these two statements are equivalent: + . + use Business::PayPal::API::RefundTransaction; + my $pp = new Business::PayPal::API::RefundTransaction( ... ); + $pp->RefundTransaction( ... ); + . + This description was automagically extracted from the module by dh-make-perl. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ad5ff9c --- /dev/null +++ b/debian/copyright @@ -0,0 +1,14 @@ +This is the debian package for the Business-PayPal-API module. +It was created by Dave Lambley using dh-make-perl. + +It was downloaded from http://search.cpan.org/dist/Business-PayPal-API/ + +This copyright info was automatically extracted from the perl module. +It may not be accurate, so you better check the module sources +if don't want to get into legal troubles. + +The upstream author is: Scott Wiersdorf . + + +The Debian packaging is (C) 2008, Tomas Doran and +is licensed under the same terms as the software itself (see above). diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..768a505 --- /dev/null +++ b/debian/rules @@ -0,0 +1,81 @@ +#!/usr/bin/make -f +# This debian/rules file is provided as a template for normal perl +# packages. It was created by Marc Brockschmidt for +# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may +# be used freely wherever it is useful. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# If set to a true value then MakeMaker's prompt function will +# always return the default without waiting for user input. +export PERL_MM_USE_DEFAULT=1 + +PACKAGE=$(shell dh_listpackages) + +ifndef PERL +PERL = /usr/bin/perl +endif + +TMP =$(CURDIR)/debian/$(PACKAGE) + +build: build-stamp +build-stamp: + dh_testdir + + # As this is a architecture independent package, we are not + # supposed to install stuff to /usr/lib. MakeMaker creates + # the dirs, we prevent this by setting the INSTALLVENDORARCH + # and VENDORARCHEXP environment variables. + + # Add commands to compile the package here + $(PERL) Makefile.PL INSTALLDIRS=vendor \ + INSTALLVENDORARCH=/usr/share/perl5/ \ + VENDORARCHEXP=/usr/share/perl5/ + $(MAKE) + $(MAKE) test + + touch $@ + +clean: + dh_testdir + dh_testroot + + dh_clean build-stamp install-stamp + + # Add commands to clean up after the build process here + [ ! -f Makefile ] || $(MAKE) realclean + +install: install-stamp +install-stamp: build-stamp + dh_testdir + dh_testroot + dh_clean -k + + # Add commands to install the package into debian/$PACKAGE_NAME here + $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr + + touch $@ + +binary-arch: +# We have nothing to do here for an architecture-independent package + +binary-indep: build install + dh_testdir + dh_testroot + dh_installexamples + dh_installdocs README + dh_installchangelogs Changes + dh_perl + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary diff --git a/lib/Business/PayPal/API.pm b/lib/Business/PayPal/API.pm index 9e1647f..2ddb736 100644 --- a/lib/Business/PayPal/API.pm +++ b/lib/Business/PayPal/API.pm @@ -8,7 +8,6 @@ use SOAP::Lite 0.67; # +trace => 'all'; use Carp qw(carp); our $VERSION = '0.69'; -our $CVS_VERSION = '$Id: API.pm,v 1.24 2009/07/28 18:00:58 scott Exp $'; our $Debug = 0; ## NOTE: This package exists only until I can figure out how to use @@ -22,7 +21,7 @@ sub C_api_live () { 'https://api.paypal.com/2.0/' } sub C_api_live_3t () { 'https://api-3t.paypal.com/2.0/' } sub C_xmlns_pp () { 'urn:ebay:api:PayPalAPI' } sub C_xmlns_ebay () { 'urn:ebay:apis:eBLBaseComponents' } -sub C_version () { '3.0' } ## 3.0 adds RecurringPayments +sub C_version () { '61.0' } ## 3.0 adds RecurringPayments ## this is an inside-out object. Make sure you 'delete' additional ## members in DESTROY() as you add them. @@ -243,7 +242,7 @@ sub getBasic { return unless $som; - for my $field qw( Ack Timestamp CorrelationID Version Build ) { + for my $field qw/ Ack Timestamp CorrelationID Version Build / { $details->{$field} = $som->valueof("$path/$field") || ''; } diff --git a/lib/Business/PayPal/API/ExpressCheckout.pm b/lib/Business/PayPal/API/ExpressCheckout.pm index db07c26..8292870 100644 --- a/lib/Business/PayPal/API/ExpressCheckout.pm +++ b/lib/Business/PayPal/API/ExpressCheckout.pm @@ -140,8 +140,11 @@ sub GetExpressCheckoutDetails { Payer => 'PayerInfo/Payer', PayerID => 'PayerInfo/PayerID', PayerStatus => 'PayerInfo/PayerStatus', + Salutation => 'PayerInfo/PayerName/Saluation', FirstName => 'PayerInfo/PayerName/FirstName', + MiddleName => 'PayerInfo/PayerName/MiddleName', LastName => 'PayerInfo/PayerName/LastName', + NameSuffix => 'PayerInfo/PayerName/Suffix', PayerBusiness => 'PayerInfo/PayerBusiness', AddressStatus => 'PayerInfo/Address/AddressStatus', Name => 'PayerInfo/Address/Name', @@ -151,6 +154,7 @@ sub GetExpressCheckoutDetails { StateOrProvince => 'PayerInfo/Address/StateOrProvince', PostalCode => 'PayerInfo/Address/PostalCode', Country => 'PayerInfo/Address/Country', + PayerCountry => 'PayerInfo/PayerCountry', } ); return %details; @@ -164,6 +168,7 @@ sub DoExpressCheckoutPayment { PaymentAction => '', ## NOTA BENE! PayerID => 'ebl:UserIDType', currencyID => '', + ReturnFMFDetails => 'xs:boolean', ); ## PaymentDetails @@ -274,7 +279,9 @@ sub DoExpressCheckoutPayment { SOAP::Data->name( PaymentDetails => \SOAP::Data->value ( @payment_details )->type('ebl:PaymentDetailsType') ->attr( {xmlns => $self->C_xmlns_ebay} ), - ), ); + ), + SOAP::Data->name( ReturnFMFDetails => $args{ReturnFMFDetails} ) + ->type($types{ReturnFMFDetails})->attr( {xmlns => $self->C_xmlns_ebay} ), ); ## ## the main request object @@ -315,6 +322,11 @@ sub DoExpressCheckoutPayment { ExchangeRate => 'PaymentInfo/ExchangeRate', PaymentStatus => 'PaymentInfo/PaymentStatus', PendingReason => 'PaymentInfo/PendingReason', + AcceptFilters => 'FMFDetails/AcceptFilters', + DenyFilters => 'FMFDetails/DenyFilters', + PendingFilters => 'FMFDetails/PendingFilters', + ReportsFilters => 'FMFDetails/ReportsFilters', + ProtectionEligibility => 'PaymentInfo/ProtectionEligibility', } ); return %response; diff --git a/lib/Business/PayPal/API/GetTransactionDetails.pm b/lib/Business/PayPal/API/GetTransactionDetails.pm index c0d9330..9a55d72 100644 --- a/lib/Business/PayPal/API/GetTransactionDetails.pm +++ b/lib/Business/PayPal/API/GetTransactionDetails.pm @@ -82,6 +82,7 @@ sub GetTransactionDetails { PaymentStatus => '/PaymentInfo/PaymentStatus', PendingReason => '/PaymentInfo/PendingReason', ReasonCode => '/PaymentInfo/ReasonCode', + ProtectionEligibility => '/PaymentInfo/ProtectionEligibility', InvoiceID => '/PaymentItemInfo/InvoiceID', Custom => '/PaymentItemInfo/Custom', @@ -123,7 +124,7 @@ sub GetTransactionDetails { Options => 'Options', } ); - if( scalar(@$paymentitems) > 1 ) { + if( scalar(@$paymentitems) > 0 ) { $response{PaymentItems} = $paymentitems; }