move code from cp-worker to pricing gem as per suggested by steve

Please check it.