Turning a smartphone into a payment terminal