Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Official PayPal IPN Support Thread


Mark Evans

Recommended Posts

Hello! I have the chiwawa's version (April 23 2006) installed and i would like to upgrade to the new version... could anyone tell me the exact changes in the code or where I can find them? The installation file doesn't say anything about upgrades... should I overwrite all the ipn files?

chiwawa's version is basically a fork with a different functionality - my latest upload does not include these. If you want to change, then you would need to uninstall chiwawa's contrib and start again with the new one.

 

But be aware the two have different functionality and should actually be viewed as two different contributions.

 

Terra

Edited by Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Hi,

very great contrib but just one thing, does anyone know how can work do for the mail? I recieve ( me and the custommers) only basic emails ( no html )

 

i have Fancier Invoice and Packingslip and i don't know how the make working with this contrib..

xavier

It's very difficult to make both Fancier Invoice&Packingslip and IPN module work, I gave it up long ago. But there is another contrib 'Email Invoice' which will send out the html invoice, and this one is much easilier to fix the problem. I have this one running in my store, with the osC IPN module.

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

looks okay, just two suggestion:

Move tax to total - TRUE

Transaction type - AGGREGATE

 

As long as CURL works on your server, you don't have to worry about the encryption settings as CURL kicks in automatically if available.

 

less hassle that way. all the best, Terra

 

Hi Terra, as i'v done with Invalids (curl), I'v solved too.... i had in Paypal Sandbox a 16% spanish IVA tax, only applied in Paypal payment pages, not in my osCommerce store orders .... Without it, the total amount is the same than osCommerce order, and it changes the status to the status i'v choosed in Paypal IPN payment module config, as Paypal acknoledgment status... in this case, 11 Downloads Now Avaliable....

 

I'm triyng to put this IVA tax in IPN module, but if i add a Payment Zone, and a tax for it, and i select in Paypal IPN payment module config this Zone, the buyer cannot choose Paypal IPN Payment Method when it confirms the ShoppingCart... Will try something to solve... i dont know why...

 

Thnks all again ...

Link to comment
Share on other sites

I browsed the first 22 pages of this thread but was unable to find my answer. I have been attempting to get the IPN piece to work with paypal / oscommerce for the last few days. I have the sandbox account setup properly (I believe).

 

I am getting the following email sent to my "error account" and I am not sure what is happening. Sandbox side.

 

PAYPAL INVALID IPN PROCESS

 

$_POST:

 

payment_date=01:20:54 Jun 16, 2006 PDT

txn_type=web_accept

last_name=myname

residence_country=US

item_name=mywebsite.com

payment_gross=546.49

mc_currency=USD

[email protected]

payment_type=instant

verify_sign=AVZHcKda9e.6eWBmkVNz0S3vqk78AGHpxI.c.xvHb67KODCLpBJvIPMM

payer_status=unverified

test_ipn=1

tax=0.00

[email protected]

txn_id=9WB71178E8604912H

quantity=1

[email protected]

first_name=Eric

invoice=13

payer_id=WJ7AP3CEWK2S8

receiver_id=ZG843SBGZL2GA

item_number=

payment_status=Completed

payment_fee=16.15

mc_fee=16.15

shipping=5.00

mc_gross=546.49

custom=2

charset=windows-1252

notify_version=2.1

 

$_GET:

 

 

What is the problem?

 

I am not using SSL but have curl

Edited by glock_22
Link to comment
Share on other sites

I browsed the first 22 pages of this thread but was unable to find my answer. I have been attempting to get the IPN piece to work with paypal / oscommerce for the last few days. I have the sandbox account setup properly (I believe).

 

I am getting the following email sent to my "error account" and I am not sure what is happening. Sandbox side.

 

PAYPAL INVALID IPN PROCESS

 

$_POST:

 

payment_date=01:20:54 Jun 16, 2006 PDT

txn_type=web_accept

last_name=myname

residence_country=US

item_name=mywebsite.com

payment_gross=546.49

mc_currency=USD

[email protected]

payment_type=instant

verify_sign=AVZHcKda9e.6eWBmkVNz0S3vqk78AGHpxI.c.xvHb67KODCLpBJvIPMM

payer_status=unverified

