edit method

Future<Response<RazorpayCustomer>> edit({
  1. required String customerId,
  2. required RazorpayCustomerUpdateRequestBody params,
  3. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayCustomer>?
    )?,
})

Edit a customer given Customer ID

@param customerId - The unique identifier of the customer. @param params - Check doc for required params

Implementation

Future<Response<RazorpayCustomer>> edit({
  required String customerId,
  required RazorpayCustomerUpdateRequestBody params,
  void Function(RazorpayApiException?, Response<RazorpayCustomer>?)? callback,
}) async {
  if (customerId.isEmpty) {
    throw ArgumentError('customerId is required');
  }
  return api.put<RazorpayCustomer>(
    // PUT method used in JS
    {
      'url': '/customers/$customerId',
      'data': params.toJson(),
    },
    fromJsonFactory: RazorpayCustomer.fromJson,
    callback: callback,
  );
}