iZettle / sdk-android

Add card payments from Zettle to your own app
https://developer.zettle.com/docs/android-sdk
24 stars 20 forks source link

Signed Integer Overflow when handing over large amount to reader #4

Closed pc-coholic closed 4 years ago

pc-coholic commented 4 years ago

Expected Behavior

Making a payment request for 100.000.000,00 Euro should prompt a payment for exactly that amount on the reader.

Current Behavior

Signed 32bit integer overflow

IMG_20200616_214135

Steps to Reproduce

val paymentIntent = CardPaymentActivity.IntentBuilder(activity)
                .amount((receipt_total * BigDecimal("100.00")).toLong())  // TODO: Does not work for 0-digit currencies
                .reference(reference)
                .enableTipping(false)
                .build()

Context

dmilovanovi commented 4 years ago

Hey,

Thank you for reaching out to us.

Our team will have a look and we'll get back to you as soon as possible.

Kind regards.

pvoid commented 4 years ago

Fixed in version 1.8.3