toJson method
Convert to JSON for API request
Implementation
Map<String, dynamic> toJson() {
final json = <String, dynamic>{
'amount_cents': amountCents.toString(),
'payment_methods': paymentMethods.join(','),
'email': email,
'is_live': isLive.toString(),
'full_name': fullName,
'phone_number': phoneNumber,
};
if (description != null) {
json['description'] = description;
}
if (referenceId != null) {
json['reference_id'] = referenceId;
}
return json;
}