Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal Express Checkout IPN Payment Module


AlexStudio

Recommended Posts

PayPal Express Checkout IPN Payment Module v0.1 beta

for osCommerce 2.2 MS2 Update 060817 or later

 

2007/01/11 04:36am GMT+08:00 by alexstudio

 

Description

Based on PayPal Pro Direct Payments & Express Checkout v0.8.2 by dynamoeffects

and osCommerce PayPal IPN Module v2.0 For 2.2MS2 by Terra (Monika in Germany)

 

This PayPal Express Checkout Payment Module combined the PayPal SOAP API and IPN feature into one, designed for store owners who have a Premier or Business account at PayPal, including following features:

  • Express Checkout API is an SOAP API provided by PayPal. By introducing this API, transactions no longer pass through user's internet browsers or agents. All connections are established directly between your host and PayPal servers, there for a much higher security level is provided.
  • Payers must sign-up with PayPal. Customer without PayPal account must create one before paying. (required for PayPal Express Checkout API)
  • Pass through customers' personal info to PayPal so they don't need to fill-in account sign-up form at PayPal, all filled up automatically.
  • Review order payment in store (instead of PayPal site) before transaction, there for no need to create pre-mature order records in database.
  • Update order status immediately if the payment transaction result is completed, no need to wait for IPN responses.
  • Built in IPN feature for updating order status automatically once if pending payments (eCheck/Bank Transfer) are cleared, and payments refunded as well.
  • Capable of declining unverified PayPal accounts. (Optional - setup through admin)
  • Capable of complete dumping transaction/IPN detail in debug email, including sent out requests and recieved responses, and optional dumping email for successful transactions as well. (This is for PayPal 3005 error without triggering debug emails)
  • Customers can select verified shipping address from PayPal file, and alter the shipping address set in checkout shipping page. (Express Checkout API built-in feature - This makes seller protection fully eligible possible)
  • Showing per item details in both osCommerce and PayPal receipt, including tax, shipping, low order fee (shown as handling in PayPal receipt).
  • Supported currencies including USD, AUD, CAD, CHF, DKK, EUR, GBP, HKD, JPY, NOK, NZD, SEK, SGD.

Currently I'm working on the install guide. The package will be uploaded to the contributions very soon.

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

  • Replies 405
  • Created
  • Last Reply

Top Posters In This Topic

[Contribution] PayPal Express Checkout IPN v0.1 beta

 

Please report any bugs/problems/issues in this thread.

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

How it works

 

PayPal Express Checkout payment module first send out a token request to PayPal when the customer reaches the checkout confirmation page. The order total and the shipping address are included in this initial request. PayPal will respond to this request with an unique token string. This is done through SOAP API, directly between your host and PayPal's server. There for the customer has no chance to intercept the transmission. This payment module picks up the token string, and when the customer hits the confirm button, it sends the customer to PayPal along with this token string, for the customer to authorize this payment request at PayPal.

 

If the customer didn't have a PayPal account, he needs to sign-up a new one with address fields pre-populated (by the shipping address sent with the initial request). The customer can choose an alternate address, which is a confirmed shipping address from the file of his PayPal account. Then PayPal sends the customer back to your store with the token string, so this payment module can send the transaction request later with this token, for PayPal to identify that the payment with this token has been autorized. No transaction has been made yet at this point.

 

This payment module will send a second request to PayPal to fetch the customer's address info selected at PayPal. If the customer didn't change the address, the original address will be sent back. Then it alters the order with the new address if changed. Along with this payment module there is a new review payment page, the customer can review his order and make necessary changes if he wants to, and then hit the PAY button right in your store.

 

At this point, the payment has been confirmed by the customer, it takes the customer to checkout process and sends out the transaction request, with the updated order info if the customer changed anything. If the response from PayPal is a successful transaction result, then it log the order in database and update the order status with the payment result, Completed or Pending.

 

The built-in IPN (Instant Payment Notification) feature will update the order status automatically when the payment status have been updated, eg. from Pending to Completed, or failed...etc.

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

Hi there,

 

trying to set it up but keep on getting the following error:

 

We're sorry, but we were unable to process your payment.

An error occured when we tried to establish a connection to PayPal's servers.<br><br>

 

 

 

and I also get a PayPal EC Error Dump email with the following content (URLs are changed):

 

 

In function: confirmation()

 

 

 

From this request:

 

[PAYPAL_ORDER_TOTAL] = 16.17

[PAYPAL_CURRENCY] = USD

[PAYPAL_PAGE_STYLE] = PayPal

