Announcement
Collapse
No announcement yet.
order details passed to paypal
Collapse
X
-
Hi Mark,
We have a way of passing the telephone number but not sure what effect this will have at Paypal's end:
- first take a backup of your current 'OCCPayPalTemplate.pl' file in your 'site/CommonOCC' folder
- then open the file in a text editor such as 'notepad'
- locate the line:
Code:my ($nAreaCode, $nPart1, $nPart2);
Code:my ($nAreaCode, $nPart1, $nPart2); $nPart2 = $::InvoiceContact{PHONE}; if ($nPart2 =~ /(\d{3}).*(\d{3}).*(\d{4})/) { $nAreaCode = $1; $nPart1 = $2; $nPart2 = $3; } AddPostValues ('&', 'night_phone_a', $nAreaCode, $OPTION, $NOENCODE); AddPostValues ('&', 'night_phone_b', $nPart1, $OPTION, $NOENCODE); AddPostValues ('&', 'night_phone_c', $nPart2, $OPTION, $REDIRECT);
Code:AddPostValues ('&', 'night_phone_b', $::InvoiceContact{PHONE}, $OPTION, $NOENCODE);
********************
Tracey
SellerDeck
Comment
-
Well that does pass the phone number....
It adds a +44 at the start? Regardless of which country you choose... Cant see how it does that.
Whilst checking this using other countries, I've noticed that Actinic doesnt pass on the 'country' to Paypal..
Whichever country you choose, when you get to Paypal it lists it as UK.
Can we pass the country correctly to Paypal as well..?
How would we do that?
Best Regards,
Mark
http://www.arka-shop.co.uk
Comment
-
Looking at OCCPaypalTemplate.pl it doesnt look like the country variable is passed on to Paypal at all...?
Code:AddPostValues ('&', 'first_name', $sFirstName, $OPTION, $REDIRECT); AddPostValues ('&', 'last_name', $sLastName, $ALWAYS, $REDIRECT); AddPostValues ('&', 'address1', $::InvoiceContact{ADDRESS1}, $ALWAYS, $REDIRECT); AddPostValues ('&', 'address2', $::InvoiceContact{ADDRESS2}, $OPTION, $REDIRECT); AddPostValues ('&', 'city', $::InvoiceContact{ADDRESS3}, $OPTION, $REDIRECT); AddPostValues ('&', 'state', $::InvoiceContact{ADDRESS4}, $OPTION, $REDIRECT); AddPostValues ('&', 'zip', $::InvoiceContact{POSTALCODE}, $OPTION, $REDIRECT); AddPostValues ('&', 'night_phone_b', $::InvoiceContact{PHONE}, $OPTION, $NOENCODE); AddPostValues ('&', 'email', $::InvoiceContact{EMAIL}, $OPTION, $NOENCODE);
Code:TABLE A.8 HTML Variables for Prepoluating Payment Pages with Buyer Information Variable Description Requirements Character Limit address1 Street (1 of 2 fields) Alphanumeric 100 address2 Street (2 of 2 fields) Alphanumeric 100 city City Alphanumeric 40 country Sets shipping and billing country. See Appendix C for allowable country codes. Alphabetic 2 first_name First name Alphabetic 32 last_name Last name Alphabetic 64
So customers have to type this all in again at paypal.
I've adjusted the template so now 'email' gets populated.. and 'phone number' (sort of).. Now i want 'country' to be populated as well.
I've noticed that the country code in actinic for the UK is UK whereas Paypal wants it to be GB. I presume i can just change this in 'locations'
I just need the correct snippet of code to put in OCCPaypalTemplate.pl to pass the country code to Paypal.
I'm expecting its something like this...
Code:AddPostValues ('&', 'country', $::InvoiceContact{country}, $OPTION, $NOENCODE);
Any clues anyone?
Mark
Comment
-
Hi Mark,
Try the following:
- open 'OCCPaypalTemplate.pl' in your site folder and search for:
Code:AddPostValues ('&', 'zip', $::InvoiceContact{POSTALCODE}, $OPTION, $REDIRECT);
Code:my $sCountry = $::InvoiceContact{COUNTRY}; $sCountry =~ s/^GB$/UK/; AddPostValues ('&', 'country', $sCountry, $OPTION, $REDIRECT);
********************
Tracey
SellerDeck
Comment
-
Hi Tracey,
Thanks for that, but unfortunately, it doesnt seem to work.
After including tha above code, Arriving at the Paypal page.. the country is always United Kingdom, whichever country i choose at the Actinic page...
Best Regards,
Mark
http://www.arka-shop.co.uk
Comment
-
Hi Mark,
I got the developers to take another look at it and they have suggested using the following code (this passes the country code whereas the previous passed the country name):
Code:my $sCountry = $::g_LocationInfo{INVOICE_COUNTRY_CODE}; $sCountry =~ s/^GB$/UK/; AddPostValues ('&', 'country', $sCountry, $OPTION, $REDIRECT);
********************
Tracey
SellerDeck
Comment
-
Hi Tracey,
Thanks for that, it seems to work well now..
Its much better... if someone now for example chooses 'germany' as their country, the paypal page they land on is now in German!
All looks lots better. Thanks.
Mark
http://www.arka-shop.co.uk
Comment
-
Hi, I have the same problem as this (v6) and have followed these instructions carefully, yet only the email address is coming through properly.
The phone number is coming through although is being prefixed with +012 and then the number I've typed which also starts 012
The country code doesn't seem to be acknowledged if it's anything other than Uk for some reason.
Has there been any development on this issue since the last post on this thread does anyone know?
Many thanks
Michelle
Comment
-
Hi,
My set up is still working as it should, after following the above.
I'm afraid i dont know why yours shouldnt be... sorry,
Best Regards,
Mark
http://www.arka-shop.co.uk
Comment
-
Ok, thanks Mark.
This is my code snipet, I wonder if you or anyone might be able to spot the potential problem?
It's v6, I don't know if that makes a difference?
AddPostValues ('&', 'first_name', $sFirstName, $OPTION, $REDIRECT);
AddPostValues ('&', 'last_name', $sLastName, $ALWAYS, $REDIRECT);
AddPostValues ('&', 'address1', $::InvoiceContact{ADDRESS1}, $ALWAYS, $REDIRECT);
AddPostValues ('&', 'address2', $::InvoiceContact{ADDRESS2}, $OPTION, $REDIRECT);
AddPostValues ('&', 'city', $::InvoiceContact{ADDRESS3}, $OPTION, $REDIRECT);
AddPostValues ('&', 'state', $::InvoiceContact{ADDRESS4}, $OPTION, $REDIRECT);
AddPostValues ('&', 'zip', $::InvoiceContact{POSTALCODE}, $OPTION, $REDIRECT);
my $sCountry = $::g_LocationInfo{INVOICE_COUNTRY_CODE};
$sCountry =~ s/^GB$/UK/;
AddPostValues ('&', 'country', $sCountry, $OPTION, $REDIRECT);
my ($nAreaCode, $nPart1, $nPart2);
$nPart2 = $::InvoiceContact{PHONE};
if ($nPart2 =~ /(\d{3}).*(\d{3}).*(\d{4})/)
{
$nAreaCode = $1;
$nPart1 = $2;
$nPart2 = $3;
}
AddPostValues ('&', 'night_phone_a', $nAreaCode, $OPTION, $NOENCODE);
AddPostValues ('&', 'night_phone_b', $::InvoiceContact{PHONE}, $OPTION, $NOENCODE);
AddPostValues ('&', 'night_phone_c', $nPart2, $OPTION, $REDIRECT);
AddPostValues ('&', 'email', $::InvoiceContact{EMAIL}, $OPTION, $NOENCODE);
#
# end of the invoice address details
Michelle
Comment
-
Hi Michelle,
HHmm, your code doesnt look like mine, are you sure you followed the above carefully.. my code looks like this;
Code:# # supply the cardholder's address details # my ($sFirstName, $sLastName); $sLastName = $::InvoiceContact{NAME}; # default to a blank first name and complete last name if ($sLastName =~ /^([^ ]+) (.+)/) # if the name field looks to contain at least two name parts { $sFirstName = $1; # break the name up $sLastName = $2; } AddPostValues ('&', 'first_name', $sFirstName, $OPTION, $REDIRECT); AddPostValues ('&', 'last_name', $sLastName, $ALWAYS, $REDIRECT); AddPostValues ('&', 'address1', $::InvoiceContact{ADDRESS1}, $ALWAYS, $REDIRECT); AddPostValues ('&', 'address2', $::InvoiceContact{ADDRESS2}, $OPTION, $REDIRECT); AddPostValues ('&', 'city', $::InvoiceContact{ADDRESS3}, $OPTION, $REDIRECT); AddPostValues ('&', 'state', $::InvoiceContact{ADDRESS4}, $OPTION, $REDIRECT); AddPostValues ('&', 'zip', $::InvoiceContact{POSTALCODE}, $OPTION, $REDIRECT); my $sCountry = $::g_LocationInfo{INVOICE_COUNTRY_CODE}; $sCountry =~ s/^GB$/UK/; AddPostValues ('&', 'country', $sCountry, $OPTION, $REDIRECT); AddPostValues ('&', 'night_phone_b', $::InvoiceContact{PHONE}, $OPTION, $NOENCODE); AddPostValues ('&', 'email', $::InvoiceContact{EMAIL}, $OPTION, $NOENCODE); # # end of the invoice address details # #
Mark
Comment
Comment