createRecurringPayment method
Future<Response<RazorpayOtpSubmitResponse> >
createRecurringPayment({
- required RazorpayRecurringPaymentCreateRequestBody params,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayOtpSubmitResponse> ?
Create a recurring payment
@param params - Check docs for recurring payments (card, emandate, nach, upi).
Implementation
Future<Response<RazorpayOtpSubmitResponse>> createRecurringPayment({
// Response based on JS example (signature)
required RazorpayRecurringPaymentCreateRequestBody params,
void Function(RazorpayApiException?, Response<RazorpayOtpSubmitResponse>?)?
callback,
}) async {
return api.post<RazorpayOtpSubmitResponse>(
// Assuming OTP submit response structure
{
'url': '$BASE_URL/create/recurring',
'data': params.toJson(),
},
fromJsonFactory: RazorpayOtpSubmitResponse.fromJson,
callback: callback,
);
}