[PAYPAL_RETURN_URL] = https://www.domain.com/express_checkout.php

[PAYPAL_CANCEL_URL] = https://www.domain.com/checkout_payment.php...error=paypal_ec

[PAYPAL_LOCALE_CODE] = US

[PAYPAL_NO_SHIPPING] = 0

[PAYPAL_ADDRESS_OVERRIDE] = 1

[PAYPAL_NAME] = Alexei Nabokov

[PAYPAL_ADDRESS1] = 123 Pemberton Avenue # 123

[PAYPAL_ADDRESS2] = N/A

[PAYPAL_CITY] = North York

[PAYPAL_STATE] = ON

[PAYPAL_ZIP] = M2M4L1

[PAYPAL_COUNTRY] = CA

[PAYPAL_PHONE] = 123-456-7890

[PAYPAL_EMAIL] = [email protected]

 

Any idea what I might be doing wrong?

 

Thanks

Edited by babenis
Link to comment
Share on other sites

PayPal launched the Express Checkout Promotion.

 

This beta release is NOT eligible for this promotion. I'm working on it for the next beta release to be eligible.

 

A bug found in the dumping email founction that if the PayPal server was down, the dumping fuction will cause an error because there is no array in the response to be dumped. The fix will be included in the next beta release as well.

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

Details about how to be eligible for the Express Checkout Promotion:

 

Key Points to be eligible:

  1. You need to have a U.S. PayPal Business Account
  2. You need to have PayPal Express Checkout integrated **
  3. You need to fill out the form to sign up for the Promotion

** Key Points for Integration:

 

The PayPal Express Checkout button must appear on the checkout page

PayPal must be the first payment type presented to the buyer on the checkout page of your shopping cart, this can be in addition to a second checkout button for customers to use if they do not want to use PayPal.

No other payments options can be displayed on the checkout page

PayPal must be displayed as an option along with other payment options

Diagram

Please review section Two (page 17) of the Express Checkout Integration Guide for additional information on the PayPal Button Placement Requirements https://www.paypal.com/en_US/pdf/PP_Express...rationGuide.pdf

 

Additional Notes:

Express Checkout is part of PayPal's API's. The technical skill level needed to integrate this feature would require: basic HTML, Scripting Language and API Programming.

 

Basic HTML

Knowledge of Hyper Text Markup Language (HTML) and HTML forms for creation of static web pages.

 

Scripting Languages

Knowledge of scripting languages such as PHP, Perl, ASP, and ColdFusion for creation of dynamic web pages.

 

API Programming

Knowledge of Simple Object Access Protocol (SOAP)-based programming.

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

PayPal Express Checkout IPN v0.2 released.

 

Please report bugs/issues/problems in this thread. Please don not PM nor email me unless you have private data not to shown in public.

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

Hello!

 

I just installed the module and after i made the user settings in the adminpage

i tryed to test it but i got this error message at the confirmation checkout:

 

Warning: Invalid argument supplied for foreach() in xxxcatalog/includes/modules/payment/paypal_ec.php on line 667

Warning: Cannot modify header information - headers already sent by (output started at xxxxxx/catalog/includes/modules/payment/paypal_ec.php:667) in xxxx/www/catalog/includes/functions/general.php on line 33

 

I have to idea!

Link to comment
Share on other sites

Hello!

 

I just installed the module and after i made the user settings in the adminpage

i tryed to test it but i got this error message at the confirmation checkout:

 

Warning: Invalid argument supplied for foreach() in xxxcatalog/includes/modules/payment/paypal_ec.php on line 667

Warning: Cannot modify header information - headers already sent by (output started at xxxxxx/catalog/includes/modules/payment/paypal_ec.php:667) in xxxx/www/catalog/includes/functions/general.php on line 33

 

I have to idea!

Please upgrade to the latest v0.2 release. This bug has been fixed in the new version.

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

Thank you! But you did it not only for me?

 

And sorry, but i have i new problem.

 

I got this message from Paypal:

 

This transaction is invalid. Please return to the recipient's website to complete your transaction using their regular checkout flow.

 

But my certificate information that i typed in are correct!

 

I was trying it in live-Mode!

Link to comment
Share on other sites

Thank you! But you did it not only for me?

 

And sorry, but i have i new problem.

 

I got this message from Paypal:

 

This transaction is invalid. Please return to the recipient's website to complete your transaction using their regular checkout flow.

 

But my certificate information that i typed in are correct!

 

I was trying it in live-Mode!

Please enable Debug Email and Send Every Transaction's Dumping in admin, then reproduce this test and send me the debug dumping to me via PM, not here.

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,

 

