toJson method

Map<String, dynamic> toJson()

Serialises this item to the JSON format expected by the Paystack POST /bulkcharge endpoint.

The amount is converted from the major unit to the subunit (e.g. GHS 50.00 → 5000 pesewas).

Implementation

Map<String, dynamic> toJson() => {
      'authorization': authorizationCode,
      'amount': (amount * 100).toStringAsFixed(0),
      'reference': reference,
      'email': email,
    };