Credit card swipe info

I am using credit card swipe reader to get the credit card info on Web page. I am successful to get the info of credit card on Web page. But it is a long string and I get it in 1 field. I know I have to split it but I don't know how.

I have seen lot of examples on internet to splitting credit card string but the string I get is different than example so that's why I want help that can any body provide short javascript code for spliting this info?

<script type="text/javascript"> function CreditCardswipe(){ var card_data = "B4888940130123456^DOE/JOHN L^18022010000000000000000000000000002120010004888123456789123=18022010000012345678"; } </script>

-------------Problems Reply------------

I would recommend attempting to reformat the swipe data to be inline with most magstripe readers. Typically the track 1 begin is "%B" and end is "?", the track 2 is ";" and "?".

Swipe:
%B4003000123456781^DOE/JOHN L^151250254321987123456789012345?;4003000123456781=15125025432198712345?

Track 1:
%B4003000123456781^DOE/JOHN L^151250254321987123456789012345?

Track 2:
;4003000123456781=15125025432198712345?

Also, what data are you specifically attempting to get outside of the Name, Card Number and Exp? Those are typically all in track 1 for you.

Card #: 4888940130123456
Name: ^DOE/JOHN L^
Exp: 1802

How about simple regex?

output = card_data.split(/\^/);

That way you get

["B4888940130123456",
"DOE/JOHN L",
"18022010000000000000000000000000002120010004888123456789123=18022010000012345678"]

if you want the last one split too you can do once again

numbers = output[2].split(/\=/);

which will give you

["18022010000000000000000000000000002120010004888123456789123",
"18022010000012345678"]

Category:javascript Views:0 Time:2018-02-11