test_ipn=1

tax=0.00

[email protected]

txn_id=9WB71178E8604912H

quantity=1

[email protected]

first_name=Eric

invoice=13

payer_id=WJ7AP3CEWK2S8

receiver_id=ZG843SBGZL2GA

item_number=

payment_status=Completed

payment_fee=16.15

mc_fee=16.15

shipping=5.00

mc_gross=546.49

custom=2

charset=windows-1252

notify_version=2.1

 

$_GET:

What is the problem?

 

I am not using SSL but have curl

 

ONLY TO TRY: Try to edit /catalog/ext/modules/payment/paypal_ipn/ipn.php and comment lines 34 and 35... check this...

 

When u finish ur testings, uncomment the lines... Cya!

Link to comment
Share on other sites

Hi Terra, as i'v done with Invalids (curl), I'v solved too.... i had in Paypal Sandbox a 16% spanish IVA tax, only applied in Paypal payment pages, not in my osCommerce store orders .... Without it, the total amount is the same than osCommerce order, and it changes the status to the status i'v choosed in Paypal IPN payment module config, as Paypal acknoledgment status... in this case, 11 Downloads Now Avaliable....

 

I'm triyng to put this IVA tax in IPN module, but if i add a Payment Zone, and a tax for it, and i select in Paypal IPN payment module config this Zone, the buyer cannot choose Paypal IPN Payment Method when it confirms the ShoppingCart... Will try something to solve... i dont know why...

 

Thnks all again ...

 

SOLVED! :-) Cya all!

Link to comment
Share on other sites

Calling all Register Globals OFF PayPal IPN users!

 

I'm just playing around with a solution and need some willing testers! Anybody prepared to backup their files and get down & dirty in the Sandbox?

 

Health Warning - I'm currently testing on a server which is Register Globals ON but the site has the Register Globals Patch v1.4 installed and is fooled into the correct behaviour via .htaccess. So it's not quite the right test environment.

 

Also - the only problem I encountered was that the status did not correctly update from "Preparing PayPal IPN" to "Pending" (that's what I have specified in my module, can differ for others). Everything else worked okay - order was stored prematurely etc. and I did not get any debug emails or "invalid" warnings.

 

Now I tracked my problem with the updating down to the $invoice variable (which was not sent, hence nothing happened) which is based on the $cart_PayPal_IPN_ID variable.

 

In /includes/modules/payment/paypal_ipn.php I found this line:

$cart_PayPal_IPN_ID = $cartID . '-' . $insert_id;

 

and changed it to this:

$_SESSION['cart_PayPal_IPN_ID'] = $cartID . '-' . $insert_id;

 

initial testing on Sandbox looks promising - the order status is being updated and it works now the same as my other IPNs without register globals off.

 

Now if any you of out there with PayPal & Register Globals issue could give this a try and see if it helps? If you want to share your info, please post on this thread, otherwise you can also PM me. I'm also not precious with this - any PHP coders who can & want to help, please get in touch!

 

all the best, Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

ONLY TO TRY: Try to edit /catalog/ext/modules/payment/paypal_ipn/ipn.php and comment lines 34 and 35... check this...

 

When u finish ur testings, uncomment the lines... Cya!

 

The testing worked when I commented out the lines. Should I leave the lines commented or was this a test for something else?

Link to comment
Share on other sites

Code for combining PayPal IPN with CCGV(trad)

 

If you have CCGV(trad) and PayPal IPN installed on your site, then you need to manually amend the IPN to make it work. Rule of thumb: whenever modifications to checkout_process.php are made, this need to be reflected in paypal_ipn.php

 

To combine the two contribs, open /includes/modules/payment/paypal_ipn.php.

 

Find this code:

tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
$order_products_id = tep_db_insert_id();

 

and below add this:

$order_total_modules->update_credit_account($i);// CCGV

 

find this code:

//------insert customer choosen option eof ----
	$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
	$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
	$total_cost += $total_products_price;

	$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
  }

and below add this:

 $order_total_modules->apply_credit();// CCGV

 

find this code:

tep_session_unregister('cart_PayPal_IPN_ID');

 

and below add this:

