calculation for order and payment