r54266 - in /branches/upstream/libbusiness-paypal-api-perl/current: ./ lib/Business/PayPal/ lib/Business/PayPal/API/ t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Mar 13 22:55:25 UTC 2010


Author: jawnsy-guest
Date: Sat Mar 13 22:55:20 2010
New Revision: 54266

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54266
Log:
[svn-upgrade] Integrating new upstream version, libbusiness-paypal-api-perl (0.69)

Added:
    branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/.exists
Modified:
    branches/upstream/libbusiness-paypal-api-perl/current/Changes
    branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API.pm
    branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/DirectPayments.pm
    branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/MassPay.pm
    branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/ReauthorizationRequest.pm
    branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RecurringPayments.pm
    branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RefundTransaction.pm
    branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/VoidRequest.pm
    branches/upstream/libbusiness-paypal-api-perl/current/t/DirectPayments.t
    branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressCheckout.t
    branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressOrder.t
    branches/upstream/libbusiness-paypal-api-perl/current/t/GetTransactionDetails.t
    branches/upstream/libbusiness-paypal-api-perl/current/t/MassPay.t
    branches/upstream/libbusiness-paypal-api-perl/current/t/RecurringPayments.t
    branches/upstream/libbusiness-paypal-api-perl/current/t/RefundTransaction.t
    branches/upstream/libbusiness-paypal-api-perl/current/t/TransactionSearch.t

