fetchTokens method
Future<Response<RazorpayCustomerTokensResponse> >
fetchTokens({
- required String customerId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayCustomerTokensResponse> ?
Fetch tokens by customerId
@param customerId - The unique identifier of the customer.
Implementation
Future<Response<RazorpayCustomerTokensResponse>> fetchTokens({
required String customerId,
void Function(
RazorpayApiException?,
Response<RazorpayCustomerTokensResponse>?,
)? callback,
}) async {
if (customerId.isEmpty) {
throw ArgumentError('customerId is required');
}
return api.get<RazorpayCustomerTokensResponse>(
{'url': '/customers/$customerId/tokens'},
fromJsonFactory: RazorpayCustomerTokensResponse.fromJson,
callback: callback,
);
}