PaystackCartItem class

Represents a single line item in a customer's cart.

Pass a list of these via PayWithPayStack.now's cartItems parameter. These appear in the Paystack Dashboard under the transaction's metadata.

Example:

cartItems: [
  PaystackCartItem(name: 'Wireless Headphones', amount: 15000, quantity: 1),
  PaystackCartItem(name: 'Phone Case', amount: 2500, quantity: 2),
],

Constructors

PaystackCartItem({required String name, required double amount, int quantity = 1})
const

Properties

amount double
Price of a single unit in the major currency unit (e.g. 15.00 for GHS 15.00). The plugin converts this to the subunit (pesewas/kobo) automatically when building the metadata.
final
hashCode int
The hash code for this object.
no setterinherited
name String
Product or item name.
final
quantity int
Number of units purchased. Defaults to 1.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited