Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surcharge not applying for MO/TO payments done through S700 device. #549

Open
harunr-plateron opened this issue Feb 4, 2025 · 0 comments

Comments

@harunr-plateron
Copy link

Summary

Surcharge is not being applied for Mail Order/Telephone Order (MO/TO) payments on the S700 device.

Code to reproduce

 @OptIn(InternalApi::class)
    private fun collectPayment(paymentIntent: PaymentIntent) {
        val collectConfig = CollectConfiguration.Builder()
            .setEnableCustomerCancellation(true)
            .updatePaymentIntent(true) // To fetch card details
            .setSurchargeNotice('description')
            .skipTipping(false)
            .setMoto(true)
            .build()

        cancelable = Terminal.getInstance().collectPaymentMethod(
            paymentIntent,
            this,
            collectConfig,
        )
    }
val confirmConfig = when {
            connectionType.isSurchargeSupported() && (surchargeData?.isApplied ?: false) -> {
                var surchargeAmount: Long = surchargeData?.amount ?: 0
                val maximumSurchargeAmount =
                    paymentIntent.paymentMethodOptions?.cardPresent?.surcharge?.maximumAmount ?: 0
                if (surchargeAmount > maximumSurchargeAmount) {
                    surchargeAmount = maximumSurchargeAmount
                }
                ConfirmConfiguration.Builder()
                    .amountSurcharge(surchargeAmount)
                    .build()
            }

            else -> {
                ConfirmConfiguration.Builder()
                    .build()
            }
        }
        Terminal.getInstance().confirmPaymentIntent(
            paymentIntent,
            callback,
            confirmConfig,
        )

Android version

Android 13

Impacted devices (Android devices or readers)

Impact on all android devices and S700 readers
Reader id: SDR70Z16311000021 (S700)

SDK version

implementation "com.stripe:stripeterminal:4.1.0"
implementation 'com.stripe:stripeterminal-handoffclient:4.1.0'
implementation 'com.stripe:stripeterminal-taptopay:4.1.0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant