Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 04-08-2011 18:45:23

bbac
Member
From: Bristol, UK
Registered: 08-25-2008
Posts: 141

HSBC Interface - problems with countries beginning with A or B

If you're getting failed transactions through the HSBC gateway from customers living in Australia, Belgium or Argentina (to name a few) then this is the reason:

HSBC use a country code that is three digits long. So Australia should be 036, but it's stored in the gbu0_country table as just 36. This then rejected by the HSBC gateway because it's not three digits long.

To correct this, edit the script in the payment method from

Code:

foreach ($result as $num => $row) {
     $tmp[14] = $row['hsbccode'] ;
}

to

Code:

foreach ($result as $num => $row) {
     $tmp[14] = sprintf ('%03s', $row['hsbccode'] ) ;
}

I don't have Whatevercart 7, only v6, but unless the country code is now stored in the database as the three digit version (ie 036 not 36) then WC7 will also have the same problem, from the source code shown in https://forum.kryptronic.com/viewtopic. … 96#p134296

Offline

 

#2 04-22-2011 04:58:52

ruthdillon14
Member
Registered: 04-22-2011
Posts: 1

Re: HSBC Interface - problems with countries beginning with A or B

bbac wrote:

If you're getting failed transactions through the HSBC gateway from customers living in Australia, Belgium or Argentina (to name a few) then this is the reason:

HSBC use a country code that is three digits long. So Australia should be 036, but it's stored in the gbu0_country table as just 36. This then rejected by the HSBC gateway because it's not three digits long.

To correct this, edit the script in the payment method from

Code:

foreach ($result as $num => $row) {
     $tmp[14] = $row['hsbccode'] ;
}

to

Code:

foreach ($result as $num => $row) {
     $tmp[14] = sprintf ('%03s', $row['hsbccode'] ) ;
}

I don't have Whatevercart 7, only v6, but unless the country code is now stored in the database as the three digit version (ie 036 not 36) then WC7 will also have the same problem, from the source code shown in https://forum.kryptronic.com/viewtopic. … 96#p134296

Great site here. Lots of websites like this cover subjects that just aren’t covered by magazines.



Offline

 

Board footer