Modified: branches/upstream/libbusiness-paypal-api-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/Changes?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/Changes (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/Changes Sat Mar 13 22:55:20 2010
@@ -1,4 +1,16 @@
 Revision history for Perl extension Business::PayPal::API.
+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.
+
+- API.pm
+   1. Changed eq 'Success' to =~ /Success/ to accomodate variations introduced
+      by PayPal.
+   2. Changed test for duplicates to test for defined variable first. This
+      was causing errors in 5.10+ perl versions.
+-t/*t Changed test for Success in all test modules as above
+-t/RecurringPayments Corrected errors in type definitions and testing. Needs more work.
+-TransactionSearch Corrected test instructions and code to allow transaction searches using the transactionID. This works for some types of transactions but not others as per PayPal. It is   the only way to get MassPayment information.
 
 Release 0.62 - last scottw release
 ----------------------------

Added: branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/.exists
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/.exists?rev=54266&op=file
==============================================================================
    (empty)

Modified: branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API.pm?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API.pm (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API.pm Sat Mar 13 22:55:20 2010
@@ -7,7 +7,7 @@
 use SOAP::Lite 0.67; # +trace => 'all';
 use Carp qw(carp);
 
-our $VERSION = '0.62';
+our $VERSION = '0.69';
 our $CVS_VERSION = '$Id: API.pm,v 1.24 2009/07/28 18:00:58 scott Exp $';
 our $Debug = 0;
 
@@ -181,9 +181,13 @@
         @response{keys %$fields} = @{$rec}{keys %$fields};
 
         ## avoid duplicates
-        next if $trans_id{$response{TransactionID}};
-        $trans_id{$response{TransactionID}} = 1;
-
+	if( defined $response{TransactionID}) {
+	    if( $trans_id{$response{TransactionID}}) {
+		next;
+	    } else {	
+		$trans_id{$response{TransactionID}} = 1;
+	    }
+	}
         push @records, \%response;
     }
 
@@ -243,7 +247,7 @@
         $details->{$field} = $som->valueof("$path/$field") || '';
     }
 
-    return $details->{Ack} eq 'Success';
+    return $details->{Ack} =~ /Success/;
 }
 
 sub getErrors {

Modified: branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/DirectPayments.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/DirectPayments.pm?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/DirectPayments.pm (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/DirectPayments.pm Sat Mar 13 22:55:20 2010
@@ -258,7 +258,7 @@
                     ...
              );
 
-  unless( $resp{Ack} ne 'Success' ) {
+  unless( $resp{Ack} !~ /Success/ ) {
       for my $error ( @{$response{Errors}} ) {
           warn "Error: " . $error->{LongMessage} . "\n";
       }

Modified: branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/MassPay.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/MassPay.pm?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/MassPay.pm (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/MassPay.pm Sat Mar 13 22:55:20 2010
@@ -155,7 +155,7 @@
                                                UniqueId => "123456",
                                                Note => "Enjoy the money. Don't spend it all in one place." } ] );
 
-  unless( $resp{Ack} eq 'Success' ) {
+  unless( $resp{Ack} !~ /Success/ ) {
     die "Failed: " . $resp{Errors}[0]{LongMessage} . "\n";
   }
 

Modified: branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/ReauthorizationRequest.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/ReauthorizationRequest.pm?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/ReauthorizationRequest.pm (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/ReauthorizationRequest.pm Sat Mar 13 22:55:20 2010
@@ -108,7 +108,7 @@
                                      CurrencyID      => 'USD'
                                       );
 
-  unless( $resp{Ack} ne 'Success' ) {
+  unless( $resp{Ack} !~ /Success/ ) {
       for my $error ( @{$response{Errors}} ) {
           warn "Error: " . $error->{LongMessage} . "\n";
       }

Modified: branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RecurringPayments.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RecurringPayments.pm?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RecurringPayments.pm (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RecurringPayments.pm Sat Mar 13 22:55:20 2010
@@ -27,7 +27,7 @@
                      PaymentType                 => '', # 'ns:MerchantPullPaymentCodeType',
                      BillingAgreementCustom      => 'xs:string', );
 
-    my %types = ( # BillingAgreementDetails     => 'ns:BillingAgreementDetailsType',
+    my %types = (  BillingAgreementDetails     => 'ns:BillingAgreementDetailsType',
                   ReturnURL                   => 'xs:string',
                   CancelURL                   => 'xs:string',
                   LocaleCode                  => 'xs:string',
@@ -59,7 +59,7 @@
 
     my $request = SOAP::Data
       ->name( SetCustomerBillingAgreementRequest => \SOAP::Data->value
-              ( $API_VERSION,
+              ( $self->version_req, #$API_VERSION,
                 SOAP::Data->name( SetCustomerBillingAgreementRequestDetails => \SOAP::Data->value(@scba)
                                 )->attr( {xmlns => $self->C_xmlns_ebay} ),
               )
@@ -139,31 +139,31 @@
 
     ## RecurringPaymentProfileDetails
     my %profiledetailstype = ( SubscriberName   => 'xs:string',
-#                               SubscriberShipperAddress => 'ns:AddressType',
+                               SubscriberShipperAddress => 'ns:AddressType',
                                BillingStartDate => 'xs:dateTime',  ## MM-DD-YY
                                ProfileReference => 'xs:string', );
 
     ## ScheduleDetailsType
     my %schedtype = ( Description       => 'xs:string',
-#                      ActivationDetails => 'ns:ActivationDetailsType',
-#                      TrialPeriod       => 'ns:BillingPeriodDetailsType',
-#                      PaymentPeriod     => 'ns:BillingPeriodDetailsType',
+                      ActivationDetails => 'ns:ActivationDetailsType',
+                      TrialPeriod       => 'ns:BillingPeriodDetailsType',
+                      PaymentPeriod     => 'ns:BillingPeriodDetailsType',
                       MaxFailedPayments => 'xs:int',
                       AutoBillOutstandingAmount => 'ns:AutoBillType', );  ## NoAutoBill or AddToNextBilling
 
     ## activation details
     my %activationdetailstype = ( InitialAmount             => 'cc:BasicAmountType',
-                                  FailedInitialAmountAction => 'ns:FailedPaymentAction' );  ## ContinueOnFailure or CancelOnFailure
+                                  FailedInitialAmountAction => 'ns:FailedPaymentAction', );  ## ContinueOnFailure or CancelOnFailure
 
     ## BillingPeriodDetailsType
-    my %trialbilltype = ( TrialBillingPeriod      => 'ns:BillingPeriodType',
+    my %trialbilltype = ( TrialBillingPeriod      => 'xs:string', ##'ns:BillingPeriodType',
                           TrialBillingFrequency   => 'xs:int',
                           TrialTotalBillingCycles => 'xs:int',
                           TrialAmount             => 'cc:AmountType',
                           TrialShippingAmount     => 'cc:AmountType',
                           TrialTaxAmount          => 'cc:AmountType', );
 
-    my %paymentbilltype = ( PaymentBillingPeriod      => 'ns:BillingPeriodType',
+    my %paymentbilltype = ( PaymentBillingPeriod      => 'xs:string', ##'ns:BillingPeriodType',
                             PaymentBillingFrequency   => 'xs:int',
                             PaymentTotalBillingCycles => 'xs:int',
                             PaymentAmount             => 'cc:AmountType',
@@ -191,17 +191,17 @@
 
     ## credit card payer
     my %payerinfotype = ( CCPayer           => 'ns:EmailAddressType',
-                          CCPayerID         => 'xs:string',
+                          CCPayerID         => 'ebl:UserIDType',
                           CCPayerStatus     => 'xs:string',
                           CCPayerName       => 'xs:string',
                           CCPayerCountry    => 'xs:string',
                           CCPayerPhone      => 'xs:string',
                           CCPayerBusiness   => 'xs:string',
-#                          Address         => 'ns:AddressType',
+                          CCAddress         => 'xs:string',
                          );
 
     ## credit card details
-    my %creditcarddetailstype = ( # CardOwner        => 'ns:PayerInfoType',
+    my %creditcarddetailstype = ( CardOwner        => 'ns:PayerInfoType',
                                   CreditCardType   => 'ebl:CreditCardType',  ## Visa, MasterCard, Discover, Amex, Switch, Solo
                                   CreditCardNumber => 'xs:string',
                                   ExpMonth         => 'xs:int',
@@ -209,7 +209,7 @@
                                   CVV2             => 'xs:string',
                                   StartMonth       => 'xs:string',
                                   StartYear        => 'xs:string',
-                                  IssueNumber      => 'xs:string', );
+                                  IssueNumber      => 'xs:int', );
 
     ## this gets pushed onto scheduledetails
     my @activationdetailstype = ();
@@ -285,8 +285,8 @@
 
     my $request = SOAP::Data->name
       ( CreateRecurringPaymentsProfileRequest => \SOAP::Data->value
-        ( $API_VERSION,
-#        ( $self->version_req,
+#        ( $API_VERSION,
+        ( $self->version_req,
           SOAP::Data->name( CreateRecurringPaymentsProfileRequestDetails => \SOAP::Data->value(@crpprd) 
                           )->attr( {xmlns => $self->C_xmlns_ebay} )
         )

Modified: branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RefundTransaction.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RefundTransaction.pm?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RefundTransaction.pm (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/RefundTransaction.pm Sat Mar 13 22:55:20 2010
@@ -123,7 +123,7 @@
                                      RefundType    => 'Partial',
                                      Amount        => '15.00', );
 
-  unless( $resp{Ack} ne 'Success' ) {
+  unless( $resp{Ack} !~ /Success/ ) {
       for my $error ( @{$response{Errors}} ) {
           warn "Error: " . $error->{LongMessage} . "\n";
       }

Modified: branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/VoidRequest.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/VoidRequest.pm?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/VoidRequest.pm (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/lib/Business/PayPal/API/VoidRequest.pm Sat Mar 13 22:55:20 2010
@@ -101,7 +101,7 @@
   my %resp = $pp->DoVoidRequest( AuthorizationID => $trans_id,
                                  Note            => 'Sorry about that.' );
 
-  unless( $resp{Ack} ne 'Success' ) {
+  unless( $resp{Ack} !~ /Success/ ) {
       for my $error ( @{$response{Errors}} ) {
           warn "Error: " . $error->{LongMessage} . "\n";
       }

Modified: branches/upstream/libbusiness-paypal-api-perl/current/t/DirectPayments.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/t/DirectPayments.t?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/t/DirectPayments.t (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/t/DirectPayments.t Sat Mar 13 22:55:20 2010
@@ -7,7 +7,7 @@
     plan skip_all => 'No WPP_TEST env var set. Please see README to run tests';
 }
 else {
-    plan tests => '9';
+    plan tests => '7';
 }
 
 use Business::PayPal::API qw( DirectPayments CaptureRequest ReauthorizationRequest VoidRequest RefundTransaction );
@@ -23,13 +23,13 @@
 my ($ppsale,$ppvoid,$ppbasic,$pprefund,$pprefund1,$ppcap,$ppcap1);
 my (%respsale,%resprefund,%resprefund1,%respbasic,%respcap,%respcap1,%respvoid);
 
-#Test Partial Refund on Sale
+#Test Full Refund on Sale
 
 #$Business::PayPal::API::Debug=1;
 $ppsale = new Business::PayPal::API(%args);
 %respsale = $ppsale->DoDirectPaymentRequest (
                         PaymentAction    => 'Sale',
-                        OrderTotal    => 13.87,
+                        OrderTotal    => 11.87,
                         TaxTotal       => 0.0,
                         ItemTotal  => 0.0,
                         CreditCardType      => 'Visa',
@@ -42,7 +42,7 @@
                         Street1  => '1st Street LaCausa',
                         Street2  => '',
                         CityName      => 'La',
-                        StateOrProvince     => 'Ca',
+                        StateOrProvince     => 'CA',
                         PostalCode       => '90210',
                         Country   => 'US',
                         Payer    => 'mall at example.org',
@@ -51,59 +51,17 @@
                         MerchantSessionID      => '10113301',
                         );
 #$Business::PayPal::API::Debug=0;
-if(is( $respsale{'Ack'}, 'Success', 'Direct Payment Sale')) {
+if(like( $respsale{'Ack'}, qr/Success/, 'Direct Payment Sale')) {
             $transale = $respsale{'TransactionID'};
 #$Business::PayPal::API::Debug=1;
             $pprefund = new Business::PayPal::API(%args);
             %resprefund = $pprefund->RefundTransaction (
                             TransactionID => $transale,
-                            RefundType    => 'Partial',
-                            Amount        => '3.00',
-                            Memo          => 'Partial three dollar refund',
+                            RefundType    => 'Full',
+                            Memo          => 'Full direct sale refund',
                             );
 #$Business::PayPal::API::Debug=0;
-            is( $resprefund{'Ack'}, 'Success', 'Partial Refund for sale');
-      }
-
-#Test Full Refund on Sale
-
-#$Business::PayPal::API::Debug=1;
-$ppsale = new Business::PayPal::API(%args);
-%respsale = $ppsale->DoDirectPaymentRequest (
-                        PaymentAction    => 'Sale',
-                        OrderTotal    => 13.87,
-                        TaxTotal       => 0.0,
-                        ItemTotal  => 0.0,
-                        CreditCardType      => 'Visa',
-                        CreditCardNumber        => '4561435600988217',
-                        ExpMonth       => '01',
-                        ExpYear        => +(localtime)[5]+1901,
-                        CVV2       => '123',
-                        FirstName      => 'JP',
-                        LastName      => 'Morgan',
-                        Street1  => '1st Street LaCausa',
-                        Street2  => '',
-                        CityName      => 'La',
-                        StateOrProvince     => 'Ca',
-                        PostalCode       => '90210',
-                        Country   => 'US',
-                        Payer    => 'mall at example.org',
-                        CurrencyID  => 'USD',
-                        IPAddress        => '10.0.0.1',
-                        MerchantSessionID      => '10113301',
-                        );
-#$Business::PayPal::API::Debug=0;
-if(is( $respsale{'Ack'}, 'Success', 'Direct Payment Sale')) {
-            $transale = $respsale{'TransactionID'};
-#$Business::PayPal::API::Debug=1;
-            $pprefund1 = new Business::PayPal::API(%args);
-            %resprefund1 = $pprefund1->RefundTransaction (
-                            TransactionID => $transale,
-                            RefundType    => 'Full',
-                            Memo          => 'Full refund',
-                            );
-#$Business::PayPal::API::Debug=0;
-            is( $resprefund1{'Ack'}, 'Success', 'Full Refund for sale');
+            like( $resprefund{'Ack'}, qr/Success/, 'Full Refund For Sale');
       }
 
 #Basic Authorization and Capture
@@ -126,7 +84,7 @@
                         Street1  => '1st Street LaCausa',
                         Street2  => '',
                         CityName      => 'La',
-                        StateOrProvince     => 'Ca',
+                        StateOrProvince     => 'CA',
                         PostalCode       => '90210',
                         Country   => 'US',
                         Payer    => 'mall at example.org',
@@ -136,7 +94,7 @@
                         );
 
 #$Business::PayPal::API::Debug=0;
-if( is( $respbasic{'Ack'}, 'Success', 'Direct Payment Basic Authorization') ) {
+if( like( $respbasic{'Ack'}, qr/Success/, 'Direct Payment Basic Authorization') ) {
     $tranbasic = $respbasic{'TransactionID'};
 
     #Test Partial Capture
@@ -150,7 +108,7 @@
 					 Note          => 'Partial Capture',
 					);
     #$Business::PayPal::API::Debug=0;
-    is( $respcap{'Ack'}, 'Success', 'Partial Capture');
+    like( $respcap{'Ack'}, qr/Success/, 'Partial Capture');
 
     #Test Full Capture
     #$Business::PayPal::API::Debug=1;
@@ -161,15 +119,16 @@
 					   Amount          => '6.00',
 					  );
     #$Business::PayPal::API::Debug=0;
-    is( $respcap1{'Ack'}, 'Success', 'Full Capture');
+    like( $respcap1{'Ack'}, qr/Success/, 'Full Capture');
 }
 else { skip( "direct payment auth failed", 2 ) }
+
 
 #Test Void
 $ppbasic = new Business::PayPal::API(%args);
 %respbasic = $ppbasic->DoDirectPaymentRequest (
                         PaymentAction    => 'Authorization',
-                        OrderTotal    => 18.37,
+                        OrderTotal    => 17.37,
                         TaxTotal       => 0.0,
                         ItemTotal  => 0.0,
                         CreditCardType      => 'Visa',
@@ -182,7 +141,7 @@
                         Street1  => '1st Street LaCausa',
                         Street2  => '',
                         CityName      => 'La',
-                        StateOrProvince     => 'Ca',
+                        StateOrProvince     => 'CA',
                         PostalCode       => '90210',
                         Country   => 'US',
                         Payer    => 'mall at example.org',
@@ -196,4 +155,4 @@
 %respvoid = $ppvoid->DoVoidRequest ( AuthorizationID => $respbasic{TransactionID},
 				     Note            => 'Authorization Void', );
 #$Business::PayPal::API::Debug=0;
-is( $respvoid{'Ack'}, 'Success', 'Authorization Voided');
+like( $respvoid{'Ack'}, qr/Success/, 'Authorization Voided');

Modified: branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressCheckout.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressCheckout.t?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressCheckout.t (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressCheckout.t Sat Mar 13 22:55:20 2010
@@ -87,6 +87,6 @@
 ##
 my %payinfo = $pp->DoExpressCheckoutPayment(%payment);
 
-is( $payinfo{Ack}, 'Success', "successful payment" );
+like( $payinfo{Ack}, qr/Success/ , "successful payment" );
 is( $payinfo{Token}, $token, "payment ok" );
 is( $payinfo{GrossAmount}, 55.43, "amount correct" );

Modified: branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressOrder.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressOrder.t?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressOrder.t (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/t/ExpressOrder.t Sat Mar 13 22:55:20 2010
@@ -92,7 +92,7 @@
 #$Business::PayPal::API::Debug = 0;
 #If Order is successful then authorize it, then void it.
 
-if(is( $payinfo{Ack}, 'Success', "successful payment" )) {
+if(like( $payinfo{Ack}, qr/Success/ , "successful payment" )) {
     my $transid= $payinfo{TransactionID};
     my $amount= '25.43';
     use_ok('Business::PayPal::API::AuthorizationRequest');
@@ -101,12 +101,12 @@
     $ppauth = new Business::PayPal::API::AuthorizationRequest(%args);
     my %resp = $ppauth->DoAuthorizationRequest( TransactionID => $transid,
                                    Amount    => $amount);
-    is( $resp{Ack}, 'Success', 'Successful order authorization' );
+    like( $resp{Ack}, qr/Succes/ , 'Successful order authorization' );
     use_ok( 'Business::PayPal::API::VoidRequest' );
     %args = do_args();
     my $ppvoid= new Business::PayPal::API::VoidRequest( %args );
     %resp1= $ppvoid->DoVoidRequest( AuthorizationID => $transid,
                                Note          => 'Voided' );
                                                                                 
-    is( $resp1{Ack}, 'Success', 'Successful order void' );
+  like( $resp1{Ack}, qr/Success/, 'Successful order void' );
     }

Modified: branches/upstream/libbusiness-paypal-api-perl/current/t/GetTransactionDetails.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/t/GetTransactionDetails.t?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/t/GetTransactionDetails.t (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/t/GetTransactionDetails.t Sat Mar 13 22:55:20 2010
@@ -41,4 +41,4 @@
 #$Business::PayPal::API::Debug = 1;
 my %resp = $pp->GetTransactionDetails( TransactionID => $transid );
 
-is( $resp{Ack}, 'Success', "transaction received" );
+like( $resp{Ack}, qr/Success/ , "transaction received" );

Modified: branches/upstream/libbusiness-paypal-api-perl/current/t/MassPay.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/t/MassPay.t?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/t/MassPay.t (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/t/MassPay.t Sat Mar 13 22:55:20 2010
@@ -22,7 +22,7 @@
                                              UniqueID => "123456",
                                              Note => "Enjoy the money. Don't spend it all in one place." } ] );
 
-is( $resp{Ack}, 'Success', "successful payment" );
+like( $resp{Ack}, qr/Success/ , "successful payment" );
 
 %resp = $pp->MassPay( EmailSubject => "This is the subject; nice eh?",
                       MassPayItems => [ { ReceiverEmail => 'bob at test.tld',
@@ -34,4 +34,4 @@
                                           UniqueID => "123458",
                                           Note => "Enjoy the money. Don't spend it all in one place." } ] );
 
-is( $resp{Ack}, 'Success', "successful payments" );
+like( $resp{Ack}, qr/Success/ , "successful payments" );

Modified: branches/upstream/libbusiness-paypal-api-perl/current/t/RecurringPayments.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/t/RecurringPayments.t?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/t/RecurringPayments.t (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/t/RecurringPayments.t Sat Mar 13 22:55:20 2010
@@ -4,7 +4,7 @@
     plan skip_all => 'No WPP_TEST env var set. Please see README to run tests';
 }
 else {
-    plan tests => 4;
+    plan tests => 3;
 }
 
 use_ok( 'Business::PayPal::API::RecurringPayments' );
@@ -16,21 +16,21 @@
 
 my $pp = new Business::PayPal::API::RecurringPayments(%args);
 
-$Business::PayPal::API::Debug = 1;
+#$Business::PayPal::API::Debug = 1;
 my %response = $pp->SetCustomerBillingAgreement
   (
    BillingType => 'RecurringPayments',
-
+   BillingAgreementDescription => '10.00 per month for 1 year',
    ReturnURL  => 'http://www.google.com/',
    CancelURL  => 'http://www.google.com/', 
    BuyerEmail => $args{BuyerEmail},
   );
-$Business::PayPal::API::Debug = 0;
+#$Business::PayPal::API::Debug = 0;
 
 my $token = $response{Token};
 
 ok( $token, "Got token" );
-is( $response{Ack}, 'Success', "SetCustomerBillingAgreement successful" );
+like( $response{Ack}, qr/Success/ , "SetCustomerBillingAgreement successful" );
 
 exit;
 
@@ -70,14 +70,14 @@
 
 
 ## CreateRecurringPaymentsProfile
-$Business::PayPal::API::Debug = 1;
+#$Business::PayPal::API::Debug = 1;
 my %profile = $pp->CreateRecurringPaymentsProfile
   ( Token => $token,
 
     ## RecurringPaymentProfileDetails
     SubscriberName => 'Joe Schmoe',
 
-    SubscriberShipperName            => "Schmoe House",
+    SubscriberShipperName            => 'Schmoe House',
     SubscriberShipperStreet1         => '1234 Street St.',
     SubscriberShipperCityName        => 'Orem',
     SubscriberShipperStateOrProvince => 'UT',
@@ -85,39 +85,39 @@
     SubscriberShipperCountry         => 'USA',
     SubscriberShipperPhone           => '123-123-1234',
 
-    BillingStartDate => '12-31-08',
+    BillingStartDate => '2009-12-01Z',
     ProfileReference => 'BH12341234',
 
     ## ScheduleDetails
-    Description => "12 Month Hosting Package: We Love You!",
+    Description => '12 Month Hosting Package: We Love You!',
 
     InitialAmount     => '12.34',
 
-    TrialBillingPeriod      => "Month",
+    TrialBillingPeriod      => 'Month',
     TrialBillingFrequency   => 1,
     TrialTotalBillingCycles => 1,
     TrialAmount             => 0.00,
     TrialShippingAmount     => 0.00,
     TrialTaxAmount          => 0.00,
 
-    PaymentBillingPeriod      => "Year",
+    PaymentBillingPeriod      => 'Year',
     PaymentBillingFrequency   => 1,
     PaymentTotalBillingCycles => 1,
     PaymentAmount             => 95.40,
     PaymentShippingAmount     => 0.00,
     PaymentTaxAmount          => 0.00,
 
-    MaxFailedPayments         => 1,
-    AutoBillOutstandingAmount => 'AddToNextBilling',
+#    MaxFailedPayments         => 1,
+#    AutoBillOutstandingAmount => 'AddToNextBilling',
   );
 
-$Business::PayPal::API::Debug = 0;
+#$Business::PayPal::API::Debug = 0;
 
 
 ## GetBillingAgreementCustomerDetails
 #$Business::PayPal::API::Debug = 1;
 my %details = $pp->GetBillingAgreementCustomerDetails($token);
-$Business::PayPal::API::Debug = 0;
+#$Business::PayPal::API::Debug = 0;
 
-is( $details{Ack}, "Success", "details ok" );
+like( $details{Ack}, qr/Success/ , "details ok" );
 

Modified: branches/upstream/libbusiness-paypal-api-perl/current/t/RefundTransaction.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/t/RefundTransaction.t?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/t/RefundTransaction.t (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/t/RefundTransaction.t Sat Mar 13 22:55:20 2010
@@ -43,7 +43,7 @@
                                    RefundType    => 'Full',
                                    Memo          => 'Fancy refund time.' );
 
-is( $resp{Ack}, 'Success', "Successful refund." );
+like( $resp{Ack}, qr/Success/ , "Successful refund." );
 
 if( $resp{Ack} ) {
     print STDERR <<"_REFUND_";

Modified: branches/upstream/libbusiness-paypal-api-perl/current/t/TransactionSearch.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libbusiness-paypal-api-perl/current/t/TransactionSearch.t?rev=54266&op=diff
==============================================================================
--- branches/upstream/libbusiness-paypal-api-perl/current/t/TransactionSearch.t (original)
+++ branches/upstream/libbusiness-paypal-api-perl/current/t/TransactionSearch.t Sat Mar 13 22:55:20 2010
@@ -12,23 +12,25 @@
 require 't/API.pl';
 
 my %args = do_args();
-
 my $pp = new Business::PayPal::API::TransactionSearch( %args );
 
 print STDERR <<"_TRANSID_";
 
 Please login to the PayPal Developer's site, and start a sandbox in
-the Business account you want to test.
+the Business account you want to test. This function will allow you
+to view MassPayment transactions by transaction ID's. It may fail for
+other types of transaction ID's. The GetTransactionDetails can be
+used in those cases but not for Mass Payment transactions. I know, I'm
+just the messenger.
 
 Review the Business accounts transaction history:
 
     My Account -> History (tab)
 
-Click the 'Details' link for a transaction whose status is
-'Completed'. Copy the Transaction ID for that transaction. The
-transaction id may appear like this:
-
-    Express Checkout Payment Received (ID # 2DE2563K55B16978M)
+Click the 'Details' link for a Mass Payment transaction whose status is
+'Processed'. Go to the bottom of the page and click "View Detail". It will
+give you download choices. Download it however you prefer the copy the 
+Transaction ID from the message.
 
 _TRANSID_
 
@@ -38,10 +40,11 @@
 
 die "Need a transaction id.\n" unless $transid;
 
-my $startdate = '1998-01-01T00:00:00Z';  ## before PayPal
+my $startdate = '1998-01-01T01:45:10.00Z';
 
 #$Business::PayPal::API::Debug = 1;
 my $resp = $pp->TransactionSearch( StartDate    => $startdate,
-                                   TransactionID => $transid, );
+				   TransactionID => $transid,
+				 );
+ok( scalar @$resp , "Matching Transactions Found");
 
-ok( scalar @$resp, "matching transaction(s) found" );




More information about the Pkg-perl-cvs-commits mailing list