Jump to content
Sign in to follow this  
dynamoeffects

PayPal WPP Direct Payments & Express Checkout Support

Recommended Posts

Version 0.2 has just been finished and uploaded!

 

If you installed 0.1, you're going to have to go through all the OSC core files you modified in the first one and redo them. Sorry about that, but that shouldn't happen again. Also note the the paypal_wpp.sql file adds one extra column that v0.1 didn't, so don't forget to do import that.

 

The zip file alone is 20k larger than v0.1's, so many changes have been made and a few more core files have been modified. Automatic account creation is now optional (a temporary account is still created, but deleted at the end of checkout) and error messages now include the ones returned from PayPal. The changelog in the readme file lists all the updates.

 

Thanks to everyone who sent me bug reports, this version is MUCH more stable than 0.1 and better suited for a production environment.

Edited by dynamoeffects

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

Share this post


Link to post
Share on other sites

This is probably due to something else I did .... I get this when trying to go to "My Account" or "Cart"

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/gf/gf/catalog/includes/languages/english.php:341) in /usr/www/users/gf/gf/catalog/includes/functions/general.php on line 29

 

Have you seen this before?

 

I'm kinda new to php BTW - java guy.

 

-bh

Share this post


Link to post
Share on other sites

It'll do that if there are carriage returns under the last ?>


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

Share this post


Link to post
Share on other sites
It'll do that if there are carriage returns under the last ?>

 

 

Thanks. Sorry for the remedial PHP questions.. I haven't learned all the quirks yet.

 

-bh

Share this post


Link to post
Share on other sites

Hi, Dynamo,

 

I have updated to the new version. I get the following error:

 

[ERROR]

An error occured when we tried to contact PayPal's servers.

 

()

[/ERROR]

 

It should be my individual Paypal problem, right? I have already changed this line:

 

var $timeout = 4;

 

to

 

var $timeout = 60;

 

Ken

Edited by ken.yong

Share this post


Link to post
Share on other sites

Very very strange, it's working for me. Is this when you click the Express Checkout button, or try to use Direct Payment?


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

Share this post


Link to post
Share on other sites
Very very strange, it's working for me. Is this when you click the Express Checkout button, or try to use Direct Payment?

 

Hi, Dynamo,

 

It's when I click the Express Checkout button.

 

Ken

Share this post


Link to post
Share on other sites

When you removed the old payment module and installed this one, did you remember to redo your settings? I just did an order on my dev cart and it completed and added the money to my sandbox account, so not sure what's going on. The files I'm using are the same ones I packaged and uploaded.


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

Share this post


Link to post
Share on other sites

Yes, I have written down the settings and retyped those in. It still said "An error occured when we tried to contact PayPal's servers."

 

Ken

Share this post


Link to post
Share on other sites

In my case, I had renamed the certificate from cert_key_pem.txt to cert_key_pem_sandbox.txt and forgot to update it. EC is working now. On to test DP.

Share this post


Link to post
Share on other sites

I think I might have a clue... I am hosting with GoDaddy, they require that I use their proxy for all SSL CURL post. Do you know where should I put curl_setopt functions for proxy in your php files?

 

I am confident it will work this time when the proxy thing goes through.

 

THANK YOU VERY MUCH! DYNAMO!!! I REALLY REALLY APPRECIATE ALL YOUR CONTRIBUTIONS!

 

Ken

Edited by ken.yong

Share this post


Link to post
Share on other sites

I have already found a bug in create_account.php, though. I've uploaded a new version of that page to the contributions. Use it to overwrite or modify your existing create_account.php.

 

Ken, I'm willing to bet your solution is similar to SteveDallas'. Recheck your settings, make sure the certificate is still in place, and try again.

 

I honestly never expected this module to be this complex. Sheesh!


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

Share this post


Link to post
Share on other sites

Ken, it'd be somewhere in the pear modules, but couldn't tell you where off the top of my head.


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

Share this post


Link to post
Share on other sites

Brian,

I want to thank you for all your hard work on this module. I have successfully processed both Express Checkout and Direct Payment transactions in the Sandbox.

 

I have some order flow and cosmetic issues that I'd like to address:

 

1. If you log in or checkout without an account (PWA), the EC button appears at the top of checkout_shipping.php. I think that a better placement would be on checkout_payment.php, along with the other payment methods.

 

My reasoning is that a customer, who either logged in, created an account, or used PWA to checkout, has already been presented the EC button, so there is no reason to present it a second time. A returning customer who logged in before checkout has already provided his shipping information, so should be able to confirm it and then select EC on the payments page. This appears to be in harmony with PayPal's business rules.

 

2. When Express Checkout has been selected as the payment method, the checkout confirmation page displays the payment method as "PayPal Direct Payment & Express Checkout". I realize that this is the module name, but is there a way to display it as "PayPal Express Checkout" without splitting the payment module into two parts?

 

3. When presenting payment options, checkout_payment.php displays the module name, but the module only offers the direct payment options. In addition, the PayPal name shouldn't even appear for direct payments. A generic "Credit Card" text would be more appropriate. I haven't dug into the architecture deeply enough to determine whether this can be done easily.

 

I'm curious as to what others think about these issues.

 

--Glen

Share this post


Link to post
Share on other sites
1. If you log in or checkout without an account (PWA), the EC button appears at the top of checkout_shipping.php. I think that a better placement would be on checkout_payment.php, along with the other payment methods.

 

Unfortunately, PayPal has specified the exact placement of their Express Checkout button. It must show up in the checkout process before you ask your customer for their shipping information. The main goal of this module has been to make it fully compliant with PayPal's TOS, so for that reason alone I won't change it in the official contrib. I suppose you could change it on your individual store, though. I really doubt if PayPal would ever cause a stink.

 

2. When Express Checkout has been selected as the payment method, the checkout confirmation page displays the payment method as "PayPal Direct Payment & Express Checkout". I realize that this is the module name, but is there a way to display it as "PayPal Express Checkout" without splitting the payment module into two parts?

 

Sure, that wouldn't be too hard to do. I'll probably release a v0.3 in a couple days to fix any new bugs that pop up and I'll get that in there.

 

3. When presenting payment options, checkout_payment.php displays the module name, but the module only offers the direct payment options. In addition, the PayPal name shouldn't even appear for direct payments. A generic "Credit Card" text would be more appropriate. I haven't dug into the architecture deeply enough to determine whether this can be done easily.

 

Edit the file: /catalog/includes/languages/english/modules/payment/paypal_wpp.php and change the "MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE" line to whatever you want.


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

Share this post


Link to post
Share on other sites
3. When presenting payment options, checkout_payment.php displays the module name, but the module only offers the direct payment options. In addition, the PayPal name shouldn't even appear for direct payments. A generic "Credit Card" text would be more appropriate. I haven't dug into the architecture deeply enough to determine whether this can be done easily.

 

 

This is easily changed in /includes/languages/english/modules/payment/paypal_wpp.php on line 8.

 

If you change it here it will also alter how it is displayed in the admin=>payment modules section.

 

-bh

Share this post


Link to post
Share on other sites
This is easily changed in /includes/languages/english/modules/payment/paypal_wpp.php on line 8.

 

If you change it here it will also alter how it is displayed in the admin=>payment modules section.

 

-bh

 

The problem is that the same variable (MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE) is also used to display the payment method in checkout_shipping.php, so EC payments show up with a payment method of "Credit Card" if you change it. Therefore, making the payment method show up correctly both in the payment method list and in the confirmation requires a bit more magic. I'll have a more detailed look at it.

 

--Glen

Share this post


Link to post
Share on other sites
Unfortunately, PayPal has specified the exact placement of their Express Checkout button. It must show up in the checkout process before you ask your customer for their shipping information. The main goal of this module has been to make it fully compliant with PayPal's TOS, so for that reason alone I won't change it in the official contrib. I suppose you could change it on your individual store, though. I really doubt if PayPal would ever cause a stink.

 

In this case (user was presented the EC button and chose something else), I believe that it is reasonable to hide the button on the shipping address page. However, when he gets to the payment selection page, he should still have the opportunity to select PayPal if he changed his mind during the checkout process. The rules for the placement of PayPal with other payment methods should apply at this point.

 

--Glen

Share this post


Link to post
Share on other sites

Hi, another problem.... My Express Checkout button is returning error 10417. I know this is not an issue of the module so I have contacted Paypal for help. They asked me if I can provide my logs of SOAP requests and responses. They are looking for the XML documents that are sent to PayPal and the XML documents returns to my server in the process of performing the Express Checkout. There should be three API calls, each with its own request and response document.

 

In addition, they asked what PayPal SDK, if any, is the module using?

 

Any help on how to retrieve or turn on logging of SOAP requests and responses will be greatly appreciated!!

 

Ken

Share this post


Link to post
Share on other sites

I'm new to PHP and osCommerce, but I have been programming off and on for years. I have figured out how to make the payment method show up correctly for both Express Checkout and Direct Payments.

 

Add these lines to catalog/includes/languages/english/modules/payment/paypal_wpp.php:

 

define('MODULE_PAYMENT_PAYPAL_DP_TEXT_EC_TITLE', 'PayPal Express Checkout');

define('MODULE_PAYMENT_PAYPAL_DP_TEXT_DP_TITLE', 'Credit/Debit Card');

 

In catalog/includes/modules/payment/paypal_wpp.php, change:

 

$this->title = MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE;

 

to

 

if (tep_session_is_registered('paypal_ec_token') && tep_session_is_registered('paypal_ec_payer_id') && tep_session_is_registered('paypal_ec_payer_info')) {

$this->title = MODULE_PAYMENT_PAYPAL_DP_TEXT_EC_TITLE;

} else {

$this->title = MODULE_PAYMENT_PAYPAL_DP_TEXT_DP_TITLE;

}

 

 

If I monkey around with it a bit more, I might be able to make the original title show up in the admin module.

 

--Glen

Share this post


Link to post
Share on other sites
Hi, another problem.... My Express Checkout button is returning error 10417.

 

That's the generic error I was getting yesterday. Unverify your sandbox user by deleting the bank account and then try again (you'll have to turn off the Verify check in the module admin). As I mentioned before, I think the fake bank account number they give us is depleted and so, thinking the user can't pay, it tells the customer to use another form of payment.

 

 

In addition, they asked what PayPal SDK, if any, is the module using?

 

2.0


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

Share this post


Link to post
Share on other sites
However, when he gets to the payment selection page, he should still have the opportunity to select PayPal if he changed his mind during the checkout process.

 

I can agree with that. I didn't have it show up again simply because if the user is logged in, and skipped past Express Checkout (maybe even twice), I'd personally prefer them use Direct Payment. I'll make it an option in 0.3 to display an express checkout button on the payment page.


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

Share this post


Link to post
Share on other sites
I can agree with that. I didn't have it show up again simply because if the user is logged in, and skipped past Express Checkout (maybe even twice), I'd personally prefer them use Direct Payment. I'll make it an option in 0.3 to display an express checkout button on the payment page.

 

For the time being, I'm just using the PayPal IPN payment contribution to handle this choice.

 

While fooling around with things last night (well, around 3AM), I added a capability for payment modules to display an icon with the module name. Once I figured out how payment modules interact with checkout_payment.php, it was pretty straightforward.

 

--Glen

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×