Hi,

I'm new to drupal and has to jump right in to enable the ecommerce modules. After quite a while, I managed to get the paypal sandbox and ecommerce paypal option setup. But I have some queries before I set it to a live paypal account.

1) Even when the transaction went thru, the payment status in drupal still stood at pending. Saw this forum post that the status will not update when using the paypal sandbox. Is that what's happening? And it will not happen with the live account?

2) I did not get any emails to my paypal receiver emails even when I enabled Debug IPN. Is this normal with sandbox testing?

3) How can I found out the paypal transaction ID for each order processed?

Thank you.

Comments

gocarts’s picture

I've found the PayPal sandbox works as I'd expect the live PayPal, with emails etc.

Assuming you've successfully set up a PayPal developer sandbox via http://developer.paypal.com.

You will need to add a business account to your PayPal sandbox say foo@business.com.

Ensure that within the paypal.module (yoursite.com/?q=admin/store/settings/paypal) the following match your PayPal sandbox business account:

Within your PayPal sandbox business account you need to activate the IPN callback:

  1. Goto the sandbox (https://developer.paypal.com/cgi-bin/devscr?cmd=_sandbox-acct-session) and launch your sandbox business account
  2. Log into your sandbox business account, and navigate to Profile->Instant Payment Notification (https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_profile-ipn-notify)
  3. Enable IPN and enter the IPN callback supplied by the paypal.module (yoursite.com/?q=paypal/ipn)

All paypal generated emails can be found in your PayPal sandbox email area (https://developer.paypal.com/cgi-bin/devscr?cmd=_email-session). The ecommerce and paypal.module emails should be sent as if real payments are being made.

Hope this helps.

dsiew’s picture

Thank you for the detailed reply.

It really helped to verify that I got the setup right. I missed the receiver email part and now it seems to be working!

Now the only kink is the payment status still stayed at "Pending" in my store transaction. Is that right?

Thanks again. Saved me hours of trial and error.

gocarts’s picture

Sometimes there is a short delay in PayPal calling the IPN url. After the PayPal payment is complete, PayPal returns you to your ecommerce transaction history, which due to the delayed IPN call may show 'pending'.

Try refreshing (reloading) the transaction history page to see the latest history state.

Alternatively wait for the paypal.module to send the invoice email, the payment state should be marked 'complete', try refreshing or returning to your transaction history then.

One other thought would be to run 'yoursite/cron.php' to finalize the workflow to 'complete'.

dsiew’s picture

Really thankful to you for the detailed run thru. I think I've got it working now :)

Cheers.

arbel’s picture

Hello,

I'm trying to setup the paypal module with sandbox and I can't get it to work.

I've done everything you instructed. but when I try to place an order. I'm sent to they paypal sandbox member login page, and to to a page where I can enter the credit details and complete the transaction.

I've also encountered anther problem when try to test it on paypal live. Everything worked alright when buying a file product. but after i finished no email was sent with the download details.

I've checked and the status of the sales in drupal is completed.

what could be the problem?

Idan

ms2011’s picture

Excellent information! I should also add that if you encounter the error message, "To access the PayPal Sandbox, please log in to PayPal Developer Central." it is a PayPal Sandbox issue that is easy to fix:

You need to be logged in to Developer Central for the Sandbox to load. Go to developer.paypal.com, enter your Developer Central account login, and you might also want to check the box to keep you logged in. Then, click on the Sandbox tab, and select the "Launch Sandbox" button.

See also: http://www.paypaldev.org/topic.asp?TOPIC_ID=11497

Hope this helps!

Mike Smullin
http://www.mikesmullin.com/

brianyu’s picture

I have followed all the steps in "PayPal sandbox works fine".
but when i placed the order, the sandbox.paypal always ask me to log in.
After I log in the order information is lost.
Is there something wrong with drupal 5.2 ecommerce moudle?

hope somebody helps me.

ms2011’s picture

This is actually a PayPal HOWTO and has nothing to do with Drupal. But, I struggled with the same issue embarrassingly enough, so I will save you some time...

Assuming you already have a PayPal Developer account so that you can login to the PayPal Sandbox in the first place, you need to check the "Remember Me" box when you login, and make sure that you don't clear cookies (or that you don't start a new session if you use the anything like the CookiePie extension for Firefox). This way, when you test a transaction it will not interrupt you with a prompt to login, but will recognize the cookie it saved on your computer and let you in automatically.

Hope this helps! :)

Mike Smullin
http://www.mikesmullin.com/

brianyu’s picture

Hi Mike:
I finally got it work, your idea makes sense and thank you. Actually I changed a little bit in the "paypal.module", I finally know that it is redirect problem. Even though i changed url in the paypal setting but it did not direct to the page at the beginning. So just let paypal module direct to sandbox, that will be fine.

Cheers
Brianyu

wedge’s picture

foripepe’s picture

PayPal sandbox for testing

PayPal Receiver Email: foo@bar.com
Primary email address of the payment recipent. This is also your main paypal email address.

PayPal processing URL: https://www.sandbox.paypal.com/cgi-bin/webscr
URL of the secure payment page customers are sent to for payment processing.

