Jump to content
Sign in to follow this  
devosc

PayPal_Shopping_Cart_IPN

Recommended Posts

Hi there..

 

I tried to change to this:

 

  $sql_data_array = array('sendto' => $GLOBALS['sendto'],
                         'billto' => $GLOBALS['billto'],

 

but then the sendto and billto was set to 0.

 

Now I found that the initial claim from me, that number 6 was used, and my customer was number 5, is partially wrong, as I found out later, that customer number 5 has address ID number 6.

 

Then my initial problem is still valid: when I use PayPal for payment, emails are not sent (not even debug mails). When I use other payment, the mail works OK.

 

Rune

Share this post


Link to post
Share on other sites

Hi,

 

Everything is working ok. I have accepted real payments through my site when using different PayPal accounts that are mine and processing my friend's orders.

 

The problem is that now that I'm getting real customers I'm getting orders to show up in admin>Customers>Orders but I'm not getting money in my paypal account or transaction details in the Admin>PayPal IPN.

 

What does this mean? Does this mean that the customer quit half way through the checkout process? Or does this mean that they joined PayPal (instead of using the instant transaction instead) are waiting for the bank account to be verified by PayPal?

 

Thanks, sorry if this question has been beaten to death.

Share this post


Link to post
Share on other sites
Hello,

 

I just installed PayPal_Shopping_Cart_IPN, everything went fine. Thanks a lot for this great contribution. I have a few questions.

 

1) How do I test paypal? When I tried to buy something, I get redirected to paypal and paypal asks me to login. If I login with my real user password , it will charge my actual credit card. so how do I test this IPN module?

 

2) Is there anyway, I can make the user to buy the products without having to create a paypal account?

 

3) Is there anyway we can hide the whole paypal thing from user and just make the user experience like they just enter the credit card and buy the products?

 

Thanks

Ben

Yes you must set up your PayPal account to business and then you go to your my account>profile>Selling preferences>Website Payment Preferences andCustom Payment Pages.

 

That being said I can't get mine to work exactly right.

Share this post


Link to post
Share on other sites
payment_status

Completed

If referring to an initial purchase, this means the payment has been completed and the funds are successfully in your account balance. If referring to a reversal (i.e. txn_type= reversal ), then it means the reversal has been completed and funds have been removed from your account and returned to the customer

Pending

The payment is pending; see the? pending_reason? variable below for more information. Note: You will receive another Instant Payment Notification when the payment becomes? Completed,?  Failed,? or? Denied

Failed

The payment has failed. This will only happen if the payment was made from your customer's bank account

Denied

You, the merchant, denied the payment. This will only happen if the payment was previously pending due to one of the? pending reasons? below

Refunded

You, the merchant, refunded the payment.

Cancelled

This means a reversal has been canceled (e.g. you, the merchant, won a dispute with the customer and the funds for the transaction that was reversed have been returned to you)

pending_reason

echeck

The payment is pending because it was made by an eCheck, which has not yet cleared

multi-currency

You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment

intl

The payment is pending because you, the merchant, hold a non-U.S. account and do not have a withdrawal method. You must manually accept or deny this payment from your Account Overview

verify

The payment is pending because you, the merchant, are not yet Verified. You must verify your account before you can accept this payment

address

The payment is pending because your customer did not include a Confirmed shipping address and you, the merchant, have your Payment Receiving Preferences set such that you want to manually accept or deny each of these payments. To change your preference, go to the Preferences section of your Profile

upgrade

The payment is pending because it was made via credit card and you, the merchant, must upgrade your account to Business or Premier status in order to receive the funds

unilateral

The payment is pending because it was made to an email address that is not yet Registered or Confirmed

other

The payment is pending for a reason other than those listed above. For more information, contact customer service

rising up from page one!!!

 

Ok I have the payment_status in my administrator but no payment_reason. Where do I go see this payment_reason???

Share this post


Link to post
Share on other sites

Hi Matt,

 

If PayPal didn't send you a receipt of payment suggests that those customers did abandon their order.

 

Have you also enabled in your PayPal profile the option to allow customers to pay via credit card (i.e. no membership required)?

 

From the above there is not a 'payment_reason' field but rather a 'pending_reason' field. The 'pending_reason' field exists when the 'payment_status' field is of 'Pending' status.

 

The above quote is an extract from the PayPal IPN v1.5 Manual which in v1.6 has slighty changed in regards to 'Refunds'.

 

