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

Sending a CardPresentRoutingOption Preference will fail in unsupported markets #490

Open
pc-coholic opened this issue Sep 5, 2024 · 1 comment

Comments

@pc-coholic
Copy link

Summary

Setting a CardPresentRoutingOption for a on-device generated PaymentIntent will cause an error-message, if the account in question tied to a non-supported country.

  "payment_method_options": {
    "card_present": {
      "routing": {
        "requested_priority": "domestic"
      }
    }
  },

will work fine for a Stripe Account in Germany, but not for one in Portugal.

After experimentation, I can say that this seems to be tied to the Stripe Account country rather then the terminal's location.

In my opinion this code path should never fail and just fall back to the international priority instead of causing a hard 400 parameter_unknown (Received unknown parameter: payment_method_options[card_present][routing])

Code to reproduce

        val params = PaymentIntentParameters.Builder(
                amount = (receipt_total * BigDecimal("100.00")).toLong(),
                currency = event_currency.lowercase(),
                captureMethod = CaptureMethod.Automatic,
                allowedPaymentMethodTypes = getPaymentMethodTypes()
        )
            .setDescription(desc)
            .setStatementDescriptor(desc.substring(0, min(desc.length, 22)))
            .setMetadata(
                mapOf(
                    "app" to "pretixPOS",
                    "appversion" to BuildConfig.VERSION_NAME,
                    "organizer" to conf.organizerSlug,
                    "event" to event_slug,
                    "posid" to conf.devicePosId.toString(),
                    "posserial" to conf.uniqueSerial!!,
                    "receipt" to receipt_id.toString()
                )
            )

                params.setPaymentMethodOptionsParameters(
                    PaymentMethodOptionsParameters.Builder()
                        .setCardPresentParameters(
                            CardPresentParameters.Builder()
                                .setRouting(
                                    CardPresentRoutingOptionParameters(RoutingPriority.DOMESTIC)
                                )
                                .build()
                        )
                        .build()
                )

Android version

Android 10 and others

Impacted devices (Android devices or readers)

No, applies to all

SDK version

3.8.0

Other information

@mahirk-stripe
Copy link

Hi @pc-coholic --

I wanted to note that this is expected in countries where we do not support routing priority, such as PT. The above options should only be used in countries where we have enabled domestic debit priority and can be used to change the priority of the card read based off the parameter.

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

2 participants