fetchRefund method
Future<Response<RazorpayRefund> >
fetchRefund({
- required String paymentId,
- required String refundId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayRefund> ?
Fetch a specific refund for a payment
@param paymentId - The unique identifier of the payment. @param refundId - The unique identifier of the refund.
Implementation
Future<Response<RazorpayRefund>> fetchRefund({
required String paymentId,
required String refundId,
void Function(RazorpayApiException?, Response<RazorpayRefund>?)? callback,
}) async {
if (paymentId.isEmpty) {
throw ArgumentError('paymentId is mandatory');
}
if (refundId.isEmpty) {
throw ArgumentError('refundId is mandatory');
}
return api.get<RazorpayRefund>(
{'url': '$BASE_URL/$paymentId/refunds/$refundId'},
fromJsonFactory: RazorpayRefund.fromJson,
callback: callback,
);
}