From cab03fa16190d1db225832cd6b11ef98ac971059 Mon Sep 17 00:00:00 2001 From: arskinner Date: Fri, 28 Apr 2017 09:55:20 -0700 Subject: [PATCH] Move CVV setting to property instead of function parameter --- iphone/Classes/ComLikelysoftCardioModule.h | 1 + iphone/Classes/ComLikelysoftCardioModule.m | 18 ++++++++---------- iphone/manifest | 4 ++-- iphone/titanium.xcconfig | 4 ++-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/iphone/Classes/ComLikelysoftCardioModule.h b/iphone/Classes/ComLikelysoftCardioModule.h index 2b16a05..f114e01 100644 --- a/iphone/Classes/ComLikelysoftCardioModule.h +++ b/iphone/Classes/ComLikelysoftCardioModule.h @@ -13,6 +13,7 @@ KrollCallback * _callback; BOOL paypalLogo; BOOL cardIOLogo; + BOOL collectCVV; NSString* locale; UIColor *guideColor; } diff --git a/iphone/Classes/ComLikelysoftCardioModule.m b/iphone/Classes/ComLikelysoftCardioModule.m index 5957713..49ce286 100644 --- a/iphone/Classes/ComLikelysoftCardioModule.m +++ b/iphone/Classes/ComLikelysoftCardioModule.m @@ -39,6 +39,7 @@ -(void)startup paypalLogo = YES; cardIOLogo = NO; + collectCVV = YES; locale = @"en"; NSLog(@"[INFO] %@ loaded",self); @@ -112,6 +113,11 @@ -(void)setCardIOLogo:(id)value { cardIOLogo = [numValue boolValue]; } +-(void)setCollectCVV:(id)value { + NSNumber * numValue = [value retain]; + cardIOLogo = [numValue boolValue]; +} + -(id)guideColor { return [[[TiColor alloc] initWithColor:guideColor name:@"#fff"] autorelease]; } @@ -147,20 +153,12 @@ - (void)scanCard:(id)args { scanViewController.hideCardIOLogo = !paypalLogo; scanViewController.useCardIOLogo = cardIOLogo; scanViewController.languageOrLocale = locale; + scanViewController.collectCVV = collectCVV; if (guideColor) { scanViewController.guideColor = guideColor; } - - if([args length]> 1) - { - NSString* isCVVtoShow =[args objectAtIndex:1]; - if([isCVVtoShow isEqualToString:@"N"]) - scanViewController.collectCVV= NO; - else if([isCVVtoShow isEqualToString:@"Y"]) - scanViewController.collectCVV= YES; - } - + [[TiApp app] showModalController:scanViewController animated:YES]; } diff --git a/iphone/manifest b/iphone/manifest index 64c4c74..b6b1422 100644 --- a/iphone/manifest +++ b/iphone/manifest @@ -2,13 +2,13 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 2.0.1 +version: 2.0.2 apiversion: 2 architectures: armv7 arm64 i386 x86_64 description: Appcelerator wrapper for the Card.io credit card scanning library. Use the phone's camera to read credit card numbers and expiration dates. author: Likely Solutions license: Free -copyright: Copyright (c) 2015 by Likely Solutions +copyright: Copyright (c) 2017 by Likely Solutions # these should not be edited name: Card.io diff --git a/iphone/titanium.xcconfig b/iphone/titanium.xcconfig index 6bb8984..c139c10 100644 --- a/iphone/titanium.xcconfig +++ b/iphone/titanium.xcconfig @@ -4,13 +4,13 @@ // OF YOUR TITANIUM SDK YOU'RE BUILDING FOR // // -TITANIUM_SDK_VERSION = 5.0.2.GA +TITANIUM_SDK_VERSION = 6.0.3.GA // // THESE SHOULD BE OK GENERALLY AS-IS // -TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/5.0.2.GA +TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/6.0.3.GA TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include" TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore" TITANIUM_BASE_SDK3 = "$(TITANIUM_SDK)/iphone/include/JavaScriptCore"