When forwarded to SagePay, the first name is duplicated. For example, if I enter Bob Bobson into my site's form, after being forwarded to SagePay it says 'BobBob Bobson.' After contacting SagePay, they sent me the following log from their test. I tried looking through the module files for the billingfirstnames and deliveryfirstnames variables, but I couldn't find them:
09/04/2014 04:22:56 vpsprotocol=3.0 txtype=PAYMENT paymenttype=PAYMENT vendor=tdspares vendorname= accounttype= username= website= vendordata= vendortxcode=41545_403490102 amount=13.94 currency=GBP description=Your order from TDSpares vspterminal= address= postcode= billingpostcode=A11 1AA billingaddress= deliveryaddress= deliverypostcode=A11 1AA contactnumber= contactfax= customeremail=person@place.com basket=2:blb1097:1.00:8.29:1.66:9.95:9.95:Standard shipping (UK):1.00:3.99:0.00:3.99:3.99 allowgiftaid=0 applyavscv2=0 billingsurname=Test billingfirstnames=SagePaySagePay billingaddress1=North Park billingaddress2= billingcity=Newcastle upon Tyne billingcountry=GB billingstate= billingphone= deliverysurname=Test deliveryfirstnames=SagePaySagePay deliveryaddress1=North Park deliveryaddress2= deliverycity=Newcastle upon Tyne deliverycountry=GB deliverystate= deliveryphone= referrerid= billingagreement= token= storetoken= basketxml= customerxml= surchargexml= firecipientacctnumber= firecipientdob=
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | fix_first_name_duplication-2250003-3.patch | 921 bytes | abasso |
Comments
Comment #1
bkno commentedI'm experiencing this as well (Server iframe).
Comment #2
bkno commentedAlso noticed this happens when the Commerce billing information address is has separate first name and last name, or a single name field.
Comment #3
abasso commentedThe problem is in _commerce_sagepay_format_customer_name (includes/commerce_sagepay_utils.inc). The function checks for multiple first names and concatenates them, the problem is that if there is only one value in the array, the first name is appended to itself.
Fixed issue, patch attached; please review so that it can be committed.
Comment #5
ikos commentedThanks for the patch - now committed.