PayPalPDTHandler.aspx not redirecting

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
12/28/2012 7:29:53 AM
Gravatar
Total Posts 18439

Re: PayPalPDTHandler.aspx not redirecting

Are you seeing any clues in the mojoPortal log under Administration > System Log?

Note that Site Membership Pro does not currently support recurring payments, so if there is something configured in your paypal account to do something with recurring payments Site Membership Pro is not currently built to handle that if PayPal is sending some kind of different information back. It currnetly handles only single payments and it can send reminders to renew membership.

Basically the way the PDT and IPN handler works is that the order is serialized into the mp_PayPalLog table and the log guid is passed to PayPal. Then when paypal posts back it includes the log guid so we can lookup the log row which also has data about which provider (ie feature) should process the transaction and then it loads that provider and passes in the data. The PDT Handler must also be defined in a file in the /Setup/ProviderConfig/paypalpdthandlers folder, there should be a file in ther corresponding to Site Membership Pro, that file is what it uses to load the provider listed in the log table.

12/28/2012 7:58:53 AM
Gravatar
Total Posts 13

Re: PayPalPDTHandler.aspx not redirecting

My system log has never shown anything other than entries like this:

2012-12-28 07:14:38,084 INFO 2012-12-28 07:14:38,115 INFO 2012-12-28 07:14:38,115 INFO 2012-12-28 07:14:38,225 INFO 2012-12-28 07:14:43,475 INFO 2012-12-28 07:14:55,538 INFO 2012-12-28 07:14:55,632 INFO 2012-12-28 07:14:55,679 INFO 2012-12-28 07:14:55,679 INFO 2012-12-28 07:14:55,679 INFO 2012-12-28 07:14:55,694 INFO 2012-12-28 07:14:55,694 INFO 2012-12-28 07:14:55,694 INFO 2012-12-28 07:14:55,710 INFO 2012-12-28 07:14:55,710 INFO 2012-12-28 07:14:55,725 INFO 2012-12-28 07:14:55,725 INFO 2012-12-28 07:14:55,725 INFO 2012-12-28 07:14:55,960 INFO 2012-12-28 07:14:56,069 INFO 2012-12-28 07:14:59,288 INFO 2012-12-28 07:15:08,304 INFO 2012-12-28 07:15:08,304 INFO 2012-12-28 07:15:58,837

I am not working with recurring payments with Site Membership Pro.

The table mp_PayPalLog has entries for every single transaction that I attempted, so the PDTHandler is successfully writing to the database.  

There are 3 config files located in the '/Setup/ProviderConfig/paypalpdthandlers' folder: 000_placeholder.config, sts-memberpro-paypalpdthandler.config, and webstorepaypalpdthandler.config.

mp_PayPalLog shows that Provider used was the WebStorePayPalHandler.

Here is the entry for the SerializedObject column:

<?xml version="1.0" encoding="utf-16"?>

