editFulfillment method
Future<Response<RazorpayFulFillment> >
editFulfillment({
- required String orderId,
- required RazorpayFulFillmentBaseRequestBody params,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayFulFillment> ?
Update the Fulfillment Details
@param orderId - The unique identifier of the order @param params - Check doc for required params
Implementation
Future<Response<RazorpayFulFillment>> editFulfillment({
// Assuming response matches RazorpayFulFillment model
required String orderId,
required RazorpayFulFillmentBaseRequestBody params,
void Function(RazorpayApiException?, Response<RazorpayFulFillment>?)?
callback,
}) async {
if (orderId.isEmpty) {
throw ArgumentError('`order_id` is mandatory');
}
// JS returns 'any', using the defined fulfillment model.
return api.post<RazorpayFulFillment>(
{
'url': '/orders/$orderId/fulfillment',
'data': params.toJson(),
},
fromJsonFactory:
RazorpayFulFillment.fromJson, // Adjust if response differs
callback: callback,
);
}