if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');// CCGV
$order_total_modules->clear_posts();// CCGV

 

Tested on live sites and it's all working. Enjoy! Terra

 

Keywords:

PayPal IPN CCGV CCGV(trad) Gift Vouchers & Credit Coupons

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Calling all Register Globals OFF PayPal IPN users!

Further to my post - the post above solved one problem but a bigger one remained. Mike Boden explains it very well in his post from last year: http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=681495

 

Basically, the $_SESSION['cartID'] is empty - both on regular osCom shops and with the Register Globals Patch. But how the empty variable is handled differs - the regular shop returns TRUE, the patched shop FALSE.

 

To solve this I have implemented Mike's sugested fix:

Anyway, after looking through the shopping cart class, it appears that a temporary unique ID number is never assigned when the customer's basket is restored from the database(whether it's got items or not) after they log in and go directly to checkout without adding any additional items. In fact, the cartID is only set when an item is added to or removed from the cart. So, to fix this, all I did was add the following line at the end of the restore_contents() function:

 

	 // assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
 $this->cartID = $this->generate_cart_id();

should then look like this:

	  $this->cleanup();
// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
  $this->cartID = $this->generate_cart_id();
}

 

There is also another solution from Paul (PandA.nl) which doesn't assign a cartID but mimicks the regular shop behaviour of returning an empy ID as TRUE: http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=592020

 

I'm slightly concerned though about empty cartIDs, given that it's supposed to be a hacking attempt detector, so for now I'm going with Mike's fix and it's working fine on my test shop.

 

Also for future generations - Mike's tip to use print_r for register globals bug hunting is fab - just use it and your trouble-shooting will be cut down by hours! http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=681270

 

Feedback to both my posts regarding Register Globals Patch are very welcome - please PM me if you have any thoughts/ideas. Especially welcome any ideas why the cartID is an empty variable on osCom shops!

 

all the best, Terra

Edited by Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

I think I understand why the cartID never worked in osCom in the first place ...

 

when you go from login to checkout_shipping the $cart->cartID is there but empty ...

 

... then on checkout_shipping a $cartID is created as session variable .. which is good ...

 

... but then it's defined as being the same as $cart->cartID which is empty, so the $cartID is now also empty ...

 

which means you end up with two variables $cart->cartID and $cartID, both there but empty

 

and the Register Globals Patch doesn't just check whether they are there (which would be TRUE) but also if they contain any value (which is FALSE). And if cartID returns FALSE, the IPN won't work.

 

So both Mike's fix (force it to have a cartID) and Paul's fix (force it to return TRUE for empty variable) work. Terra

Edited by Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

I installed IPN v.1.1 (according to the folder name) on a client's site to solve the problem with osC not entering an order when using PayPal.

 

After testing, he informed me that:

 

A. The cart contents are not being cleared.

- I searched this in this thread, and found that people were changing $parameters['return'] from checkout_success.php to checkout_process.php . However, the version that I am using shows the code as:

 

$parameters['return'] = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

 

B. My client has a delivery shipping module enabled that provides each order with a Delivery Day and Time. This information is left blank on the order that was tested with PayPal IPN.

 

Any help is appreciated!

Link to comment
Share on other sites

A. The cart contents are not being cleared.

Cart contents is only cleared when customers successfully return to the site - if they fail to do so, cart is not cleared, order email is not generated, stock is not updated. But you do have a copy of the order in admin.

 

B. My client has a delivery shipping module enabled that provides each order with a Delivery Day and Time. This information is left blank on the order that was tested with PayPal IPN.

paypal_ipn.php mirrors checkout_process and has its own email function - any changes you made to checkout_process.php for this contrib you will need to manually merge into paypal_ipn.php.

 

hope this helps! Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

A. The cart contents are not being cleared.

Cart contents is only cleared when customers successfully return to the site - if they fail to do so, cart is not cleared, order email is not generated, stock is not updated. But you do have a copy of the order in admin.

 

B. My client has a delivery shipping module enabled that provides each order with a Delivery Day and Time. This information is left blank on the order that was tested with PayPal IPN.

paypal_ipn.php mirrors checkout_process and has its own email function - any changes you made to checkout_process.php for this contrib you will need to manually merge into paypal_ipn.php.

 

