fetch method

Future<Response<RazorpayIin>> fetch({
  1. required String tokenIin,
  2. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayIin>?
    )?,
})

Fetch the properties of the card using token IIN

@param tokenIin - The token IIN.

Implementation

Future<Response<RazorpayIin>> fetch({
  required String tokenIin,
  void Function(RazorpayApiException?, Response<RazorpayIin>?)? callback,
}) async {
  if (tokenIin.isEmpty) {
    throw ArgumentError('tokenIin is required');
  }
  return api.get<RazorpayIin>(
    {'url': '$BASE_URL/$tokenIin'},
    fromJsonFactory: RazorpayIin.fromJson,
    callback: callback,
  );
}