in

dashCommerce

An ASP.NET Open Source e-Commerce Application

PayPalPro Provider Not Working

Last post 03-10-2008 12:02 PM by benmorrison. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 03-07-2008 1:21 PM

    PayPalPro Provider Not Working

    I have a PayPal sandbox account and have added my API signatures. I believe I have everything working, but at the process order portion I am getting the dreaded "Object reference not set to an instance of an object".

    I have the PayPalProPaymentProvider selected as default provider, have the API UserName, Password, and Signature set in the Provider configuration, and the is live box unticked (get the same result if this box is ticked or not)

    Entries in error log table:

    OrderController.DoExpressCheckout

     System.NullReferenceException: Object reference not set to an instance of an object.
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PayPal.PayPalService.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PayPal\PayPalService.cs:line 456
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PayPalProPaymentProvider.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PayPalProPaymentProvider.cs:line 211
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PaymentService.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PaymentService.cs:line 247
       at MettleSystems.dashCommerce.Store.OrderController.DoExpressCheckout(Order order, Boolean authorizeOnly, String userName) in T:\Jobs\Cathrines for Lamb\Store\Store\Controllers\OrderController.cs:line 454

     checkout.btnProcessOrder_Click

     System.NullReferenceException: Object reference not set to an instance of an object.
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PayPal.PayPalService.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PayPal\PayPalService.cs:line 456
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PayPalProPaymentProvider.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PayPalProPaymentProvider.cs:line 211
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PaymentService.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PaymentService.cs:line 247
       at MettleSystems.dashCommerce.Store.OrderController.DoExpressCheckout(Order order, Boolean authorizeOnly, String userName) in T:\Jobs\Cathrines for Lamb\Store\Store\Controllers\OrderController.cs:line 461
       at MettleSystems.dashCommerce.Web.checkout.btnProcessOrder_Click(Object sender, EventArgs e) in T:\Jobs\Cathrines for Lamb\Store\Web\checkout.aspx.cs:line 517

    OrderController.DoExpressCheckout

    System.NullReferenceException: Object reference not set to an instance of an object.
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PayPal.PayPalService.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PayPal\PayPalService.cs:line 456
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PayPalProPaymentProvider.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PayPalProPaymentProvider.cs:line 211
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PaymentService.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PaymentService.cs:line 247
       at MettleSystems.dashCommerce.Store.OrderController.DoExpressCheckout(Order order, Boolean authorizeOnly, String userName) in T:\Jobs\Cathrines for Lamb\Store\Store\Controllers\OrderController.cs:line 454 

     checkout.btnProcessOrder_Click

    System.NullReferenceException: Object reference not set to an instance of an object.
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PayPal.PayPalService.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PayPal\PayPalService.cs:line 456
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PayPalProPaymentProvider.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PayPalProPaymentProvider.cs:line 211
       at MettleSystems.dashCommerce.Store.Services.PaymentService.PaymentService.DoExpressCheckout(Order order, Boolean authorizeOnly) in T:\Jobs\Cathrines for Lamb\Store\Store\Services\PaymentService\PaymentService.cs:line 247
       at MettleSystems.dashCommerce.Store.OrderController.DoExpressCheckout(Order order, Boolean authorizeOnly, String userName) in T:\Jobs\Cathrines for Lamb\Store\Store\Controllers\OrderController.cs:line 461
       at MettleSystems.dashCommerce.Web.checkout.btnProcessOrder_Click(Object sender, EventArgs e) in T:\Jobs\Cathrines for Lamb\Store\Web\checkout.aspx.cs:line 517

     

    Each error is repeated twice.

     

    Anybody acutally using DC3.0 with PayPalPro in production or get it working in testing? 

  • 03-07-2008 2:45 PM In reply to

    Re: PayPalPro Provider Not Working

    Fun, isn't it?

    First, make sure you have applied this patch/fix shown here http://www.codeplex.com/dashCommerce/WorkItem/View.aspx?WorkItemId=15426. Second, make sure you have configured all tax and shipping configuration settings. I was receiving the same error and it drove me nuts until I noticed that at some point or another the "Use Shipping" option had been cleared so the routine was receiving a null for the shipping object. Grrrr....

    BTW I have managed to get Pro working to the point where the order is submitted, but the web request times out. Have not yet been able to determine if this is a problem with local code or if it is due to the fact that Paypal seems to have their Sandbox running on an old 286 with 4K of RAM... Wink

    Hope this helps,
    Matt

     

  • 03-07-2008 3:19 PM In reply to

    Re: PayPalPro Provider Not Working

    Well, I went back and checked again, but my tax provider and shipping providers are set, and it is calculating shipping properly, and the above mentioned patch has been applied. Also noticed that PayPal Express checkout does not work either - clicking on the link throws an error of:

    ErrorCode: 10002. ErrorParameters: . LongMessage: Security header is not valid. SeverityCode: Error. ShortMessage: Security error. CorrectiveAction: 10002.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: MettleSystems.dashCommerce.Store.Services.PaymentService.PayPal.PayPalServiceException: ErrorCode: 10002. ErrorParameters: . LongMessage: Security header is not valid. SeverityCode: Error. ShortMessage: Security error. CorrectiveAction: 10002.


    Source Error:

    Line 158:      string returnUrl = Utility.GetSiteRoot() + "/checkout.aspx";
    Line 159: string cancelUrl = Utility.GetSiteRoot() + "/default.aspx";
    Line 160: string url = OrderController.SetExpressCheckout(order, returnUrl, cancelUrl, false);
    Line 161: Response.Redirect(url, true);
    Line 162: }

    Source File: c:\Inetpub\wwwroot\lamb\cart.aspx.cs    Line: 160
     

     

    Getting a little frustrated here as I really have no idea where to start tracking this down.

  • 03-07-2008 3:49 PM In reply to

    Re: PayPalPro Provider Not Working

    Matt, what are you entering for a Credit Card Security Code during checkout? My "buyer"sandbox account does not provide one for the dummy card number. Do you think that might have something to do with the errors i'm seeing?

     

    Thanks,

    Ben 

  • 03-07-2008 4:15 PM In reply to

    Re: PayPalPro Provider Not Working

    Ben

    There is a list of CC numbers you can use at https://www.paypal.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm I'll include the list below since the Paypal site is so aggrivatingly slow...

    Are you getting these errors as soon as you hit the "Process Payment" button or is there a delay? If it's happening almost immediately, then it's most likely a problem with the configuration/code as opposed to a failed CC number or bad API credentials. The only other thought I have is to make sure you have the trust level for the application set correctly. As I understand it, the trust level becomes an issue when making calls to external websites.

    Good luck,
    Matt

    Test Credit Card Account Numbers

    While testing, use only the credit card numbers listed here. Other numbers produce an error.

    Expiration Date must be a valid date in the future (use the mmyy format).

    Test Credit Card Account Numbers

    Credit Card Type

    Credit Card Number

    American Express

    378282246310005

    American Express

    371449635398431

    American Express Corporate

    378734493671000

    Australian BankCard

    5610591081018250

    Diners Club

    30569309025904

    Diners Club

    38520000023237

    Discover

    6011111111111117

    Discover

    6011000990139424

    JCB

    3530111333300000

    JCB

    3566002020360505

    MasterCard

    5555555555554444

    MasterCard

    5105105105105100

    Visa

    4111111111111111

    Visa

    4012888888881881

    Visa

    4222222222222

    Note : Even though this number has a different character count than the other test numbers, it is the correct and functional number.

    Processor-specific Cards

    Dankort (PBS)

    76009244561

    Dankort (PBS)

    5019717010103742

    Switch/Solo (Paymentech)

    6331101999990016

  • 03-07-2008 4:37 PM In reply to

    Re: PayPalPro Provider Not Working

     Darnit - Forgot to mention I tried those too, found them eariler. The error is almost immeadiate, so I am pretty confident its a code / configuration error, not coming from paypal. I'll look into trust levels. Thanks for the help so far!

  • 03-07-2008 5:39 PM In reply to

    Re: PayPalPro Provider Not Working

    For what it's worth, I have tracked down all my problems (and yes, turns out that 95% of the time it was something I had misunderstood or mis-configured) by setting a breakpoint in the code then stepped through the routines keeping an eye on the immediate window. Tedious? You betcha', but it does let a body know which objects/values are carrying the null or are missing completely. Once you figure out which object is null you can concentrate on just the code and/or configurations related to that object.

    Good luck!
    Matt

  • 03-10-2008 12:02 PM In reply to

    Re: PayPalPro Provider Not Working

    Well, I got it working, but i'm not really sure what changed. I first tried a clean download and build from the site using the existing database I'm working with - same issue - OK, so its something in the database.I then made a new clean database and re-configured my shipping, tax, and payment providers, added a single item with a single attribute and it worked in both my clean install and my customized install. I then went back to my original datbase and added a 2 more items, set some cross-sells, and added a dummy attribute (none of the items in this store will require attributes, so I have implemented the fix posted here). I was then able to process transactions! So I believe I have it narrowed down to having to have an attribute set to the item. I have since gone in and deleted the attributes and the cross sells, and it is still working Confused - so I have not been able to re-produce the issue. Thanks for the ideas Matt!

Page 1 of 1 (8 items)