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:
- you will see:Code:my ($nAreaCode, $nPart1, $nPart2);
- replace this with: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);
This will then always pass the phone number entered in Actinic to the 'night_phone_b' variable at Paypal and will then display in the phone field at Paypal, however, we can't guarantee that this will work for all variations of phone numbers (ie US/UK/ with spaces / without spaces etc). I would think that if the majority of customers are from the UK then this will work but you would need to test it further for customers from other countries.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...?
'country' is included in the html variable for prepopulating Paypal payment pages... according to the Paypal integration pdf.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);
It seems a bit duff that the original OCCPaypalTemplate doesnt pass on ; phone number, email address, or country ! doesnt it?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...
although the country is a 2 digit code..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:
- after the above enter:Code:AddPostValues ('&', 'zip', $::InvoiceContact{POSTALCODE}, $OPTION, $REDIRECT);
This should translate UK to GB if necessary and pass the country across. Don't change the country code in the locations list as this could cause problems elsewhere. Obviously, take a backup of your perl file before changing it.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?
Many thanks in advanceAddPostValues ('&', '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;
Good luck,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