Fixed several minor errors that prevented refund-all batches from succeeding
Refactoring payment_refund() and send_refund_request() for DRY-ness