How to receive payment and perform calculations for products?