Hit the paydirt

Can anyone tell me the origin of "hit the paydirt"?

I think it comes from the early days of gold prospecting in Canada/USA. If you found a gold-bearing seam in the ground you said that 'you'd hit the pay dirt'.