this contribution is really great. It nearly works perfect for me, but there is an issue I have.

 

1. Although shipping costs are calculated in the paypal order confirmation mail after checkout, these do not occur in the OsCommerce order confirmation mail or in OsC order details

 

Do you have an idea where I went wrong installing the contribution?

 

Any help is greatly appreciated.

 

Cheers

Soeren

Link to comment
Share on other sites

Below is the error msg I received from PAYPAL.

--------

Authorization Failed

 

This transaction is invalid. Please return to the recipient's website to complete your transaction using their regular checkout flow

 

--

 

Upon futher review, the errors resides in this line....

 

[ReturnURL]http://my_store_edited_for_post.com/catalog/express_checkout.php[/ReturnURL]

[CancelURL]checkout_payment.php?payment_error=paypal_ec[/CancelURL] <-- ERROR

 

[shortMessage] = Transaction refused because of an invalid argument. See additional error messages for details.

[LongMessage] = CancelURL is invalid.

[ErrorCode] = 10472

[severityCode] = Warning

 

-----

 

Question

Where should I set the CANCEL URL???

Edited by KevinE07
Link to comment
Share on other sites

Below is the error msg I received from PAYPAL.

--------

Authorization Failed

 

This transaction is invalid. Please return to the recipient's website to complete your transaction using their regular checkout flow

 

--

 

Upon futher review, the errors resides in this line....

 

[ReturnURL]http://my_store_edited_for_post.com/catalog/express_checkout.php[/ReturnURL]

[CancelURL]checkout_payment.php?payment_error=paypal_ec[/CancelURL] <-- ERROR

 

[shortMessage] = Transaction refused because of an invalid argument. See additional error messages for details.

[LongMessage] = CancelURL is invalid.

[ErrorCode] = 10472

[severityCode] = Warning

 

-----

 

Question

Where should I set the CANCEL URL???

 

 

I found the error, It resides in this line of paypal_c.php

$order_info['PAYPAL_CANCEL_URL'] = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . FILENAME_CHECKOUT_PAYMENT . "?" . $payment_error_return;

 

 

I did not have a HTTPS server configed in oscommerce which was causing this module NOT TO WORK.

Link to comment
Share on other sites

1. Although shipping costs are calculated in the paypal order confirmation mail after checkout, these do not occur in the OsCommerce order confirmation mail or in OsC order details

This shouldn't be a problem from this payment module. It doesn't take over the order confirmation email. Below is a sample email in my test:

Products

------------------------------------------------------

1 x Microsoft IntelliMouse Explorer (MSIMEXP) = $64.95

Model PS/2

------------------------------------------------------

Sub-Total: $64.95

Flat Rate (Best Way): $50.00

FL TAX 7.0%: $8.05

Low Order Fee: $20.00

Total: $143.00

I think everything is in there. The checkout process file which actually do this job is not modified by installing this contrib.

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 found the error, It resides in this line of paypal_c.php

$order_info['PAYPAL_CANCEL_URL'] = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . FILENAME_CHECKOUT_PAYMENT . "?" . $payment_error_return;

 

I did not have a HTTPS server configed in oscommerce which was causing this module NOT TO WORK.

This problem has been taken care of in the latest v0.3 release. Please upgrade to it.

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. What are the advantages+disadvantages of using this contribution instead of:

osCommerce PayPal IPN Module v2.2 For 2.2MS2

which works well for me?

 

thanks

This is a good question, why this Express Checkout IPN module?

 

Advantages:

Express Checkout IPN module utilized PayPal's Express Checkout API, it sends payment requests and receives PayPal responses through the connection directly between your host and PayPal server. In this way, a much higher security level is provided. The official PayPal IPN module utilized PayPal's Website Payment Standard button code to send out payment request through user's browser, there for a possible security breach exist. To prevent this security breach, you need to setup the complicated SSL features in official IPN module.

 

Express Checkout API sends payers back to store before they pay, so there is no need to create pre-mature order records in database like the official IPN module does. The issue about customers not returning after pay, which is still exist in the official IPN module, does not exist in this one.

 

Also, this module doesn't need to do those jobs in checkout process by itself, the official IPN module does. There for it's much more easier to work with other contributions.

 

And more, for payments to be eligible for PayPal's seller protection, payers should be able to select a confirmed shipping address from PayPal file. Express Checout IPN module fully support this feature, there for a much better chance to be eligible for seller protection is provided. The official IPN module currently can not handle shipping address changing at PayPal, so the chance to be eligible is not really good.

 

Disadvantages:

