Jump to content



Photo
* * * * * 1 votes

PayPal Express Checkout IPN Payment Module


  • Please log in to reply
405 replies to this topic

#1   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 10 January 2007 - 22:26

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.

#2   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 11 January 2007 - 20:37

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

#3   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 12 January 2007 - 09:56

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, 12 January 2007 - 09:58.

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.

#4   babenis

babenis
  • Members
  • 3 posts
  • Real Name:Alex Smirnov

Posted 14 January 2007 - 19:55

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.c...ss_checkout.php
[PAYPAL_CANCEL_URL] = https://www.domain.c...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] = my@email.com

Any idea what I might be doing wrong?

Thanks

Edited by babenis, 14 January 2007 - 20:00.


#5   babenis

babenis
  • Members
  • 3 posts
  • Real Name:Alex Smirnov

Posted 15 January 2007 - 00:09

Figured it out, I accidentally put my email address in Proxy Server setting.
Works flawlessly.

Thanks.

#6   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 16 January 2007 - 17:19

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.

#7   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 16 January 2007 - 17:58

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

Key Points to be eligible:
  • You need to have a U.S. PayPal Business Account
  • You need to have PayPal Express Checkout integrated **
  • 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.c...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.

#8   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 20 January 2007 - 17:28

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.

#9   clothingfactory

clothingfactory
  • Members
  • 3 posts
  • Real Name:David

Posted 20 January 2007 - 17:42

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!

#10   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 20 January 2007 - 17:47

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.

#11   clothingfactory

clothingfactory
  • Members
  • 3 posts
  • Real Name:David

Posted 20 January 2007 - 18:40

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!

#12   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 20 January 2007 - 18:52

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.

#13   soeren71

soeren71
  • Members
  • 3 posts
  • Real Name:Soeren

Posted 22 January 2007 - 15:45

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

#14   JakSmit

JakSmit
  • Members
  • 22 posts
  • Real Name:Jack Smith

Posted 22 January 2007 - 16:15

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

#15   KevinE07

KevinE07
  • Members
  • 6 posts
  • Real Name:Kevin

Posted 22 January 2007 - 17:52

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, 22 January 2007 - 17:56.


#16   KevinE07

KevinE07
  • Members
  • 6 posts
  • Real Name:Kevin

Posted 22 January 2007 - 18:09

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.

#17   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 22 January 2007 - 22:26

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.

#18   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 22 January 2007 - 22:27

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.

#19   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 22 January 2007 - 23:27

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.

#20   JakSmit

JakSmit
  • Members
  • 22 posts
  • Real Name:Jack Smith

Posted 22 January 2007 - 23:31

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.