Package com.meawallet.mtp
Class E2eEncryptedDigitizationParameters
- java.lang.Object
-
- com.meawallet.mtp.E2eEncryptedDigitizationParameters
-
public class E2eEncryptedDigitizationParameters extends java.lang.Object
Class for calculating and holding parameters for digitisation with e2e encrypted data (available only for VISA).Use plain card data to construct an instance of class which then can be used to call
MeaInitializeDigitizationParameters.withE2eEncryptedData(E2eEncryptedDigitizationParameters)
-
-
Constructor Summary
Constructors Constructor Description E2eEncryptedDigitizationParameters(PaymentNetwork paymentNetwork, java.lang.String bin, java.lang.String accountNumber, java.lang.String name, java.lang.String expirationMonth, java.lang.String expirationYear)
Creates instance of parameters for digitisation with e2e encrypted data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccountNumberHash()
Returns hash (sha256) of the card PAN.int
getAccountNumberLength()
Return length of the card PAN.java.lang.String
getBin()
Returns BIN of the card.java.lang.String
getE2eDataEncryptedPayload()
Encrypts card data for using in digitisation with e2e encrypted data.PaymentNetwork
getPaymentNetwork()
Return payment network.
-
-
-
Constructor Detail
-
E2eEncryptedDigitizationParameters
public E2eEncryptedDigitizationParameters(@NonNull PaymentNetwork paymentNetwork, @NonNull java.lang.String bin, @NonNull java.lang.String accountNumber, @NonNull java.lang.String name, @NonNull java.lang.String expirationMonth, @NonNull java.lang.String expirationYear) throws NotInitializedException, MeaException
Creates instance of parameters for digitisation with e2e encrypted data.- Parameters:
paymentNetwork
- Payment network as instance ofPaymentNetwork
. Only VISA supported.bin
- Card BIN. Min length 6, max length 16.accountNumber
- Card PAN. Min length 9, max length 19.name
- Name of the Cardholder in a format FIRSTNAME LASTNAME. Max length 256.expirationMonth
- Month of card expiration date.expirationYear
- Year of card expiration date.- Throws:
NotInitializedException
- if MeaTokenPlatform is not initialized. UseMeaCheckedException.getErrorCode()
to get failure reason error code.MeaException
- if MeaTokenPlatform is not initialized/registered and necessary encryption keys are not available. UseMeaCheckedException.getErrorCode()
to get failure reason error code.
-
-
Method Detail
-
getAccountNumberLength
public int getAccountNumberLength()
Return length of the card PAN.- Returns:
- Length of the card PAN.
-
getAccountNumberHash
public java.lang.String getAccountNumberHash() throws com.meawallet.mtp.MeaCryptoException
Returns hash (sha256) of the card PAN.- Returns:
- Hash (sha256) of the card PAN.
- Throws:
com.meawallet.mtp.MeaCryptoException
- if calculation of sha256 fails. UseThrowable.getMessage()
to get failure reason error code.
-
getBin
public java.lang.String getBin()
Returns BIN of the card.- Returns:
- BIN of the card.
-
getPaymentNetwork
public PaymentNetwork getPaymentNetwork()
Return payment network.- Returns:
- Payment network as instance of
PaymentNetwork
-
getE2eDataEncryptedPayload
public java.lang.String getE2eDataEncryptedPayload() throws java.security.NoSuchAlgorithmException, com.meawallet.mtp.MeaCryptoException
Encrypts card data for using in digitisation with e2e encrypted data.- Returns:
- Encrypted card data.
- Throws:
java.security.NoSuchAlgorithmException
- if device doesn't support MD5 algorithm.com.meawallet.mtp.MeaCryptoException
- if payload encryption fails. UseThrowable.getMessage()
to get failure reason error code.
-
-