Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal Express Checkout IPN Payment Module


AlexStudio

Recommended Posts

Ah, in that case, don't listen to me. Another thing you might have already thought about, but make sure you're calculating with floats and not doubles. PHP defaults to doubles by default.

 

Adding IPN support is the next milestone on the WPP module, so I'm over here seeing how development is going. Should hopefully be easy to implement since it's all based off the same codebase.

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Link to comment
Share on other sites

  • Replies 405
  • Created
  • Last Reply

Top Posters In This Topic

Actually the IPN support is no big deal. The API part you developed is much more difficult. Just add 'notify_url' parameter in the API request, and modify the ipn.php to work with WPP. PayPal will 'post' IPN parameters to that url, and the ipn.php must post back every thing received. If the post back matched, PayPal will repond 'Verified', otherwise 'Invalid'.

Edited by AlexStudio

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

The first line of the code is running the update_status() function, which check if EC IPN module is enabled in admin. When the result is true, it sets $paypal_ec->enabled to true, otherwise sets it to false.

 

The second line is the same as below code:

if ($paypal_ec->enabled) $ec_enabled = 1;
else $ec_enabled = 0;

Could you think of a reason why mine is setting the status to '0' or spaces. I am in a test environment (so no ssl) and its when I am pressing the express checkout big yellow on my shopping cart! All my testing for the paypal checkout payment screen has worked fine. I stepped through the code line by line and it is definitely occuring when it does the status_update.

 

Any thoughts that could help would be great - I am so close to getting it all hanging together and I think your contribution is excellent.

Link to comment
Share on other sites

Leanne, there are 3 files in this contribution which have that piece of code you asked. In which file you got $ec_enabled set to 0 or null? And what do you want to do with the code? (What is your problem?)

Edited by AlexStudio

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Leanne, there are 3 files in this contribution which have that piece of code you asked. In which file you got $ec_enabled set to 0 or null? And what do you want to do with the code? (What is your problem?)

Ok, what I was trying to do is fully test the express checkout button that I moved from your ec_shipping page to my shopping_cart page. I did as you said in your instructions but I hadn't gone back and fully checked it until last night. Then when I pressed the button, my checkout_shipping.php page displayed. I was assuming I would go straight to paypal to logon as a customer - actually hoping ... cause I haven't actually seen this in action and I assumed that is what it would do. So when it didn't, I carefully (and very painfully) checked for whereever the code transferred over to the checkout shipping page. I found it first in the ec_shipping.php code and commented it out to see it I could then get it to go further. But I still got the shipping page. So I kept going tracking every line (I used the old print_r('I am here') code). I then found pretty much the same code in checkout_payment.php. That's when I figured I had better try and find out why this update_status wasn't doing what I though it should be doing.

 

I am assuming I must have set something up wrongly????

Link to comment
Share on other sites

I remember you moved the big yellow button to the shopping_cart.php page. When you hit the button, it should take you to ec_shipping.php. I think it is in ec_shipping.php starting from line 42 to line 51 where it redirects you to checkout_shipping.php

 

Please make sure you enabled PayPal EC module, and set zone to NONE.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

I remember you moved the big yellow button to the shopping_cart.php page. When you hit the button, it should take you to ec_shipping.php. I think it is in ec_shipping.php starting from line 42 to line 51 where it redirects you to checkout_shipping.php

 

Please make sure you enabled PayPal EC module, and set zone to NONE.

 

Ok thats bizaar! All that work chasing the silly code last night and now I switched my zone to none and now it seems to work??? So what does the zone do and why does it need to be none? I do thank you but can't say I understand.

Link to comment
Share on other sites

When you set a module with a zone, that module will be enabled in that zone only. It is a stock osCommerce feature.

 

Since you're using the easiest way to move the big yellow button to the shopping cart page, you don't have any checking to decide to display the button or not. So you must set zone to NONE.

Edited by AlexStudio

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

When you set a module with a zone, that module will be enabled in that zone only. It is a stock osCommerce feature.

 

Since you're using the easiest way to move the big yellow button to the shopping cart page, you don't have any checking to decide to display the button or not. So you must set zone to NONE.

 

So will that imact the way the other part works - the checkout payment???? Is there a way I can use the zone or is that getting too messy?

Link to comment
Share on other sites