Related post

  • Windows mobile device with credit card swipe and printer? 2009-07-08

    We're looking to produce a custopm application for a client written in .Net. The application will have a basic inventory and the user will sell an item, swipe the customer's credit card and take the payment. Is there a device that runs Windows Mobile

  • is microsoft working on a upgrade that will allow window phone to work with a credit card swipe? 2014-05-22

    Is Microsoft going to provide an APP or upgrade for Windows Phone 8 that will allow the use of a credit card readers that PayPal, Intuit, and Square are providing to their merchant customers? If the answer is yes when will it be available? If the ans

  • Why does Microsoft need my credit card/paypal info to "purchase" a free game? 2014-09-30

    I am not interested in giving my credit card info to Microsoft to purchase a "free" game. What's the guarantee that NSAsoft won't misuse this? They have been in bed with the NSA for a long time and now they want to know exactly who you are... Since I

  • Write my own iPhone app to read from credit card swipe reader 2011-01-11

    I'm looking for a way to write my own app that can support credit card payment but using the credit card readers such as Blue Bamboo P25-M or MagTek iDynamo. I'm pretty sure there's a way to do this, but I don't know what to do. Do you think I need t

  • Credit Card Swiper Javascript Keeps Going 2011-10-06

    I've got a script that binds to the keyup event as a page is loaded, this sets the cursor into the first field and then when the credit card is swiped it chops up the magnetic stripes data, but currently the code seems to be running multiple times an

  • need to update credit card payment info 2012-03-17

    I was notified that my credit card needs to be updated so the payment can be automatically withdrawn. Where and how do I do that? --------------Solutions------------- How do I update my information so you can do an auto pay like you have been ? Why d

  • credit card swiper for window 8 2014-04-15

    I found an app in the nokia store I haven't tried it yet,its got 15 reviews n only 2 dislikes its compatiable with windows 8 its called cube credit card terminal --------------Solutions------------- Not heard of this one. We found that none of the bi

  • Credit Card Swiper Format 2012-03-11

    I have a magnetic card reader and I'm trying to parse the information in my ColdFusion site to send off to PayPal. However, I can't seem to get the 3 digit CV code on the back. Here's the format I get: %B4444555566667777^DOE/JOHN G^100510101010101060

  • APIs for magtek magnetic credit card readers 2010-02-03

    All, I need to develop a kiosk application which needs to communicate with a magtek magnetic credit card reader. I know the readers come with drivers, but any one know of "high-level" APIs? For example, in C++, C#, JAVA? --------------Solutions------

  • iPhone: How to gather Credit Card information upon swiping with device attached to it? 2011-05-30

    I want to add credit card swipe feature to my application. What do I need to make it work? All I need is 1. Swipe the card 2. Populate the fields on the view with the card info 3. Store that populated into database(I have an idea in this db part), wh

  • How to print a bill after swapping a credit card from Iphone? 2011-08-07

    I am coding for a project like credit card swipping and get a bill..They are using two portable printers easy to get a bill while delivery..After he enters the amount and i need to connect to the webserver and get bill for that .The bill has to be pr

  • Credit card hardware and API for WP7 2011-10-09

    Is there a hardware credit card swipe, like square up, for Windows phone 7 that also includes an API to get the credit card data? --------------Solutions------------- A quick google search reveals this http://www.wpcentral.com/accumulus-develops-cred

  • Windows Phone 8.1. Wallet App does not update Credit Card Information 2013-03-14

    I updated the expiration of my credit card via the Outlook.com website for my account. Unfortunately the "Wallet" app on my Lumia 920 Windows Phone 8.1 won't update to reflect the correct expiration. I keep hitting "refresh" but it still says the old

  • How do cancel a Zune account online. The account says that there is no subscription but my credit card is being charged monthly. We no longer have the Zune and want to CANCEL the account 2013-05-19

    Want to remove my credit card account info, no longer use Zune, need to cancel account. Can we do that online? --------------Solutions------------- Hi Leslie, You are going to have to call support directly at 1-877-GET-ZUNE to straighten that one out

  • storing credit card info 2009-11-19

    So I would like to modify a PHP / MySQL application in order to store credit card but not cvv and bank account info securely. PCI DSS require 1024 RSA/DSA. A small number of users will be given private key in order to decrypt the batch file of accoun

  • need to store credit card info. what's my best option? 2010-09-18

    I'm building an auction website that charge small fee for each bid. There is option to buy bank of bids, and there is an option to pay separately for each bid. When paying for each bid - I don't want to ask the user to re-enter the credit card info e

  • Alternative to storing credit card info 2010-11-04

    Possible Duplicate: Storing credit card details I'm working on creating an architecture for a site where users can login and buy products. My boss would like the checkout page to remember the user's credit card info so they don't have to enter it eve

  • Why does Zune need my credit card info? 2012-08-08

    I thought that Zune was free on the new windows phone. I don't want to give out the info but I really want to download. --------------Solutions------------- Hello Trish a pooh, There is no charge for signing up. However, keep in mind that downloading

  • Credit card info "invalid" 2012-10-18

    When i try to add a credit card to my zune account it says the credit card info is invalid, iv made sure everything is correct and up to date. so whats wrong? Any help would be nice. Thanks --------------Solutions------------- When i try to add a cre

  • Adding Indian Credit Card Info 2012-02-02

    I am not able to add my credit card info in zune, because im from india, and option for selecting india is disabled, but INR 2 have been detected every time i try adding the card. Also the signin option is disabled, so i am using WP7 Marketplace enba

  • old credit card info is holding my account hostage! 2012-02-16

    Hello I am trying to delete an invalid credit card on account. I added a valid card YET I CAN NOT REMOVE THE BAD CARD DUE TO A PENDING BILLING ISSUE?! how can i contact msoft support to get help mai a postcard? I can not update my info despite wastin

  • The Credit Card info isn't VALID !!! WHY?! 2012-03-07

    Now other problem raised: The Credit Card info isn't VALID !!! WHY?! --------------Solutions------------- humor me and double check you entered the correct number, expiry date, securty code and probably phone number associated with the card. I've see

  • We are trying to get past the parental control page where it asks for my credit card info. 2012-03-27

    see in title, cannot get past the parental info page... I submit all credit card info and hit submit and it doesn't go anywhere, Son is just trying to get an ID so he can play xbox live, it's all quite frustrating.... also, to keep writing my problem

  • How do I Know that I have a secure connection when sending credit card info? 2012-04-01

    On previous versions of Internet Explorer an Icon was on the Menu Bar that indicated the securety level of the connection before tranmission of credit card info, etc. In IE 9 no such icons are present. How do I monitor the security of the connection

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.187 (s). 11 q(s)