Start looking at the settlements() method on SagePay