In response to your question about whether you would receive a payment or indeed an IPN when the customer also signs up with PayPal (for their first time) and may require bank verification (it's been a while since I wen through those steps!) I suspect that if a payment was accepted by PayPal, then firstly you would receive the usual PayPal receipt email and the IPN would give a 'Pending' payment status with a 'unilateral' 'pending_reason'.


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites

I do have my PayPal account to be set up so that it can accept credit cards and you don't have to sign up for PayPal. I checked yes here:

 

PayPal Account Optional

 

When this feature is turned on, your customers will go through an optimized checkout experience. This feature is available for Buy Now, Donations, and Shopping Cart buttons, but not for Subscription buttons. Learn More

 

 

PayPal Account Optional:

On

Off

 

I don't have this turned on though:

 

Instant Payment Notification Preferences

 

 

Instant Payment Notification (IPN)

Instant Payment Notification integrates PayPal payment notification and authentication with your website's back-end operations. Check this box to activate Instant Payment Notification, and enter the URL at which you will receive the payment notifications below. This URL should be a URL which you own and at which you receive HTML posts.

 

 

 

Note: Before activating Instant Payment Notification, please read the instructions to ensure that you can support the notification and authentication system. 

 

Does this have to be turned on in the PayPal profile page? I don't have it on but I have gotten IPNs from test orders from friends.

 

 

 

They might just be waiting for the small payment to be in there bank account.

 

I just wish I got real customer payment so I knew things are working correctly. All I have gotten for orders are these pending payments. Thanks for the support!

Share this post


Link to post
Share on other sites

No, the IPN field doesn't need to be on in your PayPal profile.

 

You said:

All I have gotten for orders are these pending payments
What was the 'pending_reason' for these orders?

"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites
No, the IPN field doesn't need to be on in your PayPal profile.

 

You said:

All I have gotten for orders are these pending payments
What was the 'pending_reason' for these orders?

Where do I check the pending reason at? In Administrator? I had somebody else install this so maybe its the older contrib (I hope not!). Thanks.

Share this post


Link to post
Share on other sites

Hi:

 

First of all, thank you very much for this payment module... this is really helpful for my store!!

 

However, I have a problem... I've double-checked my settings and code but I still get this error:

 

1054 - Unknown column 'o.paypal_ipn_id' in 'on clause'

select p.payment_status from paypal p left join orders o on p.paypal_ipn_id = o.paypal_ipn_id where o.orders_id ='2'

 

What can I do??

 

Thanks in advance!

 

PS: Using PayPal_Shopping_Cart_IPN_v2.2

Edited by Tomas

Share this post


Link to post
Share on other sites

add this and it will be working ..

 

ALTER TABLE orders ADD paypal_ipn_id INT( 11 ) DEFAULT '0' NOT NULL;

 

 

ALTER TABLE orders_products_attributes ADD products_options_id INT( 11 ) DEFAULT '0' NOT NULL;

 

 

ALTER TABLE orders_products_attributes ADD products_options_values_id INT( 11 ) DEFAULT '0' NOT NULL;

 

 

--> in SQl Databse ...

Share this post


Link to post
Share on other sites
Hi, when you checkout and get to the PayPal page, open up phpMyAdmin and look at that order in the 'orders_session_info' table, verify that the sendto and billto values correspond to the values associated to that customer in the address_book table.

Recently someone had a similar issue and the above seemed to be the cause, which was not resolved (due to time...), might seem strange but for some reason those session values where not being stored (they're used during the checkout sequence), what you could try instead of '$sendto' and '$billto' is $GLOBALS['sendto'] and $GLOBALS['billto'] in paypal/checkout_process.php.

whenever I test it everything works fine. The values are set in the 'orders_session_info' and the order process e-mail is sent with all the customer information. Whenever someone other than myself places an order, it does not work.

Share this post


Link to post
Share on other sites

I'm sorry if this has already been covered, but I'm wondering how to use both the paypal ipn contribution and the option type feature contribution. When using the paypal contribution, the data entered by the user into the new product attribute fields does not write to the database. It looks like the cause is the difference between the checkout_progress.php file in the two contributions.

 

My problem is that since the files are soooo different, I don't know where to begin to try to merge them. Is anyone else using both contributions? If so, can you point me in the right direction?

 

THANKS!

Share this post


Link to post
Share on other sites

Got the issue of PayPal_Shopping_Cart_IPN and Option Type Feature contributions worked out. I didn't realize that checkout_process was kind of broken into two files for paypal (checkout_process and checkout_update).

 

Once I figured that out, I was able to add the code from the Option Type Feature's checkout_process. There are only about two lines of code to change, so it is really easy. :D

Share this post


Link to post
Share on other sites

Looks like I spoke too soon.

 

Although the data from Option Type Feature is now being entered into the database, now each new order is submitted in the database over the last order!

 

If I use the old Paypal IPN files (checkout_progress and checkout_update) the orders are submitted correctly, but the data from Option Type Feature isn't there.

 

So, back to my original question...has anyone successfully merged these two contributions, as it looks like my attempt failed.

 

HELP!!

Share this post


Link to post
Share on other sites
add this and it will be working ..

 

ALTER TABLE orders ADD paypal_ipn_id INT( 11 ) DEFAULT '0' NOT NULL;

 

 

ALTER TABLE orders_products_attributes ADD products_options_id INT( 11 ) DEFAULT '0' NOT NULL;

 

 

ALTER TABLE orders_products_attributes ADD products_options_values_id INT( 11 ) DEFAULT '0' NOT NULL;

 

 

--> in SQl Databse ...

Thank you very much!!!! Works like a charm now!!!! THANKS!!!! :D

Share this post


Link to post
Share on other sites
Then my initial problem is still valid: when I use PayPal for payment, emails are not sent (not even debug mails). When I use other payment, the mail works OK.

Hmmmfff... Works now. Go figure.

 

Rune

Share this post


Link to post
Share on other sites

Well, I am having all kinds of problems now. When I go to the payment module area in Admin, I am receiving the following error:

 

Warning: main(/home/name/public_html/catalog/includes/languages/english/modules/payment/admin_orders.php): failed to open stream: No such file or directory in /home/name/public_html/catalog/admin/modules.php on line 128

 

The correct path shoud be /home/name/public_html/catalog/includes/languages/english/modules/payment/paypal/admin_orders.php...I can't figure out how the path got off.

 

The error prevents me from installing or removing any payment modules.

 

I can't figure out why this is happening. I have uploaded a second catalog that is a snapshot of my code from 7 days ago, but the error is still there. That leads me to believe that the problem might not be in the code, but perhaps the database??

 

Where in the database are the modules stored? Perhaps if I uninstall the paypal_shopping_cart_ipn from there until I figure out what is going on??

Share this post


Link to post
Share on other sites

Disregard last message. Had duplicate files loaded in wrong directory. :wacko:

 

Am still having problem merging paypal ipn and option type feature, though.

Share this post


Link to post
Share on other sites

Dani,

 

The file location that is specified in the error is incorrect, i.e. it should not be in 'includes/languages/english/........'.

 

Where possible eveything is stored in 'includes/modules/payment/paypal' (nothing to do with languages).

 

This error should not effect the admin->modules->payment section since that section is maintained by 'admin/modules.php', whereas 'admin/orders.php' is the file that calls 'includes/modules/payment/paypal/admin_orders.php'

 

You should still be able to uninstall the 'PayPal' payment module via the admin, this will remove all references to this module's config settings in the db table 'configurations', all references begin with 'MODULE_PAYMENT_PAYPAL'.

 

Note that uninstalling the above payment module via the admin will not remove the othe db tables created when installing this contribution, i.e. orders_session_info, paypal*

 

But those latter tables will not hinder anything, for example you could just copy over the original osCommerce PayPal module to includes/modules/payment/ (overwriting the contribution version) and then install it in the admin, hence back to square one (note that you if you are intending to back up any existing '.php' files in 'includes/modules/payment' then you must either remove them from that directory or rename their file extension to something like '.phpX').

 

You shouldn't really had so much trouble installing the Option Type contrib since the code is pratically the same, ok the original osC checkout_process.php was split into 2 files, but you figured that out.

 

Because of the error you're having above I would suggest that you go back through the install notes and carefully verify the changes (and locations).


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites

Gregory,

 

Thanks for the help! I did go back and realize that I had uploaded a few files in the wrong directory, so the path error is now gone.

 

The problem I am having with the merge between your paypal ipn and the option type code is that when a new order is placed it replaces the last order. The user's data from the option type contribution is there, but only one order will store. So, I've tried placing about 5 test orders, but the only one that shows up in the database is the last order placed.

 

I must have made a merge error. From what I am describing, do you have a guess as to what I should look for?

 

Thanks!!!

Share this post


Link to post
Share on other sites

Can you explain more about your 'test' transactions, unless you complete the PayPal order or use the IPN Test Panel to simulate the IPN then clicking back and recommencing the checkout sequence will update the last order since this potential order number is registered as a session var, and it is only when the IPN for that order has been received that the session var is removed (and the shopping cart is emptied), this allows for abandoned carts to be recommenced even at a later date.

 

Are you using v2.2, use the IPN Test Panel.

 

Post the code you need to change in checkout_process.php here.


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites

G'day,

 

i'm using v.2.2. it works great so far but is still could not try a test ... the test page is empty in admin/paypal.php?action=test

 

My settings are:

Enable PayPal Module

Do you want to accept PayPal payments?

 

True

False

 

E-Mail Address

The e-mail address to use for the PayPal service

 

 

Business ID

Email address or account ID of the payment recipient

 

 

Transaction Currency

The currency to use for credit card transactions

 

Selected Currency

Only EUR

 

Payment Zone

If a zone is selected, only enable this payment method for that zone.

--none--

 

Set Pending Notification Status

Set the Pending Notification status of orders made with this payment module to this value

StandardDownloadIn BearbeitungOffenPending PayPal Notification

 

Set Order Status

Set the status of orders made with this payment module to this value

StandardDownloadIn BearbeitungOffenPending PayPal NotificationVersendet

 

Synchronize Invoice

Do you want to specify the order number as the PayPal invoice number?

 

False

 

Sort order of display.

Sort order of display. Lowest is displayed first.

 

 

Background Color

Select the background color of PayPal's payment pages.

 

White

 

Store logo

The image file name for PayPal to display (leave empty if your store does not have SSL)

 

 

PayPal Page Style Name

The name of the page style you have configured in your PayPal Account

 

 

Include a note with payment

Choose whether your customer should be prompted to include a note or not?

 

 

No

 

Shopping Cart Method

What type of shopping cart do you want to use?

 

Aggregate

 

 

Enable PayPal Shipping Address

Allow the customer to choose their own PayPal shipping address?

 

 

No

 

Email Notifications

The email notification level

(1 is recommended)

 

 

1

 

 

Test Mode

Set test mode (Launch Test Page)

 

 

On

 

Cart Test

Set cart test mode to verify the transaction amounts

 

 

On

 

Notification Address

The e-mail address to send (level 1) notifications to

 

 

Return URL behavior

How should the customer be sent back from PayPal to the specified URL?

0=No IPN, 1=GET, 2=POST

 

 

1

 

i also chnaged paypal.com/... to paypal.de

 

I have no idea why i can not make a test in the adminpanel under test ?

Share this post


Link to post
Share on other sites
Can you explain more about your 'test' transactions, unless you complete the PayPal order or use the IPN Test Panel to simulate the IPN then clicking back and recommencing the checkout sequence will update the last order since this potential order number is registered as a session var, and it is only when the IPN for that order has been received that the session var is removed (and the shopping cart is emptied), this allows for abandoned carts to be recommenced even at a later date.

 

Thanks! I can't believe I've been fussing with this for HOURS! I see now what you mean, and that appears to be the problem. I wasn't thinking about the order number being a session variable, so I thought as long I was acting as a "new" customer, the order would be new as well.

 

Here are the chages I made to merge the paypal_shopping_cart_ipn and option type feature contributions if anyone else needs it:

 

In checkout_update around line 90 change

$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];

 

to

 

$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . tep_decode_specialchars($order->products[$i]['attributes'][$j]['value']);

 

In checkout_progress around line 144 change

'products_options_values' => $attributes_values['products_options_values_name'],
'options_values_price' => $attributes_values['options_values_price'],

 

to

 

'products_options_values' => $order->products[$i]['attributes'][$j]['value'],
'options_values_price' => $attributes_values['options_values_price'],

 

 

This works for me for paypal_shopping_cart_ipn v2.1 and option type feature v1.6.

 

Thanks!!

Share this post


Link to post
Share on other sites

Dani, can you confirm the version you're using, you said v2.1 whereas the current version that registers the session var is v2.2?

 

Taz, a little strange, you might need to go into admin/paypal and get it to print out the path for catalog/includes/modules/payment/paypal/admin_test.php, since the script for the IPN Test Panel resides in the catalog side but is being called from the admin side.

Also dont set the Cart Test to On since you're using Euro's, unless you go into paypal/ipn.php and change:

$currencies->currencies[$currency]['symbol_left'].$this->key['mc_gross'] != $order->info['total']

To:

$currencies->currencies[$currency]['symbol_left'].$this->key['mc_gross'].$currencies->currencies[$currency]['symbol_right'] != $order->info['total']

 

But note this still might not work (above change is suggestion to also append the currency symbol to the right) and I haven't had time to look into the numerical formatting.

 

For now Set the Notification Level to 2, you now only get 1 email so you might as well have all the test results.

 

Try:

https://www.paypal.com/de/cgi-bin/webscr

 

Instead, since I suspect that PayPal would redirect you to this location anyway and in doing so they would put all the var's in the URL which would allow the customer to change them such as the price.

 

This is the 'only' bit in admin/paypal.php regarding the IPN Test Panel, so see what happens when you say: echo 'DIR_FS_CATALOG_MODULES'; or change include to require and see if php complains.

  if ($action == 'test') {
   include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin_test.php');
   exit;
 }


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites
Dani, can you confirm the version you're using, you said v2.1 whereas the current version that registers the session var is v2.2?

 

Yes, I am using v2.2 (sorry). Yesterday was such a blur that I couldn't remember if I made the changes from 2.1 to 2.2, but now that I think about it, you are correct.

 

Thanks!!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×