Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Paypal Express Missing Address Line


davidrecord

Recommended Posts

Hi Guys,

This is my first post so please be gentle.

I have searched the forums about this but I have had no look in finding an answer -- so here goes.

 

I have just installed the PayPal Express Checkout V1.0. on osCommerce v2.2rc2

I have created a sandbox Merchant account with Paypal to get my API username, API password and API signature.

 

I have gone to my website and put an item into my basket.

I have clicked on the PayPal Buy now button and (after creating a dummy account on my website) I have been taken to the PayPal website.

 

Now (as a customer not having an existing PayPal account) I enter a name, address (filling in both Address Line 1 and Address Line 2) and credit card information.

 

I then click the 'continue' button and I get returned to my checkout_confirmation.php page.

On the confirmation page it displays the Delivery Address and the Billing Address, but the information from Address Line 2 is missing. WHERE HAS IT GONE?

 

I have previously added the contribution (http://www.oscommerce.com/community/contributions,1855 for a second address line (because they're useful !) but I don't think that has any effect on this problem.

 

I have looked at the file in /osCommerce/ext/modules/payment/paypal/express.php where it handles the response from PayPal where around line 107 it has the following code:

 

$sendto = array('firstname' => substr($response_array['SHIPTONAME'], 0, strpos($response_array['SHIPTONAME'], ' ')),

'lastname' => substr($response_array['SHIPTONAME'], strpos($response_array['SHIPTONAME'], ' ')+1),

'company' => '',

'street_address' => $response_array['SHIPTOSTREET'],

'suburb' => '',

'postcode' => $response_array['SHIPTOZIP'],

'city' => $response_array['SHIPTOCITY'], etc etc

 

My thoughts were from looking at the above code is that PayPal is not returning the Second Line of the Address.

 

Now as I have the 'Second Address Line' Mod I thought I could hack this code a little to confirm that this code is doing what I thought it was, so I added

'street_address_2' => 'hacked second line',

 

and sure enough, the address shown on the checkout_confirmation page displays the string 'hacked second line' as the second line of the address. Also when I go to the admin pages I can see this 'hacked second line' is displayed in the customers delivery and billing addresses, just as I expected.

 

So to me it appears that PayPal is just NOT sending the second line of the address back.

 

SO IT's QUESTION TIME

I assume lots of you are using PayPal and some of you have tested it using a 2nd Address Line. So what were your results?

Did your 2nd Address Line get displayed on the checkout_confirmation page or was it missing?

Also does the 2nd Address Line show up on your admin pages?

 

I can only hope that I have broken something with my '2nd Address Line mods', but I really suspect this is a PayPal issue.

 

Does anybody know where I can find details about how PayPal puts the address together and posts it back to my website.

I have already looked around the PayPal developers website but it's a complete mess and extremely hard to find any useful info so a direct link would be very useful (to me and everybody else who's reading this!).

 

So let the responses flood in, (Thanks Dave)

Link to comment
Share on other sites

  • 2 weeks later...

I just installed the "Second Address Line" contribution on my store (my site is v2.2 RC2) where I have been using PayPal Direct 1.1. I am still working up to testing the 2nd address, but from this page PayPal suggest that the second address is not required (see Table 4.7 CardOwner: AddressType Fields).

 

Did you get the 2nd address working properly for you?

Link to comment
Share on other sites

I just installed the "Second Address Line" contribution on my store (my site is v2.2 RC2) where I have been using PayPal Direct 1.1. I am still working up to testing the 2nd address, but from this page PayPal suggest that the second address is not required (see Table 4.7 CardOwner: AddressType Fields).

 

Did you get the 2nd address working properly for you?

 

Hi pchem,

A quick answer to your question is NO, I did not get the 2nd Address Line working.

You mention that Paypal suggest that a 2nd Address Line is not required. I agree if your address doesn't have a 2nd Address Line, but you most certainly need it if your address DOES have a second address line.

 

As I live in the UK, I use the 2nd address line quite a lot. If you live in a block of flats or in a village, then you most definitely need it.

 

Anyway that's not really the point. What is the point, is that if you have an option to put data into the 2nd Address Line field within the Paypal page, it should most certainly be present when you are returned to the website.

Any loss of information is NOT ACCEPTABLE.

 

This is my first attempt at trying to put an eCommerce website together. My initial thoughts were that osCommerce was all of the answers that I was looking for, but now I have my (very serious) doubts.

 

I do have (very) high standards and my aim was to create a beautiful and easy to navigate website (surely the same for everybody else!), so I have spent nearly 3 months heavily customising my website.

 

During that time I have concluded that the basic functionality provided by the original installation is really quite poor, and much of my time has been spent simply trying to make the website 'acceptable' to my customers by adding contribution after contribution to fix very basic problems like missing back buttons, bad grammar, complicated checkout process, poor file structure and poor layout.

 

I now also have problems with Google Checkout. On return from Google Checkout, a customer who wasn't logged into my site (before they went to Google Checkout), is logged in, but the personal information pages (i.e. delivery address, billing address, order history) are just blank. I know the problem is with the response handler code but I simply can't afford to spend any more time fixing something else.

 

I am in a situation where I don't know if the Community contributions that I have added to my website are causing problems with other contributions. I don't know if the addition of any contributions in the future will break what I already have and I have very serious concerns about the upgrade path.

 

I have concluded that what I do need is something that'll work out of the box and any changes that I have to make are purely for aesthetical reasons so I have just started looking at other solutions -- and just found one, which seems to be much better -- can't Mention the nAme here thouGh becusE I doN'T think that wOuld be fair!

 

Dave

Link to comment
Share on other sites

  • 3 months later...

Hi pchem,

A quick answer to your question is NO, I did not get the 2nd Address Line working.

You mention that Paypal suggest that a 2nd Address Line is not required. I agree if your address doesn't have a 2nd Address Line, but you most certainly need it if your address DOES have a second address line.

 

As I live in the UK, I use the 2nd address line quite a lot. If you live in a block of flats or in a village, then you most definitely need it.

 

Anyway that's not really the point. What is the point, is that if you have an option to put data into the 2nd Address Line field within the Paypal page, it should most certainly be present when you are returned to the website.

Any loss of information is NOT ACCEPTABLE.

 

This is my first attempt at trying to put an eCommerce website together. My initial thoughts were that osCommerce was all of the answers that I was looking for, but now I have my (very serious) doubts.

 

I do have (very) high standards and my aim was to create a beautiful and easy to navigate website (surely the same for everybody else!), so I have spent nearly 3 months heavily customising my website.

 

During that time I have concluded that the basic functionality provided by the original installation is really quite poor, and much of my time has been spent simply trying to make the website 'acceptable' to my customers by adding contribution after contribution to fix very basic problems like missing back buttons, bad grammar, complicated checkout process, poor file structure and poor layout.

 

I now also have problems with Google Checkout. On return from Google Checkout, a customer who wasn't logged into my site (before they went to Google Checkout), is logged in, but the personal information pages (i.e. delivery address, billing address, order history) are just blank. I know the problem is with the response handler code but I simply can't afford to spend any more time fixing something else.

 

I am in a situation where I don't know if the Community contributions that I have added to my website are causing problems with other contributions. I don't know if the addition of any contributions in the future will break what I already have and I have very serious concerns about the upgrade path.

 

I have concluded that what I do need is something that'll work out of the box and any changes that I have to make are purely for aesthetical reasons so I have just started looking at other solutions -- and just found one, which seems to be much better -- can't Mention the nAme here thouGh becusE I doN'T think that wOuld be fair!

 

Dave

 

I am having this problem with mine too. there is a someone who said following in a forum, which I think might be the problem. unforturnately, that is OCC, not exactly the one i use.

But very same problem with paypal express checkout. Hereunder is the detail

 

I have contacted support regarding this and they have told me to do the following.

 

Find the file: OCCPaypalPro.pl located in the common oCC folder within your site folder. Now find the following line:

 

$::g_ShipContact{'ADDRESS2'} = $$hResponse{""};

 

and change it to

 

$::g_ShipContact{'ADDRESS2'} = $$hResponse{"SHIPTOSTREET2"};

 

Then locate the line

 

$::g_BillContact{'ADDRESS2'} = $$hResponse{""};

 

and change it to

 

$::g_BillContact{'ADDRESS2'} = $$hResponse{"SHIPTOSTREET2"};

 

 

any idea how to fix this?

 

Thanks

Link to comment
Share on other sites

Hi pchem,

A quick answer to your question is NO, I did not get the 2nd Address Line working.

You mention that Paypal suggest that a 2nd Address Line is not required. I agree if your address doesn't have a 2nd Address Line, but you most certainly need it if your address DOES have a second address line.

 

As I live in the UK, I use the 2nd address line quite a lot. If you live in a block of flats or in a village, then you most definitely need it.

 

Anyway that's not really the point. What is the point, is that if you have an option to put data into the 2nd Address Line field within the Paypal page, it should most certainly be present when you are returned to the website.

Any loss of information is NOT ACCEPTABLE.

 

This is my first attempt at trying to put an eCommerce website together. My initial thoughts were that osCommerce was all of the answers that I was looking for, but now I have my (very serious) doubts.

 

I do have (very) high standards and my aim was to create a beautiful and easy to navigate website (surely the same for everybody else!), so I have spent nearly 3 months heavily customising my website.

 

During that time I have concluded that the basic functionality provided by the original installation is really quite poor, and much of my time has been spent simply trying to make the website 'acceptable' to my customers by adding contribution after contribution to fix very basic problems like missing back buttons, bad grammar, complicated checkout process, poor file structure and poor layout.

 

I now also have problems with Google Checkout. On return from Google Checkout, a customer who wasn't logged into my site (before they went to Google Checkout), is logged in, but the personal information pages (i.e. delivery address, billing address, order history) are just blank. I know the problem is with the response handler code but I simply can't afford to spend any more time fixing something else.

 

I am in a situation where I don't know if the Community contributions that I have added to my website are causing problems with other contributions. I don't know if the addition of any contributions in the future will break what I already have and I have very serious concerns about the upgrade path.

 

I have concluded that what I do need is something that'll work out of the box and any changes that I have to make are purely for aesthetical reasons so I have just started looking at other solutions -- and just found one, which seems to be much better -- can't Mention the nAme here thouGh becusE I doN'T think that wOuld be fair!

 

Dave

 

I am having this problem with mine too. there is a someone who said following in a forum, which I think might be the problem. unforturnately, that is OCC, not exactly the one i use.

But very same problem with paypal express checkout. Hereunder is the detail

 

I have contacted support regarding this and they have told me to do the following.

 

Find the file: OCCPaypalPro.pl located in the common oCC folder within your site folder. Now find the following line:

 

$::g_ShipContact{'ADDRESS2'} = $$hResponse{""};

 

and change it to

 

$::g_ShipContact{'ADDRESS2'} = $$hResponse{"SHIPTOSTREET2"};

 

Then locate the line

 

$::g_BillContact{'ADDRESS2'} = $$hResponse{""};

 

and change it to

 

$::g_BillContact{'ADDRESS2'} = $$hResponse{"SHIPTOSTREET2"};

 

 

any idea how to fix this?

 

Thanks

Link to comment
Share on other sites

  • 1 month later...
  • 8 months later...
  • 1 year later...

OK, after some digging, here is a solution that I tested

 

in /catalog/ext/modules/payment/paypal/express.php

 

around line 116

replace 'suburb' => '',

with 'suburb' => $response_array['SHIPTOSTREET2'],

 

Hi,

 

I have a major problem, on some PayPal orders the delivery address is incomplete, with first line of the address missing, by updating the above code, would this solve this problem?

 

Thank you in advance..

Link to comment
Share on other sites

  • 10 months later...
  • 2 years later...

Hi,  This is a problem I have had for ages and the fix didn't work for me.  When I put the address in as

 

comapny
First Name Last Name
Address 1
Address 2
City+,
DN4 0RD
state, UK

 

 

 

 

it carried to paypal as :

Delivery address
First Name Last Name
Address 1
City+, State 
DN4 0RD    - it then adds this address to the customer address book
 
Do I have to remove and re-install the module after making changes?  I am presuming I would, and did so, but I am actually having difficulty figuring out which module I have actually got installed!
 
 any idea why this isn't working for me, I am on osCommerce Online Merchant v2.3.3.2,  but will update when I get a few free hours!

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Link to comment
Share on other sites

I also note in my papal express the code looks like this:

 

        $sendto = array('firstname' => '',
                        'lastname' => '',
                        'company' => '',
                        'street_address' => $HTTP_POST_VARS['SHIPTOSTREET'],
                        'suburb' => '',
                        'postcode' => $HTTP_POST_VARS['SHIPTOZIP'],
                        'city' => $HTTP_POST_VARS['SHIPTOCITY'],
                        'zone_id' => '',
                        'zone_name' => $HTTP_POST_VARS['SHIPTOSTATE'],
                        'country_id' => '',
                        'country_name' => $HTTP_POST_VARS['SHIPTOCOUNTRY'],
                        'country_iso_code_2' => '',
                        'country_iso_code_3' => '',
                        'address_format_id' => '');
 

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Link to comment
Share on other sites

For anyone who is suffering the same issue I finally got this to work!

 

the code above I added  'street_address' => $HTTP_POST_VARS['SHIPTOSTREET'],
                        'suburb' => $HTTP_POST_VARS['SUBURB'],

 

But there is also 3 other places in the code that need the 'suburb' code adding. 

Essentially I copied the code into word, did a search on the word STREET, and then where ever there was 'street' code that looked relevant added copied and pasted and edited to 'suburb' code.

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Link to comment
Share on other sites

  • 3 weeks later...

Scrap that!

I did get this to work on a brand new unmodded install, but on my live website, which is now fully up to date, this fix doesn't work.  There are actually numerous places/files which mention the Street_address, but fail to mention company or suburb.  I have tried to add these in, and still it carries the address, minus the company and second line of address.

 

If anyone has come up with a solution please let me know

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

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