PaystackBulkChargeItem class

Represents a single item in a Paystack bulk charge batch.

Pass a list of these to PayWithPayStack.bulkCharge or to POST /bulkcharge on the Paystack API to charge multiple authorizations in a single request.

Example

final items = [
  PaystackBulkChargeItem(
    authorizationCode: 'AUTH_xxxxx',
    amount: 50.00,
    reference: PayWithPayStack().generateUuidV4(),
    email: 'user1@example.com',
  ),
  PaystackBulkChargeItem(
    authorizationCode: 'AUTH_yyyyy',
    amount: 20.00,
    reference: PayWithPayStack().generateUuidV4(),
    email: 'user2@example.com',
  ),
];

final batch = await PayWithPayStack().bulkCharge(items: items);

Constructors

PaystackBulkChargeItem({required String authorizationCode, required double amount, required String reference, String? email})
const
PaystackBulkChargeItem.fromJson(Map<String, dynamic> json)
Factory to construct a PaystackBulkChargeItem from a JSON map.
factory

Properties

amount double
Amount to charge in the major currency unit (e.g. 50.00 for GHS 50). Converted to the subunit automatically in toJson.
final
authorizationCode String
The authorization code from a previous successful transaction. Obtained from PaymentData.authorization?.authorizationCode.
final
email String?
The email address of the customer being charged (optional).
final
hashCode int
The hash code for this object.
no setterinherited
reference String
A unique reference for this charge in the batch.
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>
Serialises this item to the JSON format expected by the Paystack POST /bulkcharge endpoint.
toString() String
A string representation of this object.
override

Operators

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