addToCart method
Adding PaynowCartItems
to Payment.items
quantity
Implementation
void addToCart(PaynowCartItem cartItem, {int? quantity}) {
if (this.items.containsKey(cartItem)) {
/// then increment quantity by 1 if [quantity] is null
this.items[cartItem] = this.items[cartItem]! + (quantity ?? 1);
} else {
/// Add new item to cart with initial quantity of 1 if [quantity] is null
this.items[cartItem] = quantity ?? 1;
}
}