Skip to content

Android Tap-to-Pay does not populate foreign_transaction_id consistently with card reader #69

@jacopofranza

Description

@jacopofranza

Problem

On Android Tap-to-Pay, the plugin does not propagate the Flutter foreignTransactionId in a way that makes the transaction retrievable through the Transactions API using foreign_transaction_id.

This makes Android Tap-to-Pay inconsistent with the card reader flow.

Current behavior

When using card reader checkout, foreignTransactionId is propagated correctly and the transaction can be retrieved via foreign_transaction_id.

When using Android Tap-to-Pay, the same external id is currently mapped only to CheckoutData.clientUniqueTransactionId, while CheckoutData.affiliateData is left null.

As a result, the transaction is not consistently retrievable through:

transactions.get(merchantCode, { foreign_transaction_id: externalId })

Expected behavior

Android Tap-to-Pay should behave consistently with card reader checkout:

  • the external id passed from Flutter as foreignTransactionId should populate SumUp's foreign_transaction_id
  • integrators should be able to query both card reader and Android Tap-to-Pay transactions using the same backend lookup strategy

Root cause

In the Android Tap-to-Pay flow, the plugin currently builds CheckoutData with:

  • clientUniqueTransactionId set from payment["foreignTransactionId"]
  • affiliateData = null

However, in the TTP SDK, foreignTransactionId belongs to AffiliateModel, which is attached through CheckoutData.affiliateData.

Proposed fix

Pass the plugin affiliateKey into the Android Tap-to-Pay checkout runner and set:

  • clientUniqueTransactionId
  • AffiliateModel(affiliateKey, foreignTransactionId, null)

This keeps the public Flutter API unchanged and fixes Android TTP reconciliation for foreign_transaction_id.

Related PR

Proposed fix: #68

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions