如何使用用于Cordova的card.io插件在adroid设备中隐藏PayPal徽标

问题描述 投票:0回答:1

根据插件文档,似乎没有配置选项可将PayPal徽标隐藏在卡片详细信息操作栏中。但是,用于Android的card.io SDK可以选择执行此操作:

https://card-io.github.io/card.io-Android-SDK/io/card/payment/CardIOActivity.html#EXTRA_USE_PAYPAL_ACTIONBAR_ICON

是否有隐藏此徽标的方法?

cordova ionic-framework cordova-plugins ionic4 card.io
1个回答
1
投票

是的,有一种方法。

首先,您必须删除android平台才能从头开始下载所有依赖项:

ionic cordova platform remove Android

然后,添加card.io cordova插件:

ionic cordova plugin add card.io.cordova.mobilesdk

Taht之后,在“ plugins / card.io.cordova.mobilesdk / src / android”中,您必须在2个文件中进行更改:

的build.gradle替换

dependencies {
  compile 'io.card:android-sdk:5.4.0'
}

通过此:

dependencies {
  compile 'io.card:android-sdk:5.5.1'
}

在文件[[CardIOCordovaPlugin.java]中,您必须添加新的配置选项EXTRA_USE_PAYPAL_ACTIONBAR_ICON: private void scan(JSONArray args) throws JSONException { Intent scanIntent = new Intent(this.activity, CardIOActivity.class); JSONObject configurations = args.getJSONObject(0); // customize these values to suit your needs. scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, this.getConfiguration(configurations, "requireExpiry", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, this.getConfiguration(configurations, "requireCVV", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, this.getConfiguration(configurations, "requirePostalCode", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, this.getConfiguration(configurations, "suppressManual", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_RESTRICT_POSTAL_CODE_TO_NUMERIC_ONLY, this.getConfiguration(configurations, "restrictPostalCodeToNumericOnly", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_KEEP_APPLICATION_THEME, this.getConfiguration(configurations, "keepApplicationTheme", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CARDHOLDER_NAME, this.getConfiguration(configurations, "requireCardholderName", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_USE_CARDIO_LOGO, this.getConfiguration(configurations, "useCardIOLogo", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_INSTRUCTIONS, this.getConfiguration(configurations, "scanInstructions", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_NO_CAMERA, this.getConfiguration(configurations, "noCamera", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, this.getConfiguration(configurations, "scanExpiry", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_LANGUAGE_OR_LOCALE, this.getConfiguration(configurations, "languageOrLocale", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_GUIDE_COLOR, this.getConfiguration(configurations, "guideColor", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_CONFIRMATION, this.getConfiguration(configurations, "suppressConfirmation", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_HIDE_CARDIO_LOGO, this.getConfiguration(configurations, "hideCardIOLogo", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_SCAN, this.getConfiguration(configurations, "suppressScan", false)); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_USE_PAYPAL_ACTIONBAR_ICON, false); // THIS IS THE NEW OPTION this.cordova.startActivityForResult(this, scanIntent, REQUEST_CARD_SCAN); }

在这种情况下,我将此新选项硬编码为false,但是您可以实现getConfiguration()方法来从您的离子页面设置此选项。

一旦完成这两项更改,将您的android平台再次添加到您的项目中(以下载最新的SDK v5.5.1):

ionic cordova platfrom add android

仅此而已,PayPal徽标已消失!
© www.soinside.com 2019 - 2024. All rights reserved.