PDT Token:
PayPal token to enable the processing of PDT requests

PayPal "request back" validation URL: https://www.sandbox.paypal.com/cgi-bin/webscr
URL where IPN "request back" is posted to validate the transaction.

PayPal API Signature Server Url: https://api-3t.sandbox.paypal.com/nvp

API Username: ...

API Password: ...

Signature: ...

Custom payment style:
Use a Custom Payment Style other than default which has been configured in your PayPal profile.

PS. You can create a new account here: https://developer.paypal.com/
And you can create a seller account here: https://developer.paypal.com/devscr?cmd=_create-account-session
Then go here: https://developer.paypal.com/devscr?cmd=_sandbox-acct-session
And click here and login: "Enter sandbox test site"
My account / Profile / Api access / View or remove credentials
You can find here the API Username, API Password and Signature.

PS2. It is working on my Drupal 6 e-Commerce 4 system, if I put the same values in the "Live settings" too...

planctus’s picture

Hello,
i've read this thread and many others but i'm still stucked with paypal ipn.
I'm using ecommerce 3.6 with drupal 5.15.

What happens is that everything goes fine, the paypal sandbox sends the email to the buyer telling him that he has paid, the seller receive the payment and it is marked as completed in the paypal sandox.
I check in the drupal log and i find the ipn hit (at the beginning i didn't activate it in the sandbox but i was receiving the hit anyway).
It reports the right transaction id, even if surrounded by that is non treated as html by drupal so i can't use the link it provides to the transaction...but this is a minor issue, i mean...
The transaction is not changing, instead, the payment is still pending and i'm not receiving any debug email by the paypal module.
I'm hoping it would use the site email and not the one used for the buyer that is obviously just an alias created by the sandbox, but i don't see any error in the logs and anything else.

Drupal is not sending email at all about the transaction, this is another issue i don't understand.
If if use a "custom" C.O.D. drupal sends emails correctly but if i choose paypal nothing happens.

I looked in the paypal.module and i saw the hardcoded url "http://paypal.com" so i'm not seeing how it could work with the sandbox, i tried changing that urls with the sandbox one but nothing changed.

I don't know how to debug this and how to fix neither...but that is critical and i have to find a solution.
Is anyone having the same problems?
Does anyone know the way to fix this?
Thanks,
Da.

Daisy H’s picture

I'm glad I read this post. The replies really helped me a lot. Thanks!

Daisy, Freelancer currently working on the hypothyroidism natural treatment project.

number3’s picture

I've gone through all the comments and compared them to my settings and I'm still having no luck with the sandbox.

On Drupal 5.x

PayPal Receiver Emai - has my sandbox 'business' account

PayPal processing URL: https://www.sandbox.paypal.com/cgi-bin/webscr

Successful payment URL: %order-history

PayPal IPN "request back" validation URL:
https://www.sandbox.paypal.com/cgi-bin/webscr

IPN is enabled.

I've logged in to the paypal developer site (setting the 'Log me in automatically')

I'v created a user on the site whose email address matches my 'personal' sandbox account. Purchase a product, go through the steps in the shipping cart to checkout. Then just after I click 'place your order' I get redirected to the following url:

https://www.sandbox.paypal.com/cgi-bin/webscr?business=stuadm_1244565234_biz@hotmail.com&item_name=my.domain.net+LLC+order+%23339+for+stu11&item_number=txnid_339&shipping=&no_shipping=1&return=http%3A//my.domain.net/stage/store/history/44&cancel_return=http%3A//my.domain.net/stage/frontpage&currency_code=USD&notify_url=http%3A%2F%2Fmy.domain.net%2Fstage%2Fpaypal%2Fipn&amount=0.01

I'm prompted to login, so i put my 'personal' sandbox email account and password. Then I see the 'My Account Overview' page, with a old transaction in the 'recent activity' table.

I flip back to the paypal developer site and under the 'sandbox' heading I click on 'test email' and I don't see any new entries in that table.

I don't know what else I have to do or what I'm not doing. All help is greatly appreciated.

EDIT*
A complete mistake on my part. I've gotten it to work now. I was missing the cmd=_xclick part in my url.

Zorga Lina’s picture

I am using e-commerce 5.x-3.6. As I understand it, the IPN message is the trigger that will set your transaction's status to 'completed', otherwise, when using the Sandbox, it seems it will stay at 'pending'. I check the Logs, to see if an IPN was sent, and if the transaction id matches that of my item. I'm using the IPN generation feature of the PayPal sandbox to send these, and set the values for item id, name, transaction id, etc.
In the paypal.module, line 233-234, it seems there's a typo, the IPN contains name-value pairs and the transaction id name is 'txn_id', not 'txnid_' as in paypal.module. At least that's true of the Sandbox IPN! Hopefully the 'real' one matches the code in paypal.module.. 2/13/2010

riddhi_uppal’s picture

I am facing two issues:-

1. After doing successfull payment on paypal, and returned back to site, the Receipt status is not updated, while workflow is updated to "Completed".

2. I user did payment on paypal but not returned back on site, then How the status will be updated? will IPN help in this?

Kindly provide replies asap.