HatangCommerce
class HatangCommerce(val onBuyProduct: (context: Context, product: ProductCardItem) -> Boolean? = null, val onPay: (context: Context, payment: PaymentCard) -> Boolean? = null, val showExternalCheckout: Boolean = true)
How purchases started from chat cards are handled.
By default "Buy" on a product card writes "I'd like to buy …" in the composer, and a payment card shows a VietQR code and a "Pay now" button that opens the web checkout: right for physical goods and real-world services. Google Play requires Play Billing for digital goods used inside the app; for such apps handle the purchase in onBuyProduct (see ProductCardItem.googlePlayProductId) and set showExternalCheckout to false.
Constructors
Link copied to clipboard
constructor(onBuyProduct: (context: Context, product: ProductCardItem) -> Boolean? = null, onPay: (context: Context, payment: PaymentCard) -> Boolean? = null, showExternalCheckout: Boolean = true)
Properties
Link copied to clipboard
"Buy" on a product card. Return true when handled; false falls back to prefilling the composer.
Link copied to clipboard
"Pay now" on a payment card. Return true when handled; false falls back to the web checkout.
Link copied to clipboard
Show the VietQR code and open the web checkout from payment cards.