Basically it works, but you can't disable EC IPN in admin, because the button still shows up in shopping_cart.php.

 

If you want to use the zone setting, you need to add the $ec_enabled checking code into shopping_cart.php prior to show the button. This will also allow you to disable EC IPN in admin.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

hi Alex,

 

I've followed the whole topic and insert the Pay Pal contri.

 

My question, my site is Dutch with 3 other languages German, English, Spainish and the problem is that the Spanish customers wants to pay but can get through.

They get a time out when they are in there Pay Pal site, so the can't pay.

I also get no message from this action in my admin.

When I make a payment with my own private account it is working right everything is just as it must be.

I also conversation with an employee from Pay Pal (Dutch) see said there is nothing wrong with my Pay Pal account.

 

Do you know what is going wrong?

Link to comment
Share on other sites

Did you try yourself checking out in Spainish? There is no language code for Spainish, so 'US' is assigned, and the PayPal page should be in English.

Edited by AlexStudio

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

I tried, but my own acount is in Dutch, so the Pay Pal site where I have to pay comes in dutch.

I can't check in Spanish

When I make a invoice on the Dutch Pay Pal site in the Dutch language the can pay in there Spanish site.

 

So you think there is something wrong with the SPanish language in combination with the Spanish Pay Pal site?

Link to comment
Share on other sites

hi,

 

i have installed osCommerce 2.2-MS2 and paypal_express_checkout_IPN_v0.4.1. i used ec_diagnostics.php to verify my installation and everthing seems to be ok but when i try to checkout the cart i get the error message:

 

 

We're sorry, but we were unable to process your payment.
An error occured when we tried to process your payment. Please try again or select an alternate payment method.

 

and this email :

 

 

In function: pre_confirmation_check()
Response from PayPal:

[security] = N/A
[RequesterCredentials]
   [0]
       [Credentials]
           [0]
               [username] = N/A
               [Password] = N/A
               [subject] = N/A

[setExpressCheckoutResponse]
   [0]
       [Timestamp] = 2007-03-23T22:36:51Z
       [Ack] = Success
       [CorrelationID] = ec5f89a7d1cb
       [Version] = 2.000000
       [build] = 1.0006
       [Token] = EC-9KB01113XC296714F



From this request: (WARNING!!) DO NOT expose your API Username/Password to the public!!

[?xml version="1.0" encoding="utf-8"?]
[soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"]
[soap:Header]
[RequesterCredentials xmlns="urn:ebay:api:PayPalAPI"]
[Credentials xmlns="urn:ebay:apis:eBLBaseComponents"]
[username]removed_for_privacy[/username]
[Password]removed_for_privacy[/Password]
[subject] [/subject]
[/Credentials]
[/RequesterCredentials]
[/soap:Header]
[soap:Body]
[setExpressCheckoutReq xmlns="urn:ebay:api:PayPalAPI"]
[setExpressCheckoutRequest]
[Version xmlns="urn:ebay:apis:eBLBaseComponents"]2.0[/Version]
[setExpressCheckoutRequestDetails xmlns="urn:ebay:apis:eBLBaseComponents"]
[OrderTotal currencyID="EUR"]66.5[/OrderTotal]
[ReturnURL]https://www.my_domain.com/express_checkout.php[/ReturnURL]
[CancelURL]https://www.my_domain.com/ec_shipping.php?address_error=0[/CancelURL]
[ReqConfirmShipping]0[/ReqConfirmShipping]
[NoShipping]1[/NoShipping]
[AddressOverride]0[/AddressOverride]
[LocaleCode]US[/LocaleCode]
[PageStyle]PayPal[/PageStyle]
[Address]
[Name]max mutzke[/Name]
[street1]blahfoolee[/street1]
[street2][/street2]
[CityName]Lee[/CityName] 
[stateOrProvince][/stateOrProvince]
[PostalCode]foo[/PostalCode]
[Country]DE[/Country]
[Phone]123 567[/Phone]
[/Address]
[buyerEmail][email protected][/buyerEmail]
[/setExpressCheckoutRequestDetails]
[/setExpressCheckoutRequest] 
[/setExpressCheckoutReq]
[/soap:Body]
[/soap:Envelope]

 

any ideas where i can start my search or how i can fix this problem? :-)

 

greets M0ses

Link to comment
Share on other sites

