Corrected errors int RecurrintPayments.t and TransactionSearch.t
This commit is contained in:
		
							parent
							
								
									04de06bbf5
								
							
						
					
					
						commit
						d92e94b703
					
				
					 2 changed files with 27 additions and 24 deletions
				
			
		|  | @ -4,7 +4,7 @@ if( ! $ENV{WPP_TEST} || ! -f $ENV{WPP_TEST} ) { | |||
|     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,16 +16,16 @@ my %args = do_args(); | |||
| 
 | ||||
| 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}; | ||||
| 
 | ||||
|  | @ -70,14 +70,14 @@ die "Need a PayerID.\n" unless $payerid; | |||
| 
 | ||||
| 
 | ||||
| ## 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 @@ my %profile = $pp->CreateRecurringPaymentsProfile | |||
|     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; | ||||
| 
 | ||||
| like( $details{Ack}, qr/Success/ , "details ok" ); | ||||
| 
 | ||||
|  |  | |||
|  | @ -12,23 +12,25 @@ use_ok( 'Business::PayPal::API::TransactionSearch' ); | |||
| require 't/API.pl'; | ||||
| 
 | ||||
| my %args = do_args(); | ||||
| my $resp =''; | ||||
| 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 @@ my $transid = <STDIN>; chomp $transid; | |||
| 
 | ||||
| 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" ); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Danny Hembree
						Danny Hembree