notifyBy method
Future<Response<RazorpayNotifyResponse> >
notifyBy({
- required String paymentLinkId,
- required NotifyMedium medium,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayNotifyResponse> ?
Send notification
@param paymentLinkId - The unique identifier of the paymentlink.
@param medium - Possible values: sms, email, whatsapp
Implementation
Future<Response<RazorpayNotifyResponse>> notifyBy({
required String paymentLinkId,
required NotifyMedium medium,
void Function(RazorpayApiException?, Response<RazorpayNotifyResponse>?)?
callback,
}) async {
if (paymentLinkId.isEmpty) {
throw ArgumentError(MISSING_ID_ERROR);
}
final mediumString = medium.toString().split('.').last;
final url = '$BASE_URL/$paymentLinkId/notify_by/$mediumString';
return api.post<RazorpayNotifyResponse>(
{'url': url},
fromJsonFactory: RazorpayNotifyResponse.fromJson,
callback: callback,
);
}