toJson method
Convert to JSON for backend communication
Implementation
Map<String, dynamic> toJson() {
return {
'amount': amount,
'currency': currency,
'description': description,
'orderId': orderId,
if (successUrl != null) 'successUrl': successUrl,
if (cancelUrl != null) 'cancelUrl': cancelUrl,
if (customerEmail != null) 'customerEmail': customerEmail,
if (customerName != null) 'customerName': customerName,
if (customerPhone != null) 'customerPhone': customerPhone,
if (metadata != null) 'metadata': metadata,
if (returnUrl != null) 'returnUrl': returnUrl,
};
}