fetch method
Future<Response<RazorpayProduct> >
fetch({
- required String accountId,
- required String productId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayProduct> ?
Fetch a Product Configuration
@param accountId - The unique identifier of the account. @param productId - The unique identifier of a product.
Implementation
Future<Response<RazorpayProduct>> fetch({
required String accountId,
required String productId,
void Function(RazorpayApiException?, Response<RazorpayProduct>?)? callback,
}) async {
if (accountId.isEmpty) {
throw ArgumentError('accountId is required');
}
if (productId.isEmpty) {
throw ArgumentError('productId is required');
}
return api.get<RazorpayProduct>(
{
'version': 'v2',
'url': '$BASE_URL/$accountId/products/$productId',
},
fromJsonFactory: RazorpayProduct.fromJson,
callback: callback,
);
}