fetch method
Future<Response<RazorpayCustomer> >
fetch({
- required String customerId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayCustomer> ?
Fetches a customer given Customer ID
@param customerId - The unique identifier of the customer.
Implementation
Future<Response<RazorpayCustomer>> fetch({
required String customerId,
void Function(RazorpayApiException?, Response<RazorpayCustomer>?)? callback,
}) async {
if (customerId.isEmpty) {
throw ArgumentError('customerId is required');
}
return api.get<RazorpayCustomer>(
{'url': '/customers/$customerId'},
fromJsonFactory: RazorpayCustomer.fromJson,
callback: callback,
);
}