The paper is concerned with a stochastic risk model with independent random claims and premiums. Recurrence formulas for the ruin probabilities of an insurance company at times of claim payments are obtained. Both the random premiums and the insurance damages are assumed to be independent and identically distributed. The number of claims and premiums are independent Poisson processes, both of which are independent of the size of premiums and claims. We consider the case when the random premiums and insurance damages are exponentially distributed and the more general case when they are gamma distributed with integer parameters. Based on the probabilities obtained in this paper, it is possible to calculate the ruin probabilities on infinite and finite time intervals. Examples are given. © 2014 Allerton Press, Inc.