fetchTransferOrder method
Future<Response<RazorpayOrder> >
fetchTransferOrder({
- required String orderId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayOrder> ?
Fetch transfers for an order
@param orderId - The unique identifier of the order
Implementation
Future<Response<RazorpayOrder>> fetchTransferOrder({
required String orderId,
void Function(RazorpayApiException?, Response<RazorpayOrder>?)? callback,
}) async {
if (orderId.isEmpty) {
throw ArgumentError('`order_id` is mandatory');
}
// The JS code uses expand[]=transfers&status, which seems unusual.
// Using standard expand syntax. Verify with actual API behavior.
return api.get<RazorpayOrder>(
{
'url': '/orders/$orderId',
'data': {'expand[]': 'transfers'}, // Using standard expand
},
fromJsonFactory: RazorpayOrder.fromJson,
callback: callback,
);
}