<Cart>

   <CartGuid>16f85999-7536-4c5e-bf77-b041717e3750</CartGuid>

  <StoreGuid>db83de6e-6ac6-43a7-b62f-32328e7f23d5</StoreGuid>

  <ClerkGuid>00000000-0000-0000-0000-000000000000</ClerkGuid>

  <CartOffers>

    <CartOffer>

      <ItemGuid>908a79d0-d167-44a6-8838-8b404e5a1e3c</ItemGuid>

      <CartGuid>16f85999-7536-4c5e-bf77-b041717e3750</CartGuid>

      <OfferGuid>cd6a4364-c78f-4a0c-a2ae-5f1d7a1c5423</OfferGuid>

      <TaxClassGuid>6d9569a6-614a-4da9-bb41-e2abd7144742</TaxClassGuid>

      <OfferPrice>0.0100</OfferPrice>

      <Tax>0.0000</Tax>

      <AddedToCart>2012-12-28T01:18:28.323</AddedToCart>

      <Quantity>1</Quantity>

      <IsDonation>false</IsDonation>

    </CartOffer>

  </CartOffers>

  <SerializedCartOffers> &lt;ArrayOfAnyType&gt; &lt;anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d2p1:type="q1:string" xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance"&gt; &amp;lt;CartOffer&amp;gt; &amp;lt;ItemGuid&amp;gt;908a79d0-d167-44a6-8838-8b404e5a1e3c&amp;lt;/ItemGuid&amp;gt; &amp;lt;CartGuid&amp;gt;16f85999-7536-4c5e-bf77-b041717e3750&amp;lt;/CartGuid&amp;gt; &amp;lt;OfferGuid&amp;gt;cd6a4364-c78f-4a0c-a2ae-5f1d7a1c5423&amp;lt;/OfferGuid&amp;gt; &amp;lt;TaxClassGuid&amp;gt;6d9569a6-614a-4da9-bb41-e2abd7144742&amp;lt;/TaxClassGuid&amp;gt; &amp;lt;OfferPrice&amp;gt;0.0100&amp;lt;/OfferPrice&amp;gt; &amp;lt;Tax&amp;gt;0.0000&amp;lt;/Tax&amp;gt; &amp;lt;AddedToCart&amp;gt;2012-12-28T01:18:28.323&amp;lt;/AddedToCart&amp;gt; &amp;lt;Quantity&amp;gt;1&amp;lt;/Quantity&amp;gt; &amp;lt;IsDonation&amp;gt;false&amp;lt;/IsDonation&amp;gt; &amp;lt;/CartOffer&amp;gt;&lt;/anyType&gt; &lt;/ArrayOfAnyType&gt;</SerializedCartOffers> 

  <UserGuid>8389160e-1edb-4dbd-a39e-57774582acf3</UserGuid>

  <SubTotal>0.0100</SubTotal>

  <ShippingTotal>0.0000</ShippingTotal>

  <TaxTotal>0.0000</TaxTotal>

  <Discount>0.0000</Discount>

  <OrderTotal>0.0100</OrderTotal>

  <Created>2012-12-28T01:18:28.247</Created> 

  <CreatedFromIP>68.98.29.78</CreatedFromIP>

  <LastModified>2012-12-28T01:18:28.48</LastModified>

  <LastUserActivity>2012-12-28T01:18:28.247</LastUserActivity>

  <DiscountCodesCsv /> <CustomData />

</Cart>

 

So, it looks like the issue does not reside with the PDTHandler, but with the '/WebStore/OrderDetail.aspx' page, since I assume that is where the PDT handler is supposed to redirect.  Right?

12/28/2012 8:10:58 AM
Gravatar
Total Posts 18439

Re: PayPalPDTHandler.aspx not redirecting

Rows are created in the mp_PayPal log before sending the user to PayPal so those rows don't mean pdt handler is posting correctly, though when it does post if it finds the row it will update the rawresponse field with the post details. There should be rows in there with the site membership provider, rows with webstore provider are created in WebStore.

What version of mojoPortal are you using? It looks like your mojoPortal log4net log is truncating, but the latest version of mojoPortal has a newer version of log4net so I thought that problem should not happen anymore though it can be solved by configuration, possibly configuring it to log to the database may help as well.

12/28/2012 8:37:47 AM
Gravatar
Total Posts 13

Re: PayPalPDTHandler.aspx not redirecting

Using your configuration link, I solved the log4net issue.  However, in the table 'mp_PayPalLog', the rawresponse column is blank for all transactions.  If there should be rows using the site membership provider, then it looks as if those two attempts never posted anything to the database.

 

As stated before, here are my installation details:

MojoPortal Version: 2.3.9.3 MSSQL
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
ASP.NET Info: Running in Partial Trust
Server Time Zone: Central Standard Time
Server Local Time: (GMT -6) 12/28/2012 7:07:19 AM
Greenwich Mean Time: (GMT/UTC)12/28/2012 1:07:19 PM

12/28/2012 9:05:05 AM
Gravatar
Total Posts 18439

Re: PayPalPDTHandler.aspx not redirecting

Now that you log is working do you see any clues when you try a transaction?

From your previous post: &cm=ef258316-77f8-4f91-b4c3-e1155563d71 corresponds to the RowGuid in the mp_PayPalLog table, it should lookup that row find that it has the site membership provider and call that provider to handle the request, that provider will redirect to /smp/OrderDetail.aspx upon a successful order received and processed.

Is WebStore working for you with PayPal? Do PayPal transactions in WebStore work correctly?

Have you configured the required settings in user.config for pdt?

You should also have IPN configured so that paypal can post the order even if the user does not return to your site via pdt

12/28/2012 9:15:47 AM
Gravatar
Total Posts 13

Re: PayPalPDTHandler.aspx not redirecting

Before I try another sample transaction, I noticed something interesting.  I saw some info messages appearing in the system log.  I decided to look at the tasks queue and I found this:

