Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal WPP Direct Payments & Express Checkout Support


dynamoeffects

Recommended Posts

Not the only modification period, the only modification of the code provided with WPP. Why do you feel that it's necessary to put the WPP code for login.php in login_pwa.php? For display purposes? If you then turn off PWA the EC link disappears as well, correct?

 

Just the button code goes in login_pwa.php. The reason is that PWA changes the login code to look like this:

<table border="0" width="70%" cellspacing="0" cellpadding="2">

<?php
if (PWA_ON == 'false') {
require(DIR_WS_INCLUDES . FILENAME_PWA_ACC_LOGIN);
} else {
require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);
}
?>
	  </tr>
</table>

 

Because all the login options fit within this table, I found that I could get the formatting I wanted much more easily if I just stuck it inside the PWA login file.

 

If you turned off PWA, then the EC button would go away as well, but the reason for installing PWA in the first place was to use it. I suppose one could add the EC button to includes/login_acc.php so it would still work if you turned PWA off.

 

 

 

For the "we don't accept this card type" error, I saw that with a very similar credit card module, but only when using the combined shipping/payment pages of Fast Easy Checkout, and then only under certain circumstances having to do with code added to checkout_confirmation.php for that contribution. What the Fast Easy code did in the confirmation page was unregister all the cc info- I don't understand how any credit card module would work in this situation, but that's what it was for. If I didn't have that code in there, then I got the "we don't accept this card type" error.

 

My two cents on trying send an empty cc number is a pop up box telling the user his/her cc info is incorrect/invalid. Javascript?

Interesting. I don't think there's anything going on to unregister the cc number, but I'll do a code walk in any case. I'm not using Fast Easy Checkout, so I know that isn't the problem. The odd thing is that it has only happened to two customers so far. Works for everyone else, including others that are using the same browser.

 

--Glen

Link to comment
Share on other sites

Interesting. I don't think there's anything going on to unregister the cc number, but I'll do a code walk in any case. I'm not using Fast Easy Checkout, so I know that isn't the problem. The odd thing is that it has only happened to two customers so far. Works for everyone else, including others that are using the same browser.

 

--Glen

 

The weird thing about that was I would get the error if I <i>didn't</i> unregister the cc info in checkout_confirmation.php (when using fast easy checkout). But, if I did unregister the info, an error would come back saying that the expiry date was incorrect.

 

Suffice it to say I gave up on Fast Easy Checkout for the time being, and I haven't tried to integrate it with WPP yet.

 

Back to PWA- this may be what you've done, but this is my idea for what should go in create_account.php for PWA and WPP (this code would replace the code from PWA)-

 

//---PayPal WPP with PWA Modification START ---//	
  //$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
  $check_email_query = tep_db_query("select customers_id as id, customers_paypal_ec as ec, customers_email_address, purchased_without_account from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
  if (tep_db_num_rows($check_email_query) > 0) {
	$check_email = tep_db_fetch_array($check_email_query);
	 if ($check_email['ec'] == '1' || $check_email['pwa'] == '1') {
	  //It's a temp account, so delete it and let the user create a new one
	  tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$check_email['id'] . "'");
	} else {
	  $error = true;
	  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
	}
//---PayPal WPP with PWA Modification END---//

 

Or would just the modification you made to this WPP code suffice for this code to function for PWA as the code provided with PWA does? All I've done here, besides the mod you suggested, was add in "customers_email_address, purchased_without_account" into $check_email_query, but I'm not sure it's necessary, or if I've done it quite right. Obviously both sections of code do the same thing for basically the same reason so they can be rolled into one, and that would be the goal.

Edited by djmonkey1

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

PWA users!

 

I came up with a four-box, two-column display for login.php, perfect for use with WPP->

 

You can see a screenshot here:

 

http://besttestsite.com/snapshot.jpg

 

As an added bonus I've done away with includes/login_pwa.php and includes/login_acc.php.

 

If you want more info drop me a line.

 

Stew

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I am having a couple problems integrating this contribution - wondering if anyone can help with either or both of these issues:

 

1. When I click on PayPal button to go to EC, I just get a blank page (ec_process.php). Same thing when I submit a CC order: I just get a blank page (checkout_process.php). A couple others have reported this, but I did not see any responses. Has anyone figured out what causes this?

 

2. From the checkout_payment screen, after entering CC info, I click Continue. I then get this error:

"A runtime error has occurred. Line 63. Error: 'document.checkout_payment.paypalwpp_cc_owner.value' is null or not an object."

It then actually goes to the next page (checkout_confirmation). I looked through the code, and paypalwpp_cc_owner does not appear to be a valid field. I only see paypalwpp_cc_firstname and paypalwpp_cc_lastname, but no paypalwpp. This is coming from paypal_wpp.php:

 

		$js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
		  '	var cc_owner = document.checkout_payment.paypalwpp_cc_owner.value;' . "\n" .

 

Am I missing something?

 

Thanks,

Sean

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

Sean Johnson

Link to comment
Share on other sites

Ah, fun, javascript bugs. That's a holdover from when I had just a "Name" field, and didn't ask for first/last name. Just delete this line:

 

' var cc_owner = document.checkout_payment.paypalwpp_cc_owner.value;' . "\n" .

 

As for it just going to a blank page, check these things:

1) Is your certificate installed?

