omise / omise-android

Omise Android SDK
https://docs.opn.ooo
Other
50 stars 32 forks source link

Card brand now is unable to access from CreditCardEditText #357

Open nqtsparda opened 2 weeks ago

nqtsparda commented 2 weeks ago

Expected behavior

My application limit user to use some card brands not all. I get the brand value from CreditCardEditText. This works fine for release below 5.0.0

Actual behavior

Cannot access card brand property from CreditCardEditText since Omise release 5.0.0

Steps to reproduce the issue

Happened since release 5.0.0

Logs

No response

Screenshots

No response

Name and version information

Omise release 5.0.0

aashishgurung commented 4 days ago

@nqtsparda Thank you for reaching out. Could you please provide us with more details regarding the issue you mentioned? It would be helpful if you could provide the code samples on how you are accessing the card brands.

nqtsparda commented 2 days ago
private fun checkCardNumberNotSupported(): Boolean {
        val supportedCardBrands = listOf("Visa", "Master card")

        val isNotContained = supportedCardBrands.find {
            it?.lowercase() == binding.etCardNumber.cardBrand?.name?.lowercase()
        }.isNullOrEmpty()

        return (supportedCardBrands.isNotEmpty() && isNotContained)
}

Above is my code to check if user enter credit card is not Visa or Master card.

AnasNaouchi commented 1 day ago

Hello @nqtsparda , Can you please elaborate on this use case and how are you using this in your app ? In our SDK, we provide you the full UI flow to complete the credit/Debit tokenization journey so its not clear to us why you would require this feature and why you would want to restrict card brands. Thank you.

nqtsparda commented 1 day ago

Hi @AnasNaouchi here is my app use case

When user enter card number, my application would like to restrict user to enter Visa and Master card only (JCB or Amex card will trigger an alert and prevent user submit card info) But now if my app upgrade Omise lib from 4.x to 5.x then that restriction logic is broken, cardBrand property from CreditCardEditText cannot be accessed anymore As I know, Omise 5.x in IOS still allow to access cardBrand property, not sure why Android has to set cardBrand property to be private

AnasNaouchi commented 16 hours ago

Hello @nqtsparda,

Thank you for sharing the logic for your flow. I understand that you need access to that field. However, please note that collecting card information and sending it to your server will place you under PCI compliance. If you are directly sending everything to our servers, you won’t need to worry about PCI. We will provide a fix soon.