PayPal Error: Value was either too large or too small for an Int32

When calling the GetProfile method, you may see the error "Value was either too large or too small for an Int32". This is caused by an unexpected value returned by PayPal.

Date Entered: 06/01/2011    Last Updated: 06/01/2011

When you create a profile and do not explicitly set TotalCycles, PayPal incorrectly assigns very large values. This causes the error listed above. A very simple fix for this error is as follows:

When you create a new profile, set the TotalCycles with the following code:

recurring.BillingDetails.TotalCycles = "0";

Where 'recurring' is an instance of the RecurringPayments component.


We appreciate your feedback.  If you have any questions, comments, or suggestions about this entry please contact our support team at kb@nsoftware.com.