{"id":1346,"date":"2011-03-18T15:49:59","date_gmt":"2011-03-18T22:49:59","guid":{"rendered":"http:\/\/www.digitalaccesspass.com\/doc\/?p=1346"},"modified":"2014-04-06T01:48:10","modified_gmt":"2014-04-06T08:48:10","slug":"dap-generated-paypal-button-faqtroubleshooting","status":"publish","type":"post","link":"http:\/\/digitalaccesspass.com\/doc\/dap-generated-paypal-button-faqtroubleshooting\/","title":{"rendered":"DAP-Generated Paypal Button &#8211; FAQ\/Troubleshooting"},"content":{"rendered":"<p><strong>NOTE<\/strong>: If you wish to set up your <a href=\"http:\/\/wickedcoolplugins.com\/the-plugins\/ipn-redirect\/\">Paypal IPN URL to be broadcast to multiple sites<\/a>, you may also consider our <a href=\"http:\/\/wickedcoolplugins.com\/the-plugins\/ipn-redirect\/\">IPN Redirect plugin<\/a> from WickedCoolPlugins.com<br \/>\n_____________________________________________<\/p>\n<h3><strong><\/strong><strong>Question 1A<\/strong>: How can I share one Paypal account with multiple DAP and non-DAP sites?<\/h3>\n<p>-OR-<\/p>\n<p><strong>Question 1B:<\/strong> If I use &#8220;DAP&#8221; generated buy-buttons, and I have to set up the &#8220;auto-return URL&#8221; in Paypal, which is limited to just one URL. How can I use that if I&#8217;m selling from multiple web sites and using the same Paypal account?<\/p>\n<p><strong>Answer: <\/strong>You can share<strong> same Paypal account <\/strong>between multiple DAP and other non-DAP sites if you use DAP-generated Paypal buttons or Paypal-hosted buttons or a combination of both.<\/p>\n<p><strong>If you use DAP generated Paypal buttons:<\/strong><\/p>\n<p>DAP sends button-level <em>return<\/em> value to Paypal.\u00a0 By default, DAP sets the button level return to point to a DAP script on the site where you generated the button ( http:\/\/yoursite.com\/dap\/dap-thankyou.php ). Upon payment, the users are returned to that dap-thankyou.php.\u00a0\u00a0 And then the dap-thankyou.php script creates the membership account , auto-logs in users to their membership area and redirects users upon login to whatever you have in DAP product-level or DAP global-level login redirect. So the users automatically land at the<strong> &#8216;<\/strong>DAP product-level or DAP global-level login redirect<strong>&#8216; <\/strong>upon successful payment.<\/p>\n<p>If you want the users to be redirected to a different URL upon login, then you can add a redirect tag to dap generated button code:<\/p>\n<p style=\"padding-left: 30px;\">&lt;input type=&#8221;hidden&#8221; name=&#8221;redirect&#8221; value=&#8221;http:\/\/yoursite.com\/thankyou&#8221; \/&gt;<\/p>\n<p>The auto-return needs to be set and pointed to some URL &#8211; any URL &#8211; otherwise Paypal will not be able to automatically return users back to your website upon payment for non-paypal hosted buttons. DAP does not care what you set it to &#8211; but if you do set it, then make sure that all the Paypal buttons you use (DAP-generated or Paypal-hosted) have their own auto-return value.<\/p>\n<p>If you use a DAP-generated Paypal button, you do not have to worry about the auto-return URL, because DAP will set it and send it to Paypal at a button level. But if you use Paypal-hosted buttons, then make sure you set the button level &#8216;return&#8217; value.<\/p>\n<p>If you do not set the button level return value, then the Paypal profile -&gt; global level auto-return will get used. So if your global auto-return (under Paypal -&gt; Profile -&gt; Website Payment Preferences) is set to some URL on Site B and say you use a Paypal button to sell something on SITE A but that paypal button does not have a return value set, then upon purchase, the users will get returned to the URL on SITE B and that is probably not what you want.\u00a0 so make sure you set the button level return value for paypal-hosted buttons.<\/p>\n<h3><strong>Question 2<\/strong>:<\/h3>\n<p>I added DAP hosted buttons and did a test purchase.\u00a0 After purchase the user was redirected to the login page and but the user was NOT automatically logged in. The login page states: SUCCESS! Thank you for completing the purchase. Please check your email for further details. Have I setup something incorrect?<\/p>\n<p><strong>Answer:<\/strong><\/p>\n<p>What do you see in DAP Payments\/Coupons -&gt; Orders page for this transaction ?<\/p>\n<p>Hit the search button in the orders page and it will bring up all orders.<br \/>\nIs the payment status &#8220;Pending&#8221; or is it &#8220;Complete&#8221; ?<\/p>\n<p>If it&#8217;s pending, it could be why the user is not getting logged in. Click on the transaction Id hyperlink for that order and it will take you to the transactions page&#8230; here you can see what Paypal sent in the transaction blob.<\/p>\n<p>See if Paypal sent Payment Status = pending.\u00a0 It yes, it can happen if the buyer didnot confirm their email in paypal.<\/p>\n<p>But if payment status is complete, then do this.<\/p>\n<p>Set DAP setup -&gt; config -&gt; log level to 5<br \/>\nThen go to dap system -&gt; logs and Empty log content<\/p>\n<p>Then rerun the paypal purchase and send us the log snippet.<\/p>\n<h3><strong>Question 3:\u00a0 Users are not getting auto-logged in. <\/strong><\/h3>\n<p><strong>I see these errors in the dap log.<br \/>\n<\/strong><\/p>\n<p><strong>&gt;&gt; 2011-03-29 10:54:02:dap-thankyou: after fopen<br \/>\n2011-03-29 10:54:02:dap-thankyou.php: paypal communication failed &lt;&lt;<\/strong><\/p>\n<p><strong>Answer: <\/strong>In dap-thankyou.php script, dap uses fopen to connect to paypal to retrieve purchase details and to auto-login users.<\/p>\n<p>If it is failing, then there is probably a fopen connection issue between your host and paypal.<\/p>\n<p>Try this:<\/p>\n<p>In dap config -&gt; payment processing -&gt; <strong>Set <\/strong>&#8220;Use CURL to connect to Paypal&#8221; to <strong>FOPEN<\/strong>.<\/p>\n<p>If you set it to <strong>fopen<\/strong>, the the IPN script (dap-paypal.php) will use FOPEN to talk to Paypal also. Otherwise it will use <strong>CURL<\/strong>.<\/p>\n<p>If the dap-paypal.php (backend ipn script) works, the user account will get created successfully in DAP but for auto-login to work, the front-end script (dap-thankyou.php) needs to work. But for front-end dap-thankyou.php script to work, FOPEN needs to work on your server\/host.<\/p>\n<p>So to test if FOPEN is working,\u00a0 do this:<\/p>\n<p>Set DAP setup -&gt; config -&gt; log level to 5<br \/>\nThen go to dap system -&gt; logs and Empty log content<\/p>\n<p>Make the backend IPN script also use FOPEN (by setting dap config -&gt; &#8220;Use CURL to connect to Paypal&#8221; to FOPEN)<\/p>\n<p>Now rerun purchase and see if you notice dap-paypal.php lines in there with fopen communication error in DAP Logs.<\/p>\n<p>If yes, then the problem is that your host is preventing fopen communication with paypal.<br \/>\nIf no, then open a ticket with us and we will look into it.<\/p>\n<h3><strong>Question 4:\u00a0 How do I replace the DAP generated PP button with my own image? <\/strong><\/h3>\n<p>Look for this line in the button code:<\/p>\n<p>&lt;input type=&#8221;image&#8221; src=&#8221;http:\/\/www.paypal.com\/en_US\/i\/btn\/btn_buynow_LG.gif&#8221; border=&#8221;0&#8243; name=&#8221;submit&#8221; alt=&#8221;Make payments with PayPal &#8211; its fast, free and secure!&#8221; \/&gt;<\/p>\n<p>Replace the &#8220;src&#8221; tag with the path to your own image file.<\/p>\n<p>Ex &#8211; &lt;input type=&#8221;image&#8221; src=&#8221;\/dap\/images\/myimage,gif&#8221; border=&#8221;0&#8243; name=&#8221;submit&#8221; alt=&#8221;Make payments with PayPal &#8211; its fast, free and secure!&#8221; \/&gt;<\/p>\n<h3><strong>Question 5: How to redirect Paypal buyers to a custom URL after purchase?<\/strong><\/h3>\n<p><strong>Answer<\/strong>:<\/p>\n<p>If you&#8217;re using buy button form code, then you can add a redirect tag to dap generated buy button code:<\/p>\n<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;redirect&#8221; value=&#8221;http:\/\/yoursite.com\/thankyou&#8221; \/&gt;<\/p>\n<p>If you are using a buy button link, then add the text below at the end of your link.<\/p>\n<p><strong>&amp;redirect=http:\/\/yoursite.com\/thankyou\/<\/strong><\/p>\n<p>Like this:<\/p>\n<p>http:\/\/YourSite.com\/dap\/paypalCoupon.php?cmd=_xclick-subscriptions&amp;item_number=10&amp;currency_code=USD<strong>&amp;redirect=http:\/\/yoursite.com\/thankyou\/<\/strong><\/p>\n<p>Or<\/p>\n<p>http:\/\/YourSite.com\/dap\/paypalCoupon.php?cmd=_xclick-subscriptions&amp;item_number=10&amp;currency_code=USD<strong>&amp;redirect=\/thankyou\/<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>NOTE: If you wish to set up your Paypal IPN URL to be broadcast to multiple sites, you may also consider our IPN Redirect plugin from WickedCoolPlugins.com _____________________________________________ Question 1A: How can I share one Paypal account with multiple DAP and non-DAP sites? -OR- Question 1B: If I use &#8220;DAP&#8221; generated buy-buttons, and I have [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[60,20,24,30,37,9],"tags":[],"_links":{"self":[{"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/posts\/1346"}],"collection":[{"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/comments?post=1346"}],"version-history":[{"count":16,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/posts\/1346\/revisions"}],"predecessor-version":[{"id":4563,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/posts\/1346\/revisions\/4563"}],"wp:attachment":[{"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/media?parent=1346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/categories?post=1346"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/tags?post=1346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}