def turnOnAutoPay()

in src/main/scala/ZuoraService.scala [234:244]


  def turnOnAutoPay(accountId: String): String \/ Unit = {
    val accountUpdate = AccountUpdate(autoPay = true)
    logInfo(accountId, s"attempting to turn on autoPay with the following command: $accountUpdate")
    val body = RequestBody.create(MediaType.parse("application/json"), Json.toJson(accountUpdate).toString)
    val request = buildRequest(config, s"accounts/${accountId}").put(body).build()
    val call = restClient.newCall(request)
    val response = call.execute
    convertResponseToCaseClass[UpdateAccountResult](accountId, response) match {
      case \/-(result) => if (result.success) { \/-(()) } else { -\/("Zuora result indicated a failure when attempting to toggle autopay") }
      case -\/(error) => -\/(error)
    }