Jump to content
Sign in to follow this  
dynamoeffects

PayPal WPP Direct Payments & Express Checkout Support

Recommended Posts

Greetings.

 

This is the first of what will undoubtedly be many OS Commerce setups. I am encountering a problem with my paypal_ipn payment setup. Currently when I "confirm the order" and get redirected to paypal. There is one item listed and it's value is $0.

 

I'd like to be able to dump the request from my site to paypal into a log. So that I can see exactly what is being transfered. I didn't see a comment within the module which did this already.

 

I am currently uncertain where within the file I should add this.

 

Any helpful hints towards dumping the paypal redirect to a logfile or why I have $0 to pay when I get to paypal would be greatly appreciated.

Share this post


Link to post
Share on other sites

Brian, I'm running 0.7.3 with the register global changes we worked on a few months ago - is there any major reason to upgrade to 0.8.2? If so, do I need to uninstall it, then install 0.8.2, or do I need to start at 0.8b and work my way up?

 

Thanks, and thanks for continuing to support probably one of the most useful contributions for OsCommerce.

Share this post


Link to post
Share on other sites

I am installed the PayPal WPP Direct Payments & Express Checkout module v0.8.2. The WPP Direct Payment is working fine, but the Express checkout is not work properly.

When customer using Express check out, then --> "Delivery Information" page(checkout_shipping.php) --> Click "continue" --> Click the "Express Checkout" --> Jump to the paypal website to login --> login successful --> back to oscommerce website --> checkout_shipping.php --> Click "Continue" --> checkout_payment.php --> click "continue" --> loop back to "Delivery Information" page(checkout_shipping.php).

 

If I idle at the Payment Information page (checkout_payment.php) for around 40~60sec, then click the "continue" button, it will pass to the checkout_confirmation.php in normal way.

 

Anyone can help me to fix this problem?

Share this post


Link to post
Share on other sites

I installed "paypal_wpp_0.8.2" on my site. Then I used my sandbox to test, everything is ok. But when I ran the test with a real credit. I got the below error:

Your credit card was declined. Please try another card or contact your bank for more info.

 

No response from PayPal

No response was received from PayPal. Please contact the store owner for assistance.

 

Any idea about this?

Share this post


Link to post
Share on other sites

Hi Brian,

I just wanted to thank your considerable efforts in writing this and making it available.

A big thank you sir!

I managed to install it, integrate it with PWA, Fast checkout, CCGV and many more on a heavily loaded store and it all works fine :)

 

(PS Some nice neat code there too and interesting code comments!)

 

Paypal Pro is now available in the UK, and I can see through the code that there is support for Euros semi built in.

I was wondering if you would be so kind as to add UK Pounds if you get the chance.

I will try to look into changing it myself this weekend (read, hacking about changing things until it might possibly work) and if I am succesful will update this thread.

 

Thanks again for your efforts!!!! :)

Share this post


Link to post
Share on other sites

@tonionio: Did you complete all of the code integration on the checkout_shipping page? I fixed an install on one guy's site yesterday that had similar problems and it was because they had done little to no code integration.

 

@tomliuwhite: If you use GoDaddy, you need to set the Proxy Address. Otherwise, make sure your certificate is in the right place, the path to it is correct in the module's settings, and your API username/password are correct.

 

@Jamez: The UK API is considerably different than that of the US service because PayPal bought an existing payment gateway service and modified their API. I have the docs stashed away somewhere, but just don't have the time to get to it at the moment -- Christmas season is upon us again!


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
@tonionio: Did you complete all of the code integration on the checkout_shipping page? I fixed an install on one guy's site yesterday that had similar problems and it was because they had done little to no code integration.

 

@tomliuwhite: If you use GoDaddy, you need to set the Proxy Address. Otherwise, make sure your certificate is in the right place, the path to it is correct in the module's settings, and your API username/password are correct.

 

@Jamez: The UK API is considerably different than that of the US service because PayPal bought an existing payment gateway service and modified their API. I have the docs stashed away somewhere, but just don't have the time to get to it at the moment -- Christmas season is upon us again!

 

