zoukankan      html  css  js  c++  java
  • 拍照识别银行卡卡号

    #import "ViewController.h"
    #import "CardIO.h"
    
    @interface ViewController ()<CardIOPaymentViewControllerDelegate>
    
    @end
    
    @implementation ViewController
    
    - (void)viewDidLoad {
        [super viewDidLoad];
    
        UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame = CGRectMake(100, 100, 100, 100);
        btn.backgroundColor  =[UIColor cyanColor];
        [btn  addTarget:self action:@selector(pressBtn) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:btn];
    }
    
    -(void)pressBtn{
        
        
        CardIOPaymentViewController *scanViewController = [[CardIOPaymentViewController alloc] initWithPaymentDelegate:self];
        scanViewController.modalPresentationStyle = UIModalPresentationFormSheet;
        [self presentViewController:scanViewController animated:YES completion:nil];
    
        
        
    }
    #pragma mark - CardIOPaymentViewControllerDelegate
    
    - (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)info inPaymentViewController:(CardIOPaymentViewController *)paymentViewController {
        NSLog(@"Scan succeeded with info: %@", info);
        // Do whatever needs to be done to deliver the purchased items.
        [self dismissViewControllerAnimated:YES completion:nil];
    
        UILabel * label = [[UILabel alloc]init];
        label.frame = CGRectMake(100, 250, 100, 100);
        label.text = [NSString stringWithFormat:@"Received card info. Number: %@, expiry: %02lu/%lu, cvv: %@.", info.redactedCardNumber, (unsigned long)info.expiryMonth, (unsigned long)info.expiryYear, info.cvv];
    }
    
    - (void)userDidCancelPaymentViewController:(CardIOPaymentViewController *)paymentViewController {
        NSLog(@"User cancelled scan");
        [self dismissViewControllerAnimated:YES completion:nil];
    }
    
    -(void)viewWillAppear:(BOOL)animated{
        [CardIOUtilities preload];
    }

  • 相关阅读:
    apache配置虚拟主机的三种方式
    mysql ddl语句
    MySQL锁机制
    如何卸载rpm包
    RAC SCAN
    oracle rac scan ip 用途 原理
    如何用udev for asm in oracle linux 6
    ORACLE RAC NTP 时间服务器配置
    对表空间 'USERS' 无权限
    bootstrap全局css样式
  • 原文地址:https://www.cnblogs.com/sayimba/p/5666273.html
Copyright © 2011-2022 走看看