hope this helps! Terra

 

Thanks Terra!

 

I figured problem A. was something along those lines.

 

I'm waiting to find which delivery module my client has installed, and it sounds like it should be alright after I get that information.

 

Thanks again!

Link to comment
Share on other sites

CODE RELEASE for "This invoice has already been paid" PayPal error message

 

For those who have encountered the dreaded "this invoice has already been paid" error I have a suggested solution.

 

Background:

The PayPal IPN sends a parameter "invoice" to PayPal. This parameter is equal to the order ID (1,2,3,4 etc). However, PayPal requires the invoice parameter to be unique so if you have already sent an order ID with the same number, then it will be refused. Sending the same order ID can e.g. happen if you have two osCom shops linked to one PayPal account - the PayPal account cannot distinguish between different shops / domains / databases, it just looks at the number and says "hey, that's already been paid!"

 

Solution:

If you have multiple shops linked to your PayPal account, then you get around this problem by adding a unique letter to your invoice parameter. As the invoice parameter can be any string (max length 127), it doesn't matter that it's not numeric. If you run several shops all with one PayPal account, then choose a different letter for each shop.

 

Note: this solution is for coders who have a reasonable knowledge of PHP. To alter your invoice parameter:

 

In /includes/modules/payment/paypal_ipn.php find this code:

$parameters['invoice'] = substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);

and change to this:

$parameters['invoice'] = 'K' . substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);

choose any letter but keep it to ONE letter only (or change the substr command accordingly, just make sure to keep it in sync)

 

In /ext/modules/payment/paypal/ipn.php replace all occurrences of

$_POST['invoice']

with

substr($_POST['invoice'],1)

 

The above code will add the letter to the order ID when sending to PayPal and then strip it back out again with the substr command. It's vital that you replace all occurences of the variable in ipn.php as otherwise your database update won't happen or be wrong.

 

I've tested it on my online shop and it's all working in Sandbox - I think it's a cleaner solution than just changing the order IDs to something higher as previously suggested on this thread. And it's also sustainable over time (think 10 years down the road when you have thousands of orders), plus even with just one letter you can run up to 26 different shops on one PayPal account. :D

 

Happy coding! Terra

Edited by Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

CODE RELEASE for "This invoice has already been paid" PayPal error message

 

In /includes/modules/payment/paypal_ipn.php find this code:

$parameters['invoice'] = substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);

and change to this:

$parameters['invoice'] = 'K' . substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);

choose any letter but keep it to ONE letter only (or change the substr command accordingly, just make sure to keep it in sync)

 

A much, much simpler solution to the problem - in your PayPal account, go to "Profile" - > "Payment Receiving Preferences". In there you will have the option:

Block accidental payments:

You may prevent accidental payments by blocking duplicate invoice IDs

Yes, block multiple payments per invoice ID

No, allow multiple payments per invoice ID

Select "No" and you're done! Courtesy of a friendly soul over at PayPal who liked me code but pointed out this much simpler solution. Terra :thumbsup:

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Version 1.3 is now available :thumbsup:

 

Version 1.3 is now compatible with the Register Globals Patch v1.4 - it works for both patched & standard osCom shops!

 

In addition the following changes were made:

- currency support for AUD (Australian Dollar) added

- ability to name the "continue" button on PayPal Payment Complete page in language file

- user guide now includes information on PayPal account

 

And the file package now includes integration guides for:

- QTPro 4.25

- CCGV(trad)

- oscAffiliate

 

Rule of thumb for integrating with other contributions: whenever a contribution requires changes to checkout_process.php you probably also need to amend paypal_ipn.php.

 

Updated package available at:

http://www.oscommerce.com/community/contributions,2679

 

all the best, Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

I am excited by the potential of this contribution, but I am a bit confused by what should be happening, and when. I have read through this thread, and others, but if the answer to my question has been discussed, please point me to the thread. Thank you.

 

I've installed the May 21, 2006 version of osCommerce PayPal IPN Module v1.2 For 2.2MS2.

 

Edit settings for the Paypal IPN mod:

Enable PayPal IPN Module

True

 

Move tax to total amount

True

 