Hi Brian,

Thats interesting reading sir, because your code worked fine with it, maybe it is just processing using the US service, which I understand is perfectly fine too. The only thing that needed to be changed is the currency....

Going to try something now, ill update you if im succesful, im going to add another case to the currencys, and hardcode the currency from USD to whatever the UK code is checking with another paypal module now.

 

My fave line...

//This one function replaces all of those damned pear modules. Go me.

Go you indeed!!!!!!!!!!!!!

Share this post


Link to post
Share on other sites
Hi Brian,

Thats interesting reading sir, because your code worked fine with it, maybe it is just processing using the US service, which I understand is perfectly fine too. The only thing that needed to be changed is the currency....

Going to try something now, ill update you if im succesful, im going to add another case to the currencys, and hardcode the currency from USD to whatever the UK code is checking with another paypal module now.

 

My fave line...

//This one function replaces all of those damned pear modules. Go me.

Go you indeed!!!!!!!!!!!!!

 

LOL well that was wishful thinking wasnt it.

Its using paypal.com as the API, so unless things have changed they still only accept US$ only.

Share this post


Link to post
Share on other sites

Further digging on the Paypal dev forums says it doesnt matter after all...

Just got to change the currency.

Share this post


Link to post
Share on other sites
Further digging on the Paypal dev forums says it doesnt matter after all...

Just got to change the currency.

 

There is a small note in the July 2006 edition of the WPP Integration Guide that indicates that the Direct Payments API can be used with any PayPal-supported currency. That may have coincided with PayPal establishing a relationship with HSBC Bank for merchant banking services. The US website claims that WPP is US-only, though.

 

As of July, the PayPal supported currencies were USD, CAD, GBP, EUR, JPY, AUD. As of 12 Oct 2006, PayPal also supports CHF, NOK, SEK, DKK, PLN, HUF, CZK, SGD, HKD, NZD. In theory, the PayPal Direct Payments API will support all of these currencies. It is unclear to me whether PayPal's product offerings have been updated to allow customers in countries outside the US to access the Direct Payments API.

 

Note that the Express Checkout API has always worked with all PayPal-supported currencies, though this payment module is hard-coded to use USD.

 

--Glen

Edited by SteveDallas

Share this post


Link to post
Share on other sites
There is a small note in the July 2006 edition of the WPP Integration Guide that indicates that the Direct Payments API can be used with any PayPal-supported currency. That may have coincided with PayPal establishing a relationship with HSBC Bank for merchant banking services. The US website claims that WPP is US-only, though.

 

As of July, the PayPal supported currencies were USD, CAD, GBP, EUR, JPY, AUD. As of 12 Oct 2006, PayPal also supports CHF, NOK, SEK, DKK, PLN, HUF, CZK, SGD, HKD, NZD. In theory, the PayPal Direct Payments API will support all of these currencies. It is unclear to me whether PayPal's product offerings have been updated to allow customers in countries outside the US to access the Direct Payments API.

 

Note that the Express Checkout API has always worked with all PayPal-supported currencies, though this payment module is hard-coded to use USD.

 

--Glen

 

Hi Glen,

Your info above is correct regarding the supporting currencies, dates etc etc and the hardcoding.

Hardcoding isnt an issue, I just need to make sure this is right.

 

switch (MODULE_PAYMENT_PAYPAL_DP_CURRENCY) {
	  case 'Always EUR':
		$wpp_currency = 'EUR';
		break;
	  case 'Always USD':
		$wpp_currency = 'USD';
		break;
	  case 'Always USD':
		$wpp_currency = 'USD';
		break;
	  case 'Always GBP':
		$wpp_currency = 'GBP';
		break;
	  case 'Either EUR or USD, else EUR':
		if ( ($currency == 'EUR') || ($currency == 'USD') ) {
		  $wpp_currency = $currency;
		} else {
		  $wpp_currency = 'EUR';
		}
		break;
	  case 'Either EUR or USD, else USD':
		if ( ($currency == 'EUR') || ($currency == 'USD') ) {
		  $wpp_currency = $currency;
		} else {
		  $wpp_currency = 'USD';
		}
		break;
	}
	/////////////////////////////////////////////////
	//Delete this line when PayPal supports more than the USD
	$wpp_currency = 'USD';
	//////////////////////////////////////////////////

 