Express Checkout API does not support the PayPal Account Optional feature. Payers must sign-up with PayPal before they can pay. However, if you need this feature for customers who don't want to sign-up at PayPal, you can have official IPN module aside by this one. These 2 modules can work side by side.

 

Express Checkout IPN module requires to modify 3 osCommerce existing files, but the official IPN module doesn't. I did try to develop this module in that way, but it simply can not be achieved.

 

Express Checkout requires cURL lib installed with PHP 4.x, otherwise it won't work.

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

ok. interesting. i think i will use but maybe a future release when it has been tested a little bit more. i did read about paypal express on the paypal site and it sounded quite cool.

 

what sort of files are the 3 that you need to modify and how will that impact the installation of other contributions?

 

thanks for taking the time to respond.

Link to comment
Share on other sites

what sort of files are the 3 that you need to modify and how will that impact the installation of other contributions?

The 3 files required to be modified are:

catalog/checkout_shipping.php

catalog/checkout_payment.php

catalog/includes/filenames.php

 

Details:

catalog/checkout_shipping.php

Modified to show the Express Checkout Button in the first step of checkout process (required by PayPal).

Modified to handle shipping address error sent back from PayPal.

Modified to handle shipping address changed at PayPal, and update the shipping cost.

Modified to handle 'virtual' orders (download items).

Modified to handle payments cancelled at PayPal.

 

catalog/checkout_payment.php

Modified to handle transaction error message from PayPal.

 

catalog/includes/filenames.php

Added 2 lines of filename definitions.

 

The modifications are all well commented, and it's very easy to identify them when applying other contributions. If you need help for applying other modifications in checkout_shipping.php, you can post in this thread.

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 3 files required to be modified are:

catalog/checkout_shipping.php

catalog/checkout_payment.php

catalog/includes/filenames.php

 

Details:

catalog/checkout_shipping.php

Modified to show the Express Checkout Button in the first step of checkout process (required by PayPal).

Modified to handle shipping address error sent back from PayPal.

Modified to handle shipping address changed at PayPal, and update the shipping cost.

Modified to handle 'virtual' orders (download items).

Modified to handle payments cancelled at PayPal.

 

catalog/checkout_payment.php

Modified to handle transaction error message from PayPal.

 

catalog/includes/filenames.php

Added 2 lines of filename definitions.

 

The modifications are all well commented, and it's very easy to identify them when applying other contributions. If you need help for applying other modifications in checkout_shipping.php, you can post in this thread.

 

Hello,

 

I have just installed your PayPal Express Checkout IPN Payment Module v0.3 and I am getting the following error message immediately after the chekout at the checkout_shipping.php:

Fatal error: Call to a member function on a non-object in /home/***/public_html/demo/checkout_shipping.php on line 176

 

Line 176 is:

if (!tep_session_is_registered('paypal_ec_order_info')) $paypal_ec->ec_gen_error('', true, true);

 

Please let us know as to what to do.

 

We are having register_globals = Off [with patches as suggested in the contribution register_globals_v1.5]

 

Thanks,

 

Lakshmanan S.

Edited by celextel
Link to comment
Share on other sites

Hello,

 

I have just installed your PayPal Express Checkout IPN Payment Module v0.3 and I am getting the following error message immediately after the chekout at the checkout_shipping.php:

Fatal error: Call to a member function on a non-object in /home/***/public_html/demo/checkout_shipping.php on line 176

 

Line 176 is:

if (!tep_session_is_registered('paypal_ec_order_info')) $paypal_ec->ec_gen_error('', true, true);

 

Please let us know as to what to do.

 

We are having register_globals = Off [with patches as suggested in the contribution register_globals_v1.5]

 

Thanks,

 

Lakshmanan S.

 

I had missed ! somewhere. It is okay now. Please ignore my earlier message. Thanks, Lakshmanan S.

Link to comment
Share on other sites

i have a problem with this after i installed it i get this on checkout_payment.php

 

PayPal Express Checkout IPN module installation incomplete! There should be XML files located in /var/www/vhosts/lse-store.com/httpdocsincludes/ec_xml/ !

 

what do i do?

Link to comment
Share on other sites

i have a problem with this after i installed it i get this on checkout_payment.php

 

PayPal Express Checkout IPN module installation incomplete! There should be XML files located in /var/www/vhosts/lse-store.com/httpdocsincludes/ec_xml/ !

 

what do i do?

You didn't upload ALL files in the new files/catalog folder, or your catalog/includes is not defined correctly in your configure.php. The required XML files for API to work are missing.

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

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