Search code examples
ioscredit-cardmagnetic-cardsusaepay

ios usaepay magstripe credit card data, send for processing


In my application I use online payment, for that i used PaySabar device (audio jack device) which reads magstrip data on credit card swipe.

I got credit data in encrypted format, all track1, track2 data are correct and perfect, but how to i send that data to USAePAY server. Please help.


Solution

  • I believe USAePay requires the encrypted data to be:

    1. Encrypted with their public key
    2. Formatted in a specific manner
    3. Passed in magstripe or credit card number field

    Because you are using their PaySaber hardware, see below for step 3.

    USAePay Wiki - End To End Encryption:

    If you are using idynamo library, here is what you need to do:

    NSString *responseString = [mtSCRALib getResponseData];
    NSData *responseData = [responseString dataUsingEncoding:NSASCIIStringEncoding];
    NSString *encodedString = [NSString stringWithFormat:@"enc://%@", [^] [responseData base64Encoding]];

    and then send encodedString to the gateway as MagStripe.