cancel
Showing results for 
Search instead for 
Did you mean: 

Track1 Data VS Track2 Data

Hello,

 

I have built a custom online POS system and im having some issues with trackdata1 VS trackdata2

 

The credit cards that are swiped come in different formats

 

I know that Track 1 should look like this
B4000000000000002^CardUser/John^131210100000019301000000877000000?

 

and track 2 looks like this
4000000000000002=1312101193010877?

 

BUT

 

What if the string contains BOTH formats:

 

Here is an example of what one looks like:

B4000000000000002^CardUser/John^131210100000019301000000877000000?;4000000000000002=1312101193010877?

As you can see it contains both formats!! this will tosses an error when trying to run as a Track1 data

 

 

my only solution is in PHP explode at the ; and take the first part of the string if ; is present!!

then run them as a trackdata1 value

 

would like to know if anyone else has experenced the issue or am im missing something here

 

YAC
Member
1 REPLY 1

I'd say that the data is what it is, and if the solution is as simple as it seems, why not just patch for that and move on? Just split on the ; and use the first item from the resulting array - a length test will tell you whether it's track 1 or 2.

TJPride
Expert