Jump to content

Paypal IPN failing on notify.php


vokf

Recommended Posts

Hi,

1st post :-)

I'm having problems getting PayPal to return back to the cart following a successful payment.

I currently run another store which uses PDShop Pro (and ASP based cart), and have just tested that so see if that works (returns the user to the cart - it does)

The URL that the browser gets returned to is:

http://inspectourgadgets.co.uk/confirmed.p...urn+to+Merchant

Which reports the error:

"You must login to view this page."

IPN on my PayPal account is switched on. However, as I run 2 stores from the same PayPal account, I need to override a the notify and return variables:

On my CubeCart store (for some reason, PayPal doesn't return), taken from transfer.inc.php:

<input type='hidden' name='notify_url' value='http://inspectourgadgets.co.uk/modules/gateway/PayPal/ipn.php'/>

<input type='hidden' name='return' value='http://inspectourgadgets.co.uk/confirmed.php'/>

On my working PDShop Pro site:

<input type="hidden" name="notify_url" value="http://www.precious-world.co.uk/shop/gateway_ppipn.asp">

<input type="hidden" name="return" value="http://www.precious-world.co.uk/shop/checkout5.asp">

Other than this problem, things are going well! After playing with ASP and PHP based carts, this is about as easy as PDShop Pro to setup, but appears to have a better comunity feel :-)

If this is a PayPal problem, can anyone recommend a Payment provider that has zero setup and allows customisation of the payment screen

I'm currently using the page style feature to select different payment screen styles:

<input type='hidden' name='page_style' value='my_paypal_style_name'>

Thanks for any help,

Jason

Link to comment
Share on other sites

Ok :-)

I've spent a lil bit of time on this, and the following may help some people:

My setup is that I have a single PalPal account, which I need to accept payments for an existing store, and my new CubeCart store - both use IPN.

I suggest following the pinned tutorial, and if you're still having problems, try and decypher the following:

I've made some changes to the transfer.inc.php to select the payment screen style (my logo and colour scheme for each store). I also set the no_shipping variable to 1, so PayPal doesn't ask for the shipping address (CC has this already)

The problem mentioned on my prev post, was the CC was not returning correctly to the cart.

From what I could see, the "return" variable was unset unless the Standard payment method was set. As most people use IPN, this was not set for some reason (I think this should be set in your PalPal config, but in my case I needed to override it for each store).

Anyway, I now have a working PayPal IPN. I've included my transfer.inc.php file below, perhaps some people will find it usefull.

Jason

function fixedVars(){

global $module, $basket, $ccUserData, $cart_order_id, $config, $GLOBALS;

$amount = sprintf("%.2f",$basket['subTotal']+$basket['tax']);

$hiddenVars = "<input type='hidden' name='cmd' value='_xclick' />

<input type='hidden' name='business' value='".$module['email']."' />

<input type='hidden' name='page_style' value='inspect'>

<input type='hidden' name='no_shipping' value='1'>

<input type='hidden' name='item_name' value='Cart Order No: ".$cart_order_id."' />

<input type='hidden' name='item_number' value='".$cart_order_id."' />

<input type='hidden' name='amount' value='".$amount."' />

<input type='hidden' name='notify_url'value='http://inspectourgadgets.co.uk/modules/gateway/PayPal/ipn.php'/>

<input type='hidden' name='return' value='".$GLOBALS['storeURL']."/confirmed.php?act=conf&oid=".base64_encode($cart_order_id)."'/>

<input type='hidden' name='shipping' value='".$basket['shipCost']."' />

<input type='hidden' name='invoice' value='".$cart_order_id."' />

<input type='hidden' name='first_name' value='".$ccUserData[0]['firstName']."' />

<input type='hidden' name='last_name' value='".$ccUserData[0]['lastName']."' />

<input type='hidden' name='currency_code' value='".$config['defaultCurrency']."' />

<input type='hidden' name='address1' value='".$ccUserData[0]['add_1']."' />

<input type='hidden' name='address2' value='".$ccUserData[0]['add_2']."' />

<input type='hidden' name='city' value='".$ccUserData[0]['town']."' />

<input type='hidden' name='state' value='".$ccUserData[0]['county']."' />

<input type='hidden' name='zip' value='".$ccUserData[0]['postcode']."' />

<input type='hidden' name='day_phone_a' value='".$ccUserData[0]['phone']."' />

<input type='hidden' name='add' value='1' />

<input type='hidden' name='rm' value='2' />

<input type='hidden' name='no_note' value='1' />

<input type='hidden' name='upload' value='1' />";

if($module['method']=="std"){

$hiddenVars .="<input type='hidden' name='return' value='".$GLOBALS['storeURL']."/confirmed.php?act=conf&oid=".base64_encode($cart_order_id)."' />\r\n

<input type='hidden' name='cancel_return' value='".$GLOBALS['storeURL']."/confirmed.php?act=conf&f=1&oid=".base64_encode($cart_order_id)."' />";

}

return $hiddenVars;

}

Link to comment
Share on other sites

Guest theboylard

Ok :-)

skip to the important bit...

I also set the no_shipping variable to 1, so PayPal doesn't ask for the shipping address (CC has this already) xx

And the bit that I wanted was here in red

function fixedVars(){

global $module, $basket, $ccUserData, $cart_order_id, $config, $GLOBALS;

$amount = sprintf("%.2f",$basket['subTotal']+$basket['tax']);

$hiddenVars = "<input type='hidden' name='cmd' value='_xclick' />

<input type='hidden' name='business' value='".$module['email']."' />

<input type='hidden' name='page_style' value='inspect'>

<input type='hidden' name='no_shipping' value='1'>

<input type='hidden' name='item_name' value='Cart Order No: ".$cart_order_id."' />

<input type='hidden' name='item_number' value='".$cart_order_id."' />

Thanks a mil for this this Jason, I hope you'll be spending some time here on the forums?!

Having been hit in the past by fraud, I'm very keen to remove opportunities for people to change stories bewteen my site and the payment processors.

Don't suppose you've looked at Nochex APC and integration with cubecart have you?

Not checked it myself recently so it may be there?

Link to comment
Share on other sites

Glad I could help, I could see a bunch of posts regarding paypal, and as I've used it successfully on my other store, it wasn't too much to get to the bottom of my problems - but as I'm still a CC newbie, I didn't know if there was a problem with the latest release.

Have you tried the custom payment pages? I found a fairly cheap service that allows upload of logos for customising the checkout page on paypal.

https://securelogohosting.com/ (no connection, but appears to work very well) $5USD for 2 logos for 2 years.

Coupled with suitable background colour, this does help with some of the "what the ..." reaction some people get when the store suddenly sends them to another site for payment.

My other annoyance is PalPal asking for the county (even though CC knows this) on the payment page - I may be able to look into this later.

Unfortunately, I'm still working on ASP based projects so won't have much time to get to grips with the PHP stuff for a while yet....

I've not looked at the NoChex APC, I do have an account somewhere, but have never used it due to their strange limits and UK Only sales. (not that I do much overseas stuff)

Paypal has been fine for my other store for the last year, and with PalPal Pro functionality in CC, it should be a good cheap system.

Right, time for bed :)

Jason

Edited by vokf
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...