Task Queue History

  Task Name Queued Started Last Update Completed Progress
     WebTaskManager 12/28/2012 7:28 AM 12/28/2012 7:28 AM 12/28/2012 8:11 AM 1/1/0001 12:00 AM 50%
     WebTaskManager 12/28/2012 7:23 AM 12/28/2012 7:23 AM 12/28/2012 7:28 AM 12/28/2012 7:28 AM 100%
     Site Membership Management Task 12/28/2012 4:40 AM 12/28/2012 8:06 AM 12/28/2012 8:07 AM 1/1/0001 12:00 AM 50%

There are two running tasks that are only 50% complete.  One of these is for Site Membership Management.  1. What task is this? and 2. Can I safely delete/abandon it before running a test membership purchase?

12/28/2012 9:23:17 AM
Gravatar
Total Posts 13

Re: PayPalPDTHandler.aspx not redirecting

All my PayPal settings are correct.  I touched the web.config (there are no paypal settings in user.config), and then looked at the System Log.  Does this look normal?

2012-12-28 09:19:38,046 INFO mojoPortal.Web.Global - Application Started. 
2012-12-28 09:19:38,061 ERROR mojoPortal.Web.Global - Application_Start Could not register VirtualPathProvider, this error is expected when running in Medium trust or lower 
System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
   at mojoPortal.Web.Global.RegisterVirtualPathProvider()
   at mojoPortal.Web.Global.Application_Start(Object sender, EventArgs e)
The action that failed was:
InheritanceDemand
The type of the first permission that failed was:
System.Web.AspNetHostingPermission
The Zone of the assembly that failed was:
MyComputer
2012-12-28 09:19:39,483 INFO mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task 
2012-12-28 09:19:39,483 INFO mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread 

 

12/28/2012 9:51:25 AM
Gravatar
Total Posts 13

Re: PayPalPDTHandler.aspx not redirecting

Okay, so here are the results of the System Log after running another test transaction:

System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 23.63.210.234:443
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at mojoPortal.Business.WebHelpers.PaymentGateway.PayPalStandardPaymentGateway.ValidateIPN()
   at mojoPortal.Web.Services.PayPalIPNHandler.Verify(String ipnForm)
   at mojoPortal.Web.Services.PayPalIPNHandler.HandleRequest()
2012-12-28 09:47:13,362 ERROR mojoPortal.Web.Services.PayPalPDTHandler - System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 23.63.210.234:443
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at mojoPortal.Business.WebHelpers.PaymentGateway.PayPalStandardPaymentGateway.ValidatePDT()
   at mojoPortal.Web.Services.PayPalPDTHandler.Verify(String transactionId)
   at mojoPortal.Web.Services.PayPalPDTHandler.HandleRequest() 

 

It's not a problem on my end.  Looks like PayPal server isn't responding.

 

12/28/2012 12:02:45 PM
Gravatar
Total Posts 18439

Re: PayPalPDTHandler.aspx not redirecting

Is there anything about your network environment that would prevent your web server from making a server side web request to paypal?

Maybe there is a firewall preventing outbound requests from the server side code. I doubt if the problem is on the paypal side.

Once paypal posts to your pdt or ipn the server must then post back to paypal to verify and get the details of the transaction and that is where it is failing.

12/28/2012 12:15:55 PM
Gravatar
Total Posts 18439

Re: PayPalPDTHandler.aspx not redirecting

You may need to check with your web host because the medium trust settings may be preventing server side web requests.

For example in Web.config we can force medium trust by adding this:

<trust level="Medium" originUrl=".*" />

which we use for testing medium trust but it requires that originUrl setting .* in order for server side web requests to work.

Note that we can force more restrictive trust from web.config but we cannot make it less restrictive from there, ie you can't change it to full trust from web.config if it is set for medium trust in machine.config.

So your host would need to add the orginUrl setting in machine.config to allow outbound server side web requests, or you may need to migrate to less restrictive hosting.

12/30/2012 12:46:30 AM
Gravatar
Total Posts 13

Re: PayPalPDTHandler.aspx not redirecting

Joe,
After a lot of arguing with the supposed "technical" support for my web hosting, they finally provided a solution.  I am sharing here just in case anyone else experiences the same issue.
Use the following in web.config to establish a connection to the proxy server:

<system.net>

  <defaultProxy>

    <proxy usesystemdefault = "False" bypassonlocal="False" proxyaddress="http://myproxyaddress:port" />

  </defaultProxy>

</system.net>

The bold, italic proxy address needs to be set to the appropriate proxy server address for your hosting company.  Also, Visual Studio (2010 is the version I am using) complains if the False boolean starts with a lower case letter.
 

You must sign in to post in the forums. This thread is closed to new posts.