Skip to main content

Coupon

Describes one coupon or discount applied on a receipt.

Package: com.microblink.core

Declaration

class Coupon : Parcelable

Constructor:

Coupon(
couponType: CouponType?,
amount: FloatType?,
sku: StringType?,
description: StringType?
)
// or with related product:
Coupon(
couponType: CouponType?,
amount: FloatType?,
sku: StringType?,
description: StringType?,
relatedProductIndex: Int
)

Quick Reference

Properties

PropertyDescription
couponTypeThe type of coupon
amountThe discount amount
skuSKU associated with the coupon
descriptionCoupon description text
relatedProductIndexIndex of the product this coupon applies to

Methods

MethodDescription
typeToString()Returns the coupon type as a user-friendly string

Properties

couponType

val couponType: CouponType?

The type of coupon. See CouponType enum.


amount

val amount: FloatType?

The discount amount. See FloatType.


sku

val sku: StringType?

SKU associated with the coupon, if applicable.


description

val description: StringType?

Coupon description text as printed on the receipt.


relatedProductIndex

val relatedProductIndex: Int

Zero-based index into ScanResults.products() for the product this coupon applies to. Present only in the second constructor overload.


Methods

typeToString()

fun typeToString(): String?

Returns the coupon type as a user-friendly string.