VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: consolecustoms on February 07, 2014, 04:15:54 AM

Title: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: consolecustoms on February 07, 2014, 04:15:54 AM
Hey everyone, I am using the new virtuemart paypal payments Pro plugin. When a payment is made and I view the transaction in paypal on the main history page it shows the full first and last name. but when I view the details the shipping address shows only the first name so when printing a label I have to fill in the last name manually. So it seems the plugin is not passing the last name for the shipping address to paypal. How can we verify and correct this?

Thank you,
Chris
Title: Re: Paypal Pro plugin not passing last name to Paypal
Post by: consolecustoms on February 08, 2014, 03:54:18 AM
There must not be alot of people here who ship out of paypal or more people would see this problem, looks the same for payapl express except i don't use it so i cant verify. Anyway for those who also need a solution to this problem.

Edit "plugins/vmpayment/paypal/paypal/helpers/paypalapi.php" find the line below


$post_variables['SHIPTONAME'] = isset($addressST->first_name) ? $this->truncate($addressST->first_name, 50) : '';

and change to

$post_variables['SHIPTONAME'] = isset($addressST->first_name) ? $this->truncate($addressST->first_name, 50).' '.$this->truncate($addressST->last_name, 50) : '';

The First and Last name will not be passed to paypal for the shipping address.

This should be corrected officially for future releases

I also see many copy/paste type errors in the file ie.

$post_variables['SHIPTOSTREET'] = isset($addressST->first_name) ? $this->truncate($addressST->address_1, 60) : '';

your checking that the first name entry is not blank to fill the street address variable, does not make sense should be checking the the street address is not blank. Should never be a problem since both are required fields but should should be corrected. there are several similar errors in this file and  in paypalexp.php
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: blizam on February 11, 2014, 08:01:07 AM
Mark thread [SOLVED] then?

http://forum.virtuemart.net/index.php?topic=92265.0

Maybe ask a mod to move this thread to the bugs sub-forum?

Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: klattr1 on April 19, 2014, 00:09:33 AM
I can also confirm the same issue. The Last Name variable shows up on Virtuemart and everywhere else, except for the Shipping Address section of the Paypal details page (as well as email notification to merchant). It only passes through the first name. Mods, can you fix the issue in the core files with the fix above or provide any help on the issue?

Also, this is only problematic when using the Paypal Express option of the built-in PP shipping method. I'm using Virtuemart 2.6.0 and Joomla 5.19 on PHP 5.4.20.
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: klattr1 on April 22, 2014, 04:30:15 AM
Can the above be updated in the core VM plugin files?
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: alatak on April 29, 2014, 12:19:41 PM
Hello
Quoteyour checking that the first name entry is not blank to fill the street address variable,
it is a bug
But this has been fixed in the 2.6
by
$post_variables['SHIPTOSTREET'] = isset($addressST->address_1) ? $this->truncate($addressST->address_1, 60) : '';

There was one bug left in the file plugins/vmpayment/paypal/paypal/helpers/paypalexp.php line 146
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: klattr1 on May 12, 2014, 17:15:38 PM
Alatak, I'm still having the same issue with the Paypal Express checkout type. The last name field still doesn't appear under the Paypal transaction shipping details. This only occurs when the customer clicks on the "Check out with Paypal" Express button on the Shopping Cart page. The problem doesn't exist if the user chooses Paypal as payment option after they confirm their order.
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: alatak on May 13, 2014, 11:31:22 AM
Hello
For which VirtueMart version?
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: klattr1 on May 13, 2014, 16:54:32 PM
Quote from: alatak on May 13, 2014, 11:31:22 AM
Hello
For which VirtueMart version?
I'm using Virtuemart 2.6.0a and Joomla 5.19 on PHP 5.4.20.
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: alatak on May 14, 2014, 09:21:52 AM
Hello
I am not able to reproduce your problem, so i probably don't do it the same way as you. Can u contact me via skype and show me?
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: klattr1 on May 14, 2014, 17:51:43 PM
Valerie, check your PM. Just sent you a Skype invite.
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: alatak on May 14, 2014, 20:12:15 PM
Hello
Thank you for showing me the problem.
in file  plugins/vmpayment/paypal/paypal/helpers/paypalexp.php
after this line (line 145)
$post_variables['SHIPTONAME'] = isset($addressST->first_name) ? $this->truncate($addressST->first_name, 50) : '';

I have added this line
$post_variables['SHIPTONAME'] .= isset($addressST->last_name) ? ' '.$this->truncate($addressST->last_name, 50) : '';


This fix will be in the next release.
Title: Re: Paypal Pro plugin not passing last name of ship to address to Paypal
Post by: klattr1 on May 14, 2014, 20:29:53 PM
Thanks Valerie for your help...fix works perfectly.