Am I right in thinking the hardcoded part is $wpp_currency = 'USD'; please?

Edited by Jamez

Share this post


Link to post
Share on other sites

Unfortunately not. It will need to be changed throughout the code, as well as the db config values will need to be modified. I'll try centralizing that bit of code in the next version to make it easier as they add currencies. Admittedly bad design on my part.

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

@slackerjack: There are two problems at play. The first is that

 

$payment_modules->before_process()

 

is placed before the order totals are calculated, and this is a bug that's been around as long as 2.2MS2. This module uses the $order variables to determine the total price of the cart, so if they haven't been processed yet, it sends the wrong information. Try this fix:

 

http://forums.oscommerce.com/index.php?s=&...st&p=966398

 

 

 

Tried this fix. Didn't work. Tried several different configurations. One of the errors I got back was "(10520) This transaction cannot be processed. Please review the totals of this transaction and resubmit."

 

 

I had saw this earlier in another post, and I think someone else had the same problem only with a different error. Any other ideas? :-"


I'm not in the middle of nowhere, but I can see it from here!

Share this post


Link to post
Share on other sites
Unfortunately not. It will need to be changed throughout the code, as well as the db config values will need to be modified. I'll try centralizing that bit of code in the next version to make it easier as they add currencies. Admittedly bad design on my part.

 

Hi Brian,

I noticed a bit later theres a bit more on the currency in the same file so I basically replaced ALL the hardcoded USD for GBP uninstalled the module, uploaded then reinstalled and it works perfectly. (other than the fact that at paypal under the amount to be paid it gives the exchange rate, but the amount is in the right currency so im not too worried about that).

 

AWESOME work sir, awesome!

Edited by Jamez

Share this post


Link to post
Share on other sites
Looks like PayPal changed something because you're the third person to report this error today. I'll look into it.

 

I installed the contribution today. I am currently testing on the sandbox. If I choose to use a credit card, it works fine.

 

If choose express checkout, I get the following error when it trys to process the transaction.

 

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

An error occured when we tried to process your credit card.

 

Error #1: Transaction refused because of an invalid

 

argument. See additional error messages for details.

 

(10431)

Item amount is invalid.

 

Error #2: Transaction cannot complete. (10417)

The transaction cannot complete successfully. Instruct the customer to use an alternative payment method.

 

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

 

After doing some testing I discovered that this only happens when the primary funding source is set to the bank.

 

For testing purposes I added a credit card to the test account and then select it on the checkout page from paypal where you are ask to review your payment (see below):

 

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

Instant Transfer: citi Bank Account XXXXXX2924

Backup Funding Source: Visa XXXX-XXXX-XXXX-0114

 

Change <-- ( I clicked on change and selected the credit card on file as the primary funding source)

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

 

You can also select echeck as an option instead of credit card and it would go through.

 

The bad thing is that "Instant Transfer" is the default option selected. If the customer doesn't change this, the transaction will always fails with the errors above.

 

I hope this helps Brian. I now some people been reporting on this lately.

 

Great contribution.

Share this post


Link to post
Share on other sites

Upgraded to 0.8.1 today and express is working but credit sale and credit auth not working here is error dump.

 

In function: before_process() - Direct Payment


Did first contact attempt return error? Yes 


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


-------------------------------DP_DUMP-------------------------------


------------This is the information that was sent to PayPal----------


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


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


-------------------------------FINAL_REQ-----------------------------


-------------------This is the response from PayPal------------------


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


Array

