Jump to content

PayPal IPN Cancelled transaction


aris1234

Recommended Posts

I've been testing the PayPal IPN setup, and I have found that when I select attempt to cancel the transaction from the paypal screen, it gives me a message saying that my card has not been debited - press continue. I press continue, and instead of taking me back to the cubecart shop, it takes mt to the paypal homepage.

Is this normal?

I'd prefer if it took me to the shop - saying that the payment was refused/cancelled.

Oh, and I do have auto-return set on, and a return URL configured:

http://my_shop_url/shopping/confirmed.php

Link to comment
Share on other sites

thank you your questions have answered a question i have been meaning to find out the answer for and i will send you the code needed to make this work following this message...

Open => Moduals/gateways/paypal/transfure.inc.php

FIND

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

AFTER ADD

<input type='hidden' name='notify_url'value='".$GLOBALS['storeURL']."/modules/gateway/PayPal/ipn.php'/>

<input type='hidden' name='return' value='".$GLOBALS['storeURL']."/confirmed.php'/>

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

WARNING: This has NOT been fully tested by myself it is given WITHOUT waranty

Link to comment
Share on other sites

Guest mfauveau

Hi,

As you're using IPN, you should update to CubeCart 3.0.8 or apply Sir William patch (which is already included since 3.0.6 i think) that added :

} elseif(isset($_GET['tx']) && isset($_GET['st'])) {

  $basket['gateway'] = "PayPal";


in /includes/content/gateway.inc.php right before :


} elseif(!isset($basket['gateway'])){

Anyway, adding only this, sould fix the no payment gateway variable is set. But, remember that upgrading is safer :P

Hope this help.

Link to comment
Share on other sites

  • 1 month later...

Sorry to bring this up again - i'm on 3.09 now - and this issue of canelling a transaction is still presend (i've not made any code modifications). Does anyone know how to fix this so that when a paypal transaction is cancelled, it returns you to the shop?

Link to comment
Share on other sites

Guest mashurst

Bump - does anyone else have this problem? I.e. you don't complete the paypal transaction, press cancel while in paypal, but instead of taking you back to the shop, it takes you to the paypal home page.

Do your other redirect settings, work? All of my redirect settings I had to set up through paypal, telling it what pages to go to under what circumstances, and I had to edit the confirmed pages in cc to include the language that paypal requires. It was confusing, but most of the settings were in paypal>profile. I am thinking that it is a setting at paypal. You should be straight with the version of software that you are using. The only problem I have encountered is when it transfers back to the site, the cookie is messed up and it says that the user has to login, but it makes it back to my site successfully.

Link to comment
Share on other sites

I tried a full transaction for 0.01p - and it returned me to the shop, but it also said that the payment failed - though paypal confirms that the payment went through.

I followed the instructions as per the markscarts document on cubecart.org. I have set my return URL to be confirmed.php - set auto-return on, set payment data transfer on, encrypted website payments off, paypal account optional - on, contact telephone number - on.

What am I doing wrong? How can I debug this?

Thanks in advance.

Link to comment
Share on other sites

Ok, i've fixed the payment issue - but i'm still having the cancellation problem . If someone else could try this and let me know if it returns you to the shop, i'd appreciate it:

1) Buy and item and proceed to paypal purchase

2) Select payment without having a paypal account

3) On the next screen hit 'cancel' (i.e. customer has changed their mind)

4) Next screen select 'cancel checkout'

5) You see a screen which says you have not been charged - press 'continue'

6) In my case, i'm sent back to the paypal.com home page rather than the store. It should go to the store and say the payment has failed.

Link to comment
Share on other sites

  • 3 weeks later...
Guest raghwendra

Right - all working now I think - after adding aikdo's patch to transfer.inc.php it appears to be working on 3.0.10.

I would suggest that this fix go into the standard codebase.

Hello still i am having a problem with cube cart 3.0.10 everything goes right but wen it return back to my site from paypal it shows failed and in admin it shows under processing.Can u plz guide me i will be thankful to u. This is first time i m working with cubecart n this part really took a lot of time.PLz help me I need urgently :o

Link to comment
Share on other sites

Hey, im running 3.0.8 and I keep receiving this message when trying to return the the store after cancelling a transaction...

Error: No payment gateway variable is set!

Ive done aikdo's mod as listed at start of this post but still getting error..

Any ideas ?

Link to comment
Share on other sites

Just found the problem!

in transfer.inc.php where u add-in the IPN fix. The line with

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

had an extra space in between shipping' value=

it was that simple, no more "Error: No payment gateway variable is set!"

Link to comment
Share on other sites

Guest raghwendra

Right - all working now I think - after adding aikdo's patch to transfer.inc.php it appears to be working on 3.0.10.

I would suggest that this fix go into the standard codebase.

Hello still i am having a problem with cube cart 3.0.10 everything goes right but wen it return back to my site from paypal it shows failed and in admin it shows under processing.Can u plz guide me i will be thankful to u. This is first time i m working with cubecart n this part really took a lot of time.PLz help me I need urgently B)

Thanks it worked out but it is still showing processing in admin.Can u plz suggest me

Link to comment
Share on other sites

I am still getting that too. If I cancel an order, it takes me back to my website and says Order Failed (So that part is working fine). But then in Admin it says order processing.

Im guessing it puts an order in the system whenever you press "Add to Basket" instead of waiting for the order to be completed by paypal (or whatever gateway you are using).

How can this be fixed?

Link to comment
Share on other sites

Guest raghwendra

Glad you fixed it.

Hello Friend

Everthing was working fine in cubecart3.0.10 after adding the kidko's patch ,but sometime the order fails and sometime it is sucess can u plz suggest me.I m really thankful to you.Plz i need urgently. :P

Raghwendra

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...