IOS:card.io use

Source: Internet
Author: User

Recent projects to use a function: by scanning the bank card, to obtain the bank card number, after the online search, chose the Card.io this SDK, the process is as follows:

(1) Download Card.io

Card.io is a phone camera to get credit card information, the middle of the use of OCR (optical character recognition) scanning technology to return results, it also launched the SDK (software Development Kit), so that developers can add card.io to their own applications. The latest SDK can be downloaded from Https://github.com/paypal/PayPal-iOS-SDK

(2) Add to Project

1, drag the downloaded SDK package named Cardio to the project, in Targets-build Phases-link Binary with Librarys Add the following dependent library

* Audiotoolbox

* Avfoundation

* Coregraphics

* CoreMedia

* Corevideo

* Foundation

* Mobilecoreservices

* Opengles

* Quartzcore

* Security

* UIKit

If it is a XCODE5 or an updated version, just add the following library

* Avfoundation

* Audiotoolbox

* CoreMedia

* Mobilecoreservices

and make sure that both of the build settings are yes:

* Enable Modules (C and Objective-c)

    * Link Frameworks automatically



2.Add in Targets-build settings -lc++ to other Linker Flags
(3) Use

I'm using it as a Viewcontroller class

Code:

Import

#import "CardIO.h"

#import "CardIOPaymentViewControllerDelegate.h"



-(void) Viewwillappear: (BOOL) Animated {

[Super viewwillappear:animated];

[Cardioutilities preload];

}

Start scanning

-(Ibaction) Scancard: (ID) sender

{

Cardiopaymentviewcontroller *scanviewcontroller = [[Cardiopaymentviewcontroller alloc] Initwithpaymentdelegate:self ];

[Self Presentviewcontroller:scanviewcontroller animated:yes completion:nil];

}

Here is the Proxy method

Cancel Scan

-(void) Userdidcancelpaymentviewcontroller: (Cardiopaymentviewcontroller *) Scanviewcontroller

{

NSLog (@ "User canceled payment info");

Handle User Cancellation here ...

[Scanviewcontroller Dismissviewcontrolleranimated:yes Completion:nil];

}

Scan complete

-(void) Userdidprovidecreditcardinfo: (cardiocreditcardinfo *) Info inpaymentviewcontroller: ( Cardiopaymentviewcontroller *) Scanviewcontroller

{

//Scan results

NSLog (@ "Received card info. Number:%@, expiry:%02i/%i, CVV:%@. ", Info.redactedcardnumber, Info.expirymonth, Info.expiryyear, INFO.CVV);

Use the card info ...

[Scanviewcontroller Dismissviewcontrolleranimated:yes Completion:nil];

}





IOS:card.io use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.