arskinner / Appcelerator-CardIO

Appcelerator wrapper for the Card.io credit card scanning library. Use the phone's camera to read credit card numbers and expiration dates.
Other
44 stars 25 forks source link

Hide PayPal logo? #8

Closed adamkearsley closed 7 years ago

adamkearsley commented 8 years ago

Hi. Great job with the module. Its working great in my application, but i would like to hide the PayPal logo as I'm using STRIPE. Can you add an option to hide the PayPal logo like in the original card.io plugin?

crberko commented 8 years ago

I second this request!

On Wed, Feb 17, 2016 at 9:48 AM, adamkearsley notifications@github.com wrote:

Hi. Great job with the module. Its working great in my application, but i would like to hide the PayPal logo as I'm using STRIPE. Can you add an option to hide the PayPal logo like in the original card.io plugin?

— Reply to this email directly or view it on GitHub https://github.com/arskinner/Appcelerator-CardIO/issues/8.

yozef commented 8 years ago

Actually it is possible:

On iOS: https://github.com/arskinner/Appcelerator-CardIO/blob/master/iphone/Classes/ComLikelysoftCardioModule.m

- (void)scanCard:(id)args {
    ENSURE_UI_THREAD(scanCard,args);

    _callback = [[args objectAtIndex:0] retain];

    CardIOPaymentViewController *scanViewController = [[[CardIOPaymentViewController alloc] initWithPaymentDelegate:self] autorelease];
    scanViewController.hideCardIOLogo = YES; // right here

    [[TiApp app] showModalController:scanViewController animated:YES];
}

Probably ideal to pass this bool as part of the args.

On Android: https://github.com/arskinner/Appcelerator-CardIO/blob/master/android/src/com/likelysoft/cardio/CardIOModule.java (Add @ line 71)

scanIntent.putExtra(CardIOActivity.EXTRA_HIDE_CARDIO_LOGO, true); // default: false
scanIntent.putExtra(CardIOActivity.EXTRA_USE_PAYPAL_ACTIONBAR_ICON, false); // default: true
psyzz commented 8 years ago

Thanks @yozef it works!

i just add ".getIntent()" after "scanIntent" like that:

scanIntent.getIntent().putExtra(CardIOActivity.EXTRA_HIDE_CARDIO_LOGO, true); // default: false
scanIntent.getIntent().putExtra(CardIOActivity.EXTRA_USE_PAYPAL_ACTIONBAR_ICON, false); // default: true
yozef commented 8 years ago

Is it possible to send a Pull Request for @arskinner so it can be provided to everybody else?

psyzz commented 8 years ago

idk, i successfuly compil the module but i got when try using in my app:

[ERROR] :  TiExceptionHandler: (main) [10,179815] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [0,179815] - In ti:/module.js:280,9
[ERROR] :  TiExceptionHandler: (main) [0,179815] - Message: Uncaught Error: Requested module not found: com.likelysoft.cardio
[ERROR] :  TiExceptionHandler: (main) [0,179815] - Source:      throw new Error("Requested module not found: " + request);
[ERROR] :  V8Exception: Exception occurred at ti:/module.js:280: Uncaught Error: Requested module not found: com.likelysoft.cardio
psyzz commented 8 years ago

oh i have this 2 lines when i compil the app:

[INFO] :   Found Titanium module id=com.likelysoft.cardio version=1.0.1 platform=android deploy-type=development path=/Users/jeremyroustang/Library/Application Support/Titanium/modules/android/com.likelysoft.cardio/1.0.1
[WARN] :   Module com.likelysoft.cardio version 1.0.1 does not have a main jar file
yozef commented 8 years ago

You may need to change the version number in manifest file.

Actually scrap that... I also had issues compiling, thats why I pasted the code :)

You might want to ask @arskinner or even better, for him to implement it (ideally by pass a Boolean param to display the logo or not).

psyzz commented 8 years ago

the problem is explain here: http://stackoverflow.com/questions/35497985/titanium-android-module-fails-with-does-not-have-a-main-jar-file

The name tag should be :"ios" in the manifest because the main .jar is "ios.jar" :

# these should not be edited
name: ios
moduleid: com.likelysoft.cardio
guid: c0304131-9611-4fff-9f83-f48bc9fa1714
platform: android
minsdk: 4.0.1

Working great now!

m1ga commented 7 years ago

I've updated the Android module to TiSDK 6 and added cardio.setCardIOLogo(false); and cardio.setPayPalLogo(false);: https://github.com/arskinner/Appcelerator-CardIO/pull/13

yozef commented 7 years ago

Any possibility of having the iOS version as well?

I found the Android version here: http://migaweb.de/com.likelysoft.cardio-android-2.0.1.zip

m1ga commented 7 years ago

not an iOS guy, sorry 😃 Someone else need to update it

yozef commented 7 years ago

My mistake @m1ga , I thought the owner updated it :) Thanks!

torlanco commented 7 years ago

Hey I too want this. Paypal logo makes me sad.

arskinner commented 7 years ago

This is an option as of 2.0.4