Transaction Currency

Only CAD

 

Payment Zone

--none--

 

Set Preparing Order Status

Preparing [PayPal IPN]

 

Set PayPal Acknowledged Order Status

Processing

 

Gateway Server

Testing

 

Transaction Type

Aggregate

 

Enable Encrypted Web Payments

False

 

Your Private Key

Your Public Certificate

PayPals Public Certificate

Your PayPal Public Certificate ID

Working Directory

OpenSSL Location

/usr/bin/openssl

 

I've set up several accounts in PayPals sandbox. I've made all the settings changes suggested in this thread.

I'm reading osCommerce Professional Edition by David Mercer, and his text states that using this contribution the Admin order status page should update as each purchase step takes place. Starting with:

 

- Confirm order button is clicked - "Preparing [PayPal IPN]" (Comments: [unfinished / In progress PayPal IPN Order]

 

and progressing to:

 

- "Processing" (Comments: PayPal IPN Completed (followed by details of the buyer, date and time).

 

When I buy an item with any of my test buyers, the order gets added to the Admin "Customer Orders" page when i click "Continue" on the Payment (PayPal option chosen) page, but this appears in the details box of the order page "There is not Order history available".

 

I click "Confirm Order" and am taken to my personalized PayPal Page, and can complete the transaction, and the autoreturn takes me back to my Cheout_process.php page. It is not until I return back to the "Your Order Has Been Processed" page that the order details get updated with a date, green check mark, and "Preparing [PayPal IPN]" in the status box. There is nothing in the comments box. I do receive confirmation e-mails.

 

Is this functioning properly? I have tried uninstalling the contrib, and re-installing. I just want to know if there is something I am missing. Or is this the way things should be happening.

 

Thank you in advance for any support you can offer.

 

Cheers,

James

Link to comment
Share on other sites

- Confirm order button is clicked - "Preparing [PayPal IPN]" (Comments: [unfinished / In progress PayPal IPN Order]

and progressing to:

- "Processing" (Comments: PayPal IPN Completed (followed by details of the buyer, date and time).

When I buy an item with any of my test buyers, the order gets added to the Admin "Customer Orders" page when i click "Continue" on the Payment (PayPal option chosen) page, but this appears in the details box of the order page "There is not Order history available".

I click "Confirm Order" and am taken to my personalized PayPal Page, and can complete the transaction, and the autoreturn takes me back to my Cheout_process.php page. It is not until I return back to the "Your Order Has Been Processed" page that the order details get updated with a date, green check mark, and "Preparing [PayPal IPN]" in the status box. There is nothing in the comments box. I do receive confirmation e-mails.

Is this functioning properly? I have tried uninstalling the contrib, and re-installing. I just want to know if there is something I am missing. Or is this the way things should be happening.

James - that's the way it works. If a customer does not return to your site, the order is not properly completed but at least you have a copy of the order in your admin area & can process it. Enabling auto-return (checkout_process.php) will help. Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

i have just installed the latest version (osCommerce_PayPal_IPN_v1.3.zip).

 

can the oscommerce customer billing address be passed on to paypal?

 

1. my customer doesn't have a paypal account

2. he chooses to pay by credit card

3. he has to fill in the billing address again - can this be passed from his account profile while checking out?

Link to comment
Share on other sites

can the oscommerce customer billing address be passed on to paypal?

Not as it currently stands but you should be able to amend the module to your needs. Have a look in the PayPal developer guide - if you modify the module to pass the billing address as additional parameters it might work.

 

Go to:

https://www.paypal.com/IntegrationCenter/ic...umentation.html

for Website Payments Pro Integration Guide and Website Payments Standard Integration Guide - lists all available parameters.

 

PS: if you are interested in adding this function to the module feel free to update the contrib or publish code snippets on this thread.

 

all the best, Terra

Edited by Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Thanks for this creat contribution, it works fine for me!

 

There's just a small thing I would like to change/add and that is a "real" email-footer.

This is because I have some information in the email-footer of my 2 other methodes of payment and I would like to have this in the PayPal-module to.

 

I already added the Paymentinformation to the checkout-process but cannot get the email-footer to work.

 

This is what it looks at the moment:

 

if (is_object($$payment)) {
   $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
				   EMAIL_SEPARATOR . "\n";
   $payment_class = $$payment;
   $email_order .= $payment_class->title . "\n\n";
   if ($payment_class->email_footer) {
	 $email_order .= $payment_class->email_footer . "\n\n";
   }
 }

 

I've changed it to this:

 

if (is_object($$payment)) {
   $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
				   MODULE_PAYMENT_PAYPAL_IPN_TEXT_EMAIL_FOOTER . "\n" .
				   EMAIL_SEPARATOR . "\n";
   $payment_class = $$payment;
   $email_order .= $payment_class->title . "\n\n";
   if ($payment_class->email_footer) {
	 $email_order .= $payment_class->email_footer . "\n\n";
   }
 }

 

But then it shows this in my emails: MODULE_PAYMENT_PAYPAL_IPN_TEXT_EMAIL_FOOTER

I've added the MODULE_PAYMENT_PAYPAL_IPN_TEXT_EMAIL_FOOTER to the language related part of this module as I did with other payment modules and they all work fine.

 

Thanks!

Edited by i2Paq

Norman in 't Veldt

 

Moderator

osCommerce The Netherlands

Link to comment
Share on other sites

But then it shows this in my emails: MODULE_PAYMENT_PAYPAL_IPN_TEXT_EMAIL_FOOTER

I've added the MODULE_PAYMENT_PAYPAL_IPN_TEXT_EMAIL_FOOTER to the language related part of this module as I did with other payment modules and they all work fine.

I would have thought you had to amend the code in paypal_ipn.php (as it generates its own email), not checkout_process.php. Same goes for language level files (paypal_ipn.php not checkout_process.php). If you are having issues, try adding it to both code & language level for checkout_process.php and paypal_ipn.php. You've already got the code right, it's just now about copying the definition into the right file at language level. Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

can the oscommerce customer billing address be passed on to paypal?

Here's more info on how you can amend the parameters sent to PayPal:

https://www.paypal.com/cgi-bin/webscr?cmd=p...-signup-outside

 

So the answer is yes, but the code needs amending. Probably worth a thought for the next update, but can't promise when it'll be done.

 

all the best, Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

I would have thought you had to amend the code in paypal_ipn.php (as it generates its own email), not checkout_process.php. Same goes for language level files (paypal_ipn.php not checkout_process.php). If you are having issues, try adding it to both code & language level for checkout_process.php and paypal_ipn.php. You've already got the code right, it's just now about copying the definition into the right file at language level. Terra

 

Hi Terra,

 

Thansk for this contribution!

 

I think you misunderstand me, I'm adding the code to the PAYPAL_IPN.php file found in the contribution (and not the checkout_process.php), see below.

 

if (is_object($$payment)) {
   $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
				   MODULE_PAYMENT_PAYPAL_IPN_TEXT_EMAIL_FOOTER . "\n" .
				   EMAIL_SEPARATOR . "\n";
   $payment_class = $$payment;
   $email_order .= $payment_class->title . "\n\n";
   if ($payment_class->email_footer) {
	 $email_order .= $payment_class->email_footer . "\n\n";
   }
 }

 

This normaly works fine in any other payment module.

 

I think it has something to do with this:

 

if ($payment_class->email_footer) {
	 $email_order .= $payment_class->email_footer . "\n\n";

 

That needs to be changed, or am I seeing thing wrong?

 

To show some info during checkout you need to change this in the PayPal_IPN.php:

 

function confirmation() {
  global $cartID, $cart__ID, $customer_id, $languages_id, $order, $order_total_modules;

 

to:

 

function confirmation() {
return array('title' => MODULE_PAYMENT_PayPal_IPN_TEXT_DESCRIPTION);
  global $cartID, $cart_PayPal_IPN_ID, $customer_id, $languages_id, $order, $order_total_modules;

 

I've already done that and it works great. You only need to change the MODULE_PAYMENT_PayPal_IPN_TEXT_DESCRIPTION in your language related file to suit your needs.

(You could add this also in your next release :thumbsup: )

 

Cheers!

Norman in 't Veldt

 

Moderator

osCommerce The Netherlands

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