Parse credit card data using ID TECH UniPay Smart Card Reader - ios

I'm developing iOS app using "UniPay, Mobile Audio Jack MagStripe and Smart Card Reader"
to read smart credit card data.
I got the card data but it is not plain text, the SDK does not show how to parse the data. I have set the encryption mode to unencrypted mode. I guess the data is encoded in some kind of format. I have used the same decoding I use to parse magnetic stripe data but it did not work. does anyone know what kind of encoding is used or if the is kind of encrypted regards the flag i set. The following code is the example provided from SDK, I need to parse the rt.data to get credit card information such as card Number.
RDResult rt =[reader smart_ICC_PowerOn]; if (rt.status != RDS_SUCCESS) {
NSLog(#"ICC Powerd On - Failed.");
return; }
Else
{
NSLog(#"ICC Powered On: %#", rt.data.description); }
Thanks in advance,

Related

How to receive the verify data from bank in Core

I'm using this code to receive the verify data from bank API (Persian bank)
saleReferenceId = long.Parse(queryString["SaleReferenceId"].ToString());
saleOrderId = long.Parse(queryString["SaleOrderId"].ToString());
resultCode_bpPayRequest = queryString["ResCode"].ToString();
But After the user has paid the amount the SaleRefrenceId and other fields are empty. I wanna know how to receive these fields from bank API?
I used to receive it in asp.net.mvc by
Request.param["saleReferenceId"]
But know, I don't know how to take it in ASP.netcore
Plz help me with

Nexmo - Select from number based on location of destination to number

In Twilio there's an concept of phone # pools. A txt message can be sent using this Pools Id value and Twilio will select the best FROM number to send with. I've looked around Nexmos API's and I don't see similar capabilities, is this possible?
The only other option I've found is something call applications but I can't send messages without manually selecting the from numbers instead of automating it via application Id, I assume that would be one of the 'use cases'
There's a document from Nexmo https://help.nexmo.com/hc/en-us/articles/217571017-What-is-a-Sender-ID- that has the following
Random Numeric - Nexmo will apply a random number to comply with local regulations (usually taken from a pool of numbers we have access to from the relevant destination market).
Problem is how do I configure Random Numeric? It doesn't really explain and I might have missed those docs. Any suggestion help.
Random numeric is not something you set, is something the Nexmo API does in order to ensure delivery in certain parts of the world, in order to conform with local regulations.
There is no Pools concept in Nexmo at the moment, so if you want the same functionality you'd have to build it in your code. Rent a bunch of Nexmo phone numbers, and then apply a random algorithm of choice in your code before sending each message to select your phone number. Something like:
let myNexmoNumbers = [447481234567, 447481234568, 447481234569]
nexmo.message.sendSms(myNexmoNumbers[Math.floor(Math.random() * myNexmoNumbers.length)], TO_NUMBER, TEXT_MESAGE, (err, responseData) => {
if (err) {
console.log(err);
} else {
if(responseData.messages[0]['status'] === "0") {
console.log("Message sent successfully.");
} else {
console.log(`Message failed with error: ${responseData.messages[0]['error-text']}`);
}
}
})

How to get the original_application_version (the first purchased version number) out of iOS Receipt in iOS 11?

I have a paid iOS App.
I need to get the original_application_version number (the first version purchased by the user) from the Apple AppStore Receipt.
To get the receipt, when my app loads, I use checkReceiptFromAppStore() function:
func checkReceiptFromAppStore() {
let receipt = self.getReceipt()
print("receipt Data is: \(receipt)") // prints this: receipt Data is: Optional(5141 bytes)
}
getReceipt() function is the following:
func getReceipt() -> Data? {
if Bundle.main.appStoreReceiptURL != nil {
print("app receipt: \(Bundle.main.appStoreReceiptURL)")
do {
let receiptData = try Data(contentsOf: Bundle.main.appStoreReceiptURL!)
return receiptData
} catch {
print("error converting receipt to Data: \(error.localizedDescription)")
}
}
return nil
}
I've watched WWDC 2017 Advanced StoreKit video about In App purchases and receipt validation and WWDC 2013 Video about using Receipts, read different
resources related to my problem (this, this, this, this, this, this, and this...), but I still don't understand what to do next to get the
"original_application_version" from the App Store Receipt. I need only this field and don't understand why is it so hard to get it.
I've read this too: https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html
I think that the receipt is not nil as long at when I run print("receipt Data is: (receipt)") it prints this: receipt Data is: Optional(5141 bytes)
I can suppose that I should parse the receipt to get that field. Can I do it using Decodable? Is there the easiest way to get this original_application_version field? Is it possible to do this without a receipt validation?
I need to get the original_application_version field only to detect the number of the first version bought by the user. If you know any other solutions to get the first purchased version number, I'd be glad to hear them.
I'm developing in Xcode 9, Swift 4, iOS 11
Any answers appreciated, thanks.
All receipt fields are in binary format within application receipt. You should use any kind of app receipt decoder in order to get original_application_version. It is always good thing to validate app receipt before using its contents. For example, you can use RMStore framework (RMStore). It contains receipt validator as well as decoder. Example Obj-C source:
RMAppReceipt *appReceipt = RMAppReceipt.bundleReceipt;
if (appReceipt != nil &&
[appReceipt.originalAppVersion length] > 0 &&
![appReceipt.originalAppVersion isEqualToString:#"1.0"]) {
//Process your original app version
} else {
//Probably it is sandbox mode or app install via Xcode
//Or maybe you should force app receipt refresh
}

How to input secure CVV number of credit card in watch app via dictation?

I have to enter CVV number of credit card in watch app designed on watch OS2 sdk via dictation.But number is printing as it is.
Not as secure keys.
let textChoices = ["123","124","236","456", "345", "Seriously, just order Pizza!!"]
presentTextInputControllerWithSuggestions(textChoices,
allowedInputMode: WKTextInputMode.Plain,
completion: {(results) -> Void in
if results != nil && results!.count > 0 { //selection made
let aResult = results?[0] as? String
self.labelPrint.setText(aResult)
//{
//self.labelPrint.setText(aResult)
//}
}})
Can anyone suggest how to make the numbers entered as secure keys?
Thanks
I created one demo for secure text entry in Apple Watch to accomplish my requirement.I think it would also help you. I uploaded code to my git account. Here I sharing link of Project Repo :
https://github.com/sagargondaliya/SecureTextInputForAppleWatch
Input Controller for Apple Watch

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.
I believe USAePay requires the encrypted data to be:
Encrypted with their public key
Formatted in a specific manner
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.
You will need to integrate your application with one of their transaction interfaces. You will also need a developer account for testing transaction responses.
They have a wide array of different integration solutions and source code examples to use, including an iOS library.
http://wiki.usaepay.com/developer/Support

Resources