(

[Security] => 

[RequesterCredentials] => Array

	(

		[0] => Array

			(

				[Credentials] => Array

					(

						[0] => Array

							(

								[Username] => 

								[Password] => 

								[Subject] => 

							)



					)



			)



	)



[DoDirectPaymentResponse] => Array

	(

		[0] => Array

			(

				[Timestamp] => 2006-11-19T05:49:45Z

				[Ack] => Failure

				[CorrelationID] => dbec58687979d

				[Errors] => Array

					(

						[0] => Array

							(

								[ShortMessage] => Invalid Data

								[LongMessage] => This transaction cannot be processed. Please review the totals of this transaction and resubmit.

								[ErrorCode] => 10520

								[SeverityCode] => Error

							)



					)



				[Version] => 2.000000

				[Build] => 1.0006

				[Amount] => 6.85

			)



	)



)







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


---------------------------------TS_REQ------------------------------


--------Results of the transaction search if it was executed---------


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

 

I have gone back to 0.7.3 as new non PEAR versions don't seem to work.

Share this post


Link to post
Share on other sites
I installed "paypal_wpp_0.8.2" on my site. Then I used my sandbox to test, everything is ok. But when I ran the test with a real credit. I got the below error:

Your credit card was declined. Please try another card or contact your bank for more info.

 

No response from PayPal

No response was received from PayPal. Please contact the store owner for assistance.

 

Any idea about this?

 

I was getting the same thing. In the process of hunting down the problem, I stuck a call to curl_error() in the function that contacts PayPal which resulted in a "Permission denied" message. Turns out my hosting provider doesn't allow outgoing connections (so why cURL is enabled is really beyond me). To test for this, you can use this script and see if it gives you the permission denied error:

 

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.google.com/");
curl_exec($ch);
echo curl_error($ch);
curl_close($ch);
?>

 

There may or may not be a way to get your server to allow outgoing sockets.

Share this post


Link to post
Share on other sites

In this next version I'll be including a cleaned up version of the test script I use when I do professional installs of the module for people. It checks for and tests curl, the certificate, SSL, etc. and should make diagnosing problems much much easier.


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
In this next version I'll be including a cleaned up version of the test script I use when I do professional installs of the module for people. It checks for and tests curl, the certificate, SSL, etc. and should make diagnosing problems much much easier.

 

When do you plan on releasing the new version?

Share this post


Link to post
Share on other sites

Hi Everyone,

 

My osCommerce store is running on (Windows, IIS) platform. I?m having the following problem.

 

I've installed 0.8.2 contribution at https://64.182.151.10/catalog/index.php site sucessfully. Transaction is being processed correctly if user click on the "Checkout with Paypal" button. I'm getting error when user want to place order using credit card payment and checkout_payment.php files comes blank. It does not show any error message. Please guide me in this regard.

 

Thanks in advance,

Masood

Share this post


Link to post
Share on other sites
When do you plan on releasing the new version?

 

In the next few days, but only as a beta version that I'll need help testing. It calculates the totals correctly when someone's checking out with a voucher, coupon or both, but looks like CCGV's not calculating the totals correctly.


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
Upgraded to 0.8.1 today and express is working but credit sale and credit auth not working here is error dump.

 

I have gone back to 0.7.3 as new non PEAR versions don't seem to work.

Might be a better idea to upgrade to the latest version instead of declaring that an older version doesn't work.

 

I'm getting error when user want to place order using credit card payment and checkout_payment.php files comes blank. It does not show any error message. Please guide me in this regard.

Recheck the changes to the checkout_payment.php file included in the contribution with your version and make sure you included all changes.


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 think this will be a way awesome contribution if I could just figure out a few bugs I'm having with it.

 

I've implemented PayPal WPP v0.8.2 to my store, thoroughly following the directions, and now I'm getting an error on numerous checkout php pages that are directly related to this line in the coding:

 

  if (tep_paypal_wpp_enabled() && $cart->count_contents() > 0) {

 

somethings not digesting this 'wpp_enabled' piece of coding for some reason. I've uploaded all the required files, etc, and created an API certificate, enabled this module, etc..

 

Any suggestions for this? thanks!

 

Edited by katman

Share this post


Link to post
Share on other sites

You didn't add the tep_paypal_wpp_enabled() function to your /includes/functions/general.php file.


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

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  

×