toJson method
Convert to JSON for API request
Implementation
Map<String, dynamic> toJson() {
return {
'amount': amount,
if (specialReference != null) 'special_reference': specialReference,
if (expiration != null) 'expiration': expiration,
'currency': currency,
'payment_methods': paymentMethods,
'items': items,
'billing_data': billingData.toJson(),
'customer': customer.toJson(),
if (extras != null) 'extras': extras,
};
}