Which server were you testing with? Sandbox or Live? The dumping looks no problem at all, did you reach the PayPal pages?

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Which server were you testing with? Sandbox or Live? The dumping looks no problem at all, did you reach the PayPal pages?

 

I`m testing with sandbox, when i try a

 

curl www.sandbox.paypal.com

 

i get a "302 document moved", so i think ip connectivity is ok

Link to comment
Share on other sites

Hi Alex,

 

I've decided to look at the zone problem a little later as I was not quite sure what you meant by diabling the ec ipn in admin. Anyway - nearly got it all hanging together how I want it except one little cosmetic thing. I was wondering if you knew the answer. I wanted to know if there is any way I can tell once I am in express_checkout.php where I have come from because I want to display a slightly different page if I have come straight from ec_shipping (meaning I have gone thru the express button to paypal and back to shipping and now to express checkout). Every field I check for differences between when I come from ec_shipping and when I come back from paypal direct seems to show the same things. As my php coding is not strong I thought I might have been missing something simple?

 

Any help is always appreciated!

Link to comment
Share on other sites

After you came back from PayPal page, the big PAY button should be there near the bottom of express_checkout.php page.

 

You can try setting Skip Confirmation Page? to yes, the express_checkout.php won't show up before visiting PayPal pages.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

  • 3 weeks later...

Hi Alex,

 

I installed this contibution, and ran the diagnostics code, and got his error.

 

Does cURL work? (Simple HTTP test) No

Failed to connect to 66.39.31.76: Permission denied (Error No. 7)

 

 

Is this permission error at the sandbox server or is it a cURL issue?

 

Thanks

Link to comment
Share on other sites

The simple http test is only trying to open http://www.oscommerce.com via curl connection. You got the permission denied error probably because your host dosen't allow out going connections. Please ask for the permission with your host.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Not only that line in the configure.php, the code which is checking for the XML files exist or not also calls to the constant DIR_FS_CATALOG. (defined in catalog/includes/configure.php line 35)

 

Usually they were setup through the osCommerce installation. So it seems to me that you have some other problem with your host settings, probably your host has register global turned off. In that case, you need to refer to register global patches first.

 

Hi,

 

I am running into the same problem as this other person. I read over everything and so far it appears I have done everything needed.

 

1. Files uploaded

2. configure.php set up.

My DIR_FS_CATALOG looks like this: define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));

3. register global is set up

 

The error appears to be after public_html as the / is missing.

 

The error message:

 

PayPal Express Checkout IPN module installation incomplete! There should be XML files located in /home/brenons/public_htmlincludes/ec_xml/ !

 

Any help with this is appreciated.

Sincerely

Mike

Link to comment
Share on other sites

2. configure.php set up.

My DIR_FS_CATALOG looks like this: define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));

 

The error appears to be after public_html as the / is missing.

 

The error message:

 

PayPal Express Checkout IPN module installation incomplete! There should be XML files located in /home/brenons/public_htmlincludes/ec_xml/ !

Try this:

define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/');

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Try this:

define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/');

 

Perfect... that fixed the problem however I ran into another. When I select to pay with another method such as 2checkout it keeps taking me to paypal checkout,

 

Any one run into this problem? I am going to go over the install but if anyone has a suggestion on this that would be great.

 

thanks again.

Sincerely

Mike

Link to comment
Share on other sites

  • 2 weeks later...
The simple http test is only trying to open http://www.oscommerce.com via curl connection. You got the permission denied error probably because your host dosen't allow out going connections. Please ask for the permission with your host.

 

Hi ALex,

 

I spoke to my host about granting permission to connect to both the sandbox and live servers, and they required the ip address and port number. Pinging the domain name gives me the ip, would that work , but I still do'nt know the port #. Can you help me with this information.

 

thanks

 

Sameer

Link to comment
Share on other sites

Sameer, there are 2 files in this contribution require permission for outbound connection, catalog/includes/modules/payment/paypal_ec.php (the module) and catalog/ext/modules/payment/paypal_ec/ipn.php (the ipn part).

 

For the module, the live server address is api.paypal.com (sandbox address is api.sandbox.paypal.com) the port is 443 for standard SSL connection.

 

For the ipn part, the live server address is www.paypal.com (sandbox address is www.sandbox.paypal.com) and it's port 443 or port 80 depends on your server configuration.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...