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

Transactionreference info #31

Closed jonarderic74 closed 2 years ago

jonarderic74 commented 3 years ago

How send a name of product or use a product in the catalog with Transactionreference ?

bobzettle commented 2 years ago

Hi, this is described in the readme.

Using the put method you can add whatever you want to this object, but keep in mind that the total data size (including key names) in this object can't be bigger than 4 kilobytes. You will get this reference back with transaction data and can always request it back from our servers.

So to put a product name in there you would do something similar to this.

val productNameKey = "arbitary string of your choice"

val internalTraceId = UUID.randomUUID().toString()
val reference = TransactionReference.Builder(internalTraceId)
    .put(productNameKey, productName)
    .build()