Re: Fingerprint

Maksym
Regular Visitor

Fingerprint

Hi. I'm trying to integrate VisaCheckout SDK to my app. Payment on test environment works well, but if I check `fingerprint` checkbox while signing in, I've got this internal crash.

VisaCheckoutAndroidSdk-5.5.2

Android 8.1.0

Android gradle plugin 3.1.2

Android buildtools 27.0.3

 

05-07 13:42:59.495 1539-1539/dv.pay.app E/AndroidRuntime: FATAL EXCEPTION: main
    Process: dv.pay.app, PID: 1539
    java.lang.NullPointerException: throw with null exception
        at com.visa.internal.eo.<clinit>(Unknown Source:2390)
        at com.visa.internal.eo.ॱ(Unknown Source:0)
        at com.visa.internal.br.ʼ(:207)
        at com.visa.internal.bj$2.ˏ(:378)
        at com.visa.internal.b$2.run(:290)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

 PS. The manifest contains FINGERPRINT permissons. Also, there is a code which checks figerprint auth is set up and it seems fingerprint is available to use:

 

private fun initFingerPrint() {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
            Log.d("###", "This Android version does not support fingerprint authentication.")
        }

        val keyguardManager: KeyguardManager = getSystemService(KEYGUARD_SERVICE) as KeyguardManager
        val fingerprintManager: FingerprintManager = getSystemService(FINGERPRINT_SERVICE) as FingerprintManager

        if (!keyguardManager.isKeyguardSecure) {
            Log.d("###", "User hasn't enabled Lock Screen")
        }

        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
            Log.d("###", "User hasn't granted permission to use Fingerprint")
            return
        }

        if (!fingerprintManager.hasEnrolledFingerprints()) {
            Log.d("###", "User hasn't registered any fingerprints")
            return
        }
        Log.d("###", "Fingerprint authentication is set.\n")
    }

 

PPS. SDK initialization and usage code:

package dv.pay.app.ui.visa

import com.visa.checkout.Environment
import com.visa.checkout.Profile
import com.visa.checkout.PurchaseInfo
import java.math.BigDecimal

const val API_KEY = "BI0Z97V54UI244BTEICX21RzaaHSlS4VYjaaGqlwBPMivrDFU"
const val PROFILE = "SYSTEMDEFAULT"

fun createPurchase(): PurchaseInfo = PurchaseInfo
.PurchaseInfoBuilder(
BigDecimal("10.23"),
PurchaseInfo.Currency.USD
)
// .setShippingHandling(BigDecimal("0"))
// .setTax(BigDecimal("0"))
// .setDiscount(BigDecimal("0"))
// .setMisc(BigDecimal("0"))
// .setGiftWrap(BigDecimal("0"))
// .setDescription("Gift Card Order")
// .setOrderId("234-SD355-343432")
// .setReviewMessage("Gift Card Order")
// .setMerchantRequestId("345345345dsfs434343423234234")
// .setSourceId("test-source-id")
// .setPromoCode("test-promo-code")
// .setShippingAddressRequired(true)
// .setUserReviewAction(PurchaseInfo.UserReviewAction.PAY)
// .setThreeDSSetup(true, false)
// .setCustomData(hashMapOf("key" to "value"))
.build()

fun createPaymentProfile(): Profile = Profile
.ProfileBuilder(API_KEY, Environment.SANDBOX)
.setProfileName(PROFILE)
// .setDisplayName("DV pay demo")
// .setMerchantId("123")
// .setDataLevel(Profile.DataLevel.FULL)
// .setAcceptCanadianVisaDebit(true)
// .setEnableTokenization(true)
// .setCardBrands(cards)
// .setShippingCountries(shippingCountries)
// .setBillingCountries(billingCountries)
.build()

private val cards = arrayOf(
Profile.CardBrand.VISA,
Profile.CardBrand.MASTERCARD
)

private val shippingCountries = arrayOf(
Profile.Country.UA
)

private val billingCountries = arrayOf(
Profile.Country.UA
)

 

1 REPLY 1
API_Products
Visa Developer Support Specialist

Re: Fingerprint

Hi @Maksym,

 

We have an expert team that manages questions specific to this product. Please submit this inquiry to Developer@visa.com and someone will connect you to the expert team soon after.

 

 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.