2) Is the absolute path in the module's admin to both pear and the certificate correct?

3) Did you raise the timeout in /catalog/pear/Services/...../HTTP.php?

 

Try the SOAP logging modification that PayPal Mike posted on the last page and see if there are any errors.

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.

Link to comment
Share on other sites

Thanks for the tip on the javascript bug, that solved that problem.

 

For my other problem, my certificate is installed, path correct, and timeout changed. I think it has to do with the fact that I am hosting with godaddy, and it requires a proxy when using CURL. I saw another post about this in this thread, but I didn't see any replies. Basically, I need to know how to set the proxy_host and proxy_port options in the pear settings. Do you know how to set these options? There is code in pear\Services\PayPal\SOAP\Transport\HTTP.php that looks like this:

 

		if (isset($options['proxy_host'])) {
		// $options['http_proxy'] == 'hostname:port'
		$host = $options['proxy_host'];
		$port = isset($options['proxy_port']) ? $options['proxy_port'] : 8080;
		curl_setopt($ch, CURLOPT_PROXY, $host . ":" . $port);

 

But, I can't figure out exactly where to set thes proxy_host and proxy_port options. There are other places in the code that also check for these options.

 

Thanks,

Sean

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

Sean Johnson

Link to comment
Share on other sites

I'm sure there's a variable somewhere that you can set, but this will work in the meantime (assuming there are no bugs):

 

if (!isset($options['proxy_host'])) {

$options['proxy_host'] = YOURPROXYADDRESS;

$options['proxy_port'] = YOURPROXYPORT;

}

 

if (isset($options['proxy_host'])) {

// $options['http_proxy'] == 'hostname:port'

$host = $options['proxy_host'];

$port = isset($options['proxy_port']) ? $options['proxy_port'] : 8080;

curl_setopt($ch, CURLOPT_PROXY, $host . ":" . $port);

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.

Link to comment
Share on other sites

is there SUPPOSE to be a difference in the contrib's \catalog\includes\languages\english\checkout_payment.php file as compared to the stock OSC file?

 

The one in the contrib and my existing file are the same......just curious.

Link to comment
Share on other sites

I'm sure there's a variable somewhere that you can set, but this will work in the meantime (assuming there are no bugs):

 

if (!isset($options['proxy_host'])) {

$options['proxy_host'] = YOURPROXYADDRESS;

$options['proxy_port'] = YOURPROXYPORT;

}

 

if (isset($options['proxy_host'])) {

// $options['http_proxy'] == 'hostname:port'

$host = $options['proxy_host'];

$port = isset($options['proxy_port']) ? $options['proxy_port'] : 8080;

curl_setopt($ch, CURLOPT_PROXY, $host . ":" . $port);

If I leave the code as-is, I get a timeout and this error in the log: curl_exec error 7

 

If I add the proxy settings (basically the same as above), I get the blank page problem and no log file whatsoever. Very strange. I think there are other places in the code that reference the $proxy_host and $proxy_port settings, and I'm guessing that this may be the cause of the blank page issue? If anyone else knows where to set the proxy settings or knows where the blank page problem comes from, please let me know.

 

Thanks,

Sean

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

Sean Johnson

Link to comment
Share on other sites

Hi to all,

I have installed this great contribution and it is working perfectly.

The only small problem that I have with it is that when a customer purchases an item it shows the following information in the comments of the order:

 

Transaction ID:

Payment Type: PayPal

Payment Status: Completed

AVS Code:

CVV2 Code:

 

As you can see, three parts are missing. I was wondering if anyone had the same problem or any answer on how to fix this.

 

Thank you.

Regards,

Link to comment
Share on other sites

I just uploaded a new version. It's an easy update as all you'll need to do is overwrite this file:

/catalog/includes/modules/payment/paypal_wpp.php

 

Don't have to remove and readd it or anything. Updates are as follows:

 

*Fixed bug that would tell the customer the card's declined, but charge it anyway

*TransactionIDs (EC & DP) and AVS/CVV2 (DP only) return codes are recorded properly

*Fixed Javascript bug so that it'll properly check the fields

*Returned errors now include the ShortMessage

*Added debug variable that, when set to '1', will email the store owner a var_dump of paypal's return msg

*Card holder's information is properly recorded in the order

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.

Link to comment
Share on other sites

is there SUPPOSE to be a difference in the contrib's \catalog\includes\languages\english\checkout_payment.php file as compared to the stock OSC file?

 

The one in the contrib and my existing file are the same......just curious.

 

Anybody? I thought it strange that my existing file was the same as the one in the contrib, just wanna double check before install.

Link to comment
Share on other sites

No, no changes need to be made to that file. I had put some defines in there and then took them out without deleting the file from the package.

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.

Link to comment
Share on other sites

I just uploaded a new version. It's an easy update as all you'll need to do is overwrite this file:

/catalog/includes/modules/payment/paypal_wpp.php

 

Don't have to remove and readd it or anything. Updates are as follows:

 

*Fixed bug that would tell the customer the card's declined, but charge it anyway

*TransactionIDs (EC & DP) and AVS/CVV2 (DP only) return codes are recorded properly

*Fixed Javascript bug so that it'll properly check the fields

*Returned errors now include the ShortMessage

*Added debug variable that, when set to '1', will email the store owner a var_dump of paypal's return msg

*Card holder's information is properly recorded in the order

Great Job Brian,

It works like a pice a cake. Great. :thumbsup: :thumbsup: :thumbsup:

Regards,

Link to comment
Share on other sites

Hi, Dynamo,

 

I reinstalled the whole module again (using the latest module). Now when I use my credit card I got the following error dump (as I read the previous posting that has the same problem - Credit card charged, Paypal got its fees but got an error returned saying the credit card has been declined.). I turned off the verified accounts and confirmed address options.

 

Here is the dump:

 

object(dodirectpaymentresponsetype)(14) { ["Amount"]=> NULL ["AVSCode"]=> string(1) "U" ["CVV2Code"]=> string(1) "M" ["TransactionID"]=> NULL ["_elements"]=> array(10) { ["Timestamp"]=> array(4) { ["required"]=> bool(false) ["type"]=> string(8) "dateTime" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" ["charset"]=> string(10) "iso-8859-1" } ["Ack"]=> array(4) { ["required"]=> bool(true) ["type"]=> string(11) "AckCodeType" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" ["charset"]=> string(10) "iso-8859-1" } ["CorrelationID"]=> array(4) { ["required"]=> bool(false) ["type"]=> string(6) "string" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" ["charset"]=> string(10) "iso-8859-1" } ["Errors"]=> array(4) { ["required"]=> bool(false) ["type"]=> string(9) "ErrorType" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" ["charset"]=> string(10) "iso-8859-1" } ["Version"]=> array(4) { ["required"]=> bool(true) ["type"]=> string(6) "string" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" ["charset"]=> string(10) "iso-8859-1" } ["Build"]=> array(4) { ["required"]=> bool(true) ["type"]=> string(6) "string" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" ["charset"]=> string(10) "iso-8859-1" } ["Amount"]=> array(3) { ["required"]=> bool(true) ["type"]=> string(15) "BasicAmountType" ["namespace"]=> string(22) "urn:ebay:api:PayPalAPI" } ["AVSCode"]=> array(4) { ["required"]=> bool(true) ["type"]=> string(6) "string" ["namespace"]=> string(22) "urn:ebay:api:PayPalAPI" ["charset"]=> string(10) "iso-8859-1" } ["CVV2Code"]=> array(4) { ["required"]=> bool(true) ["type"]=> string(6) "string" ["namespace"]=> string(22) "urn:ebay:api:PayPalAPI" ["charset"]=> string(10) "iso-8859-1" } ["TransactionID"]=> array(3) { ["required"]=> bool(true) ["type"]=> string(13) "TransactionId" ["namespace"]=> string(22) "urn:ebay:api:PayPalAPI" } } ["_attributes"]=> array(0) { } ["_attributeValues"]=> array(0) { } ["_namespace"]=> string(22) "urn:ebay:api:PayPalAPI" ["Timestamp"]=> string(20) "2005-10-31T20:33:46Z" ["Ack"]=> string(7) "Failure" ["CorrelationID"]=> string(40) "7211750854866385695314151130790822404488" ["Errors"]=> object(errortype)(9) { ["_elements"]=> array(5) { ["ShortMessage"]=> array(3) { ["required"]=> bool(true) ["type"]=> string(6) "string" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } ["LongMessage"]=> array(3) { ["required"]=> bool(false) ["type"]=> string(6) "string" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } ["ErrorCode"]=> array(3) { ["required"]=> bool(true) ["type"]=> string(5) "token" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } ["SeverityCode"]=> array(3) { ["required"]=> bool(true) ["type"]=> string(16) "SeverityCodeType" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } ["ErrorParameters"]=> array(3) { ["required"]=> bool(false) ["type"]=> string(18) "ErrorParameterType" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } } ["_attributes"]=> array(0) { } ["_attributeValues"]=> array(0) { } ["_namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" ["ShortMessage"]=> string(19) "Transaction refused" ["LongMessage"]=> string(28) "The transaction was refused." ["ErrorCode"]=> string(5) "10544" ["SeverityCode"]=> string(5) "Error" ["ErrorParameters"]=> NULL } ["Version"]=> string(8) "2.000000" ["Build"]=> string(6) "1.0006" }

 

Thanks a lot! Dynamo!

 

Ken

Edited by ken.yong
Link to comment
Share on other sites

Hi Dynamo

 

I was trying to integrate Paypal Payment Pro Module, from the contribution. After following the installation steps I got the following errors :

 

Warning: main(DIR_WS_BOXES_AZcategories_az01.php): failed to open stream: No such file or directory in /var/www/html/includes/column_left.php on line 22

 

Warning: main(): Failed opening 'DIR_WS_BOXES_AZcategories_az01.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /var/www/html/includes/column_left.php on line 22

 

Warning: main(DIR_WS_BOXES_AZwhats_new.php): failed to open stream: No such file or directory in /var/www/html/includes/column_left.php on line 26

 

Fatal error: main(): Failed opening required 'DIR_WS_BOXES_AZwhats_new.php' (include_path='.:/php/includes:/usr/share/php') in /var/www/html/includes/column_left.php on line 26

 

I am not sure what I am doing wrong. I dont have a very strong programming background and I am not very confident enough to trouble shoot

 

Thanks

Kurt

Link to comment
Share on other sites

Hi, Dynamo,

 

Just a bit more to add on - When I use Express PayPal Checkout, I encountered the following error: "An error occured when we tried to process your credit card."

 

But when I checked my Paypal account, I got the money with the Paypal fee paid!!!!!! It's exactly the same problem like the previous post on Credit Card purchase.

 

Thanks again for all your help!

 

Ken

Link to comment
Share on other sites

Ken, the error returned from PayPal is something you'll have to contact them about. Sounds like your account's not completely setup. Set up a sandbox account and try using that. If it works, there's something wrong with your live account.

 

Kurt, it looks like you overwrote one of your language files with modifications with one of mine. You'll need to pull an old copy from backup and apply the changes by hand.

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.

Link to comment
Share on other sites

Ken, the error returned from PayPal is something you'll have to contact them about. Sounds like your account's not completely setup. Set up a sandbox account and try using that. If it works, there's something wrong with your live account.

 

Kurt, it looks like you overwrote one of your language files with modifications with one of mine. You'll need to pull an old copy from backup and apply the changes by hand.

 

Hi Dynamo,

 

Thanks a lot! Now I have tried PayPal Express Checkout and it's fine. However, I am still having problems with the credit card payment. I will contact Paypal about this, but do you have some hints for me when I contact them (e.g. what went wrong)?

 

Thanks again!

 

Ken

Link to comment
Share on other sites

Hi Dynamo,

 

Thanks a lot! Now I have tried PayPal Express Checkout and it's fine. However, I am still having problems with the credit card payment. I will contact Paypal about this, but do you have some hints for me when I contact them (e.g. what went wrong)?

 

Thanks again!

 

Ken

 

Have you done this:

 

In the file:

/catalog/pear/Services/PayPal/SOAP/Transport/HTTP.php

 

Modify line 62 from:

 

var $timeout = 4;

 

to

 

var $timeout = 120;

 

The readme indicates that it is done already but it's something you need to do. If it isn't done, you'll have the problems that you're having. It makes sense that it would work ok sometimes but not others if this is what is wrong.

 

 

Brian-

 

Thanks for the new update, works great.

 

Two questions:

 

How would I go about populating the billing address fields for the order for people who checkout using EC? I use the billing address info for other purposes, and would like to have it automatically filled.

 

Ditto for the customer's telephone number- unless you've addressed this with v0.5.

 

Thanks,

Stew

Edited by djmonkey1

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Have you done this:

The readme indicates that it is done already but it's something you need to do. If it isn't done, you'll have the problems that you're having. It makes sense that it would work ok sometimes but not others if this is what is wrong.

 

Hi, djmonkey

 

Thanks a lot! I changed it from 4 to 120, but I am still having the same problem with the credit card part. I have no idea which part of the process went wrong at all.

 

Ken

Link to comment
Share on other sites

Hi, Dynamo and djmonkey,

 

I finally figured out the problem! It's the amount to be charged. I did a trial on $0.01 and Paypal returned an error 10544. I have increased the amount to, say $0.51, and it's all fine now!!

 

Thanks so much!! I am going to work on integrating PWA and WPP. If I find anything interesting, I will definitely post it here. Belonging to this part of the community is GREAT!

 

Ken

Link to comment
Share on other sites

How would I go about populating the billing address fields for the order for people who checkout using EC? I use the billing address info for other purposes, and would like to have it automatically filled.

 

Ditto for the customer's telephone number- unless you've addressed this with v0.5.

 

Thanks,

Stew

 

 

The billing information is a bug I still haven't quite figured out. Between the point that the customer is returned from PayPal and they arrive at checkout_confirmation.php, the billing variables get erased for some unknown reason. That's the only reason I made it display "Paypal Express Checkout" under billing on the confirmation 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.

Link to comment
Share on other sites

Hi Dynamo,

 

Affter intergrating the contribution, I tried to checkout an item, after pressing the paypal button i got the follow error:

 

Warning: paypal_init(Services/PayPal.php): failed to open stream: No such file or directory in /var/www/html/includes/modules/payment/paypal_wpp.php on line 273

 

Fatal error: paypal_init(): Failed opening required 'Services/PayPal.php' (include_path='.:/php/includes:/usr/share/php') in /var/www/html/includes/modules/payment/paypal_wpp.php on line 273

Link to comment
Share on other sites

I have a customer who receives "MODULE_PAYMENT_PAYPAL_DP_TEXT_STATE_ERROR" when he tries to check out. I found that the text isn't defined in the include/languages/english/modules/payment/paypal_wpp.php, so that's why he's getting the variable name instead of some explanatory text. However, he's a non-US customer, so shouldn't be getting that message at all.

 

--Glen

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