A method of an electronic device for enabling a transaction with a point of sale, POS, terminal, the method comprising: initiating, by an electronic device, the transaction with the POS terminal including a magnetic reader or a short range wireless transceiver for performing the transaction; in response to initiating the transaction, capturing, by the electronic device, at least one image of the POS terminal by using a camera of the electronic device; identifying, by the electronic device, a model, a category or a class of the POS terminal based on the captured at least one image; based on the identified model, category or class of the POS terminal, identifying, by the electronic device, an optimal position of the electronic device for the transaction with the POS terminal based on a stored optimal position corresponding to the identified model, category or class of the POS terminal; determining, by the electronic device based on input from a proximity sensor of the electronic device, a current position of the electronic device with respect to the POS terminal; determining, by the electronic device, whether the initiated transaction is successful; based on determining that the initiated transaction is not successful, providing, by the electronic device on a display of the electronic device, guidance elements based on the current determined position of the electronic device and the identified optimal position of the electronic device wherein the guidance elements provide directions for moving the electronic device from the current determined position to the identified optimal position of the electronic device, wherein the determination of the current position of the electronic device with respect to the POS terminal, the determination whether the initiated transaction is successful, and the provision of the guidance elements are repeated until it is determined that the initiated transaction is successful; and based on determining that the initiated transaction is successful, storing, by the electronic device, the position of the electronic device with respect to the POS terminal for use in determining the optimal position of the electronic device for future transactions with the POS terminal. initiating, by an electronic device, the transaction with the POS terminal including a magnetic reader or a short range wireless transceiver for performing the transaction; in response to initiating the transaction, capturing, by the electronic device, at least one image of the POS terminal by using a camera of the electronic device; identifying, by the electronic device, a model, a category or a class of the POS terminal based on the captured at least one image; based on the identified model, category or class of the POS terminal, identifying, by the electronic device, an optimal position of the electronic device for the transaction with the POS terminal based on a stored optimal position corresponding to the identified model, category or class of the POS terminal; determining, by the electronic device based on input from a proximity sensor of the electronic device, a current position of the electronic device with respect to the POS terminal; determining, by the electronic device, whether the initiated transaction is successful; based on determining that the initiated transaction is not successful, providing, by the electronic device on a display of the electronic device, guidance elements based on the current determined position of the electronic device and the identified optimal position of the electronic device wherein the guidance elements provide directions for moving the electronic device from the current determined position to the identified optimal position of the electronic device, wherein the determination of the current position of the electronic device with respect to the POS terminal, the determination whether the initiated transaction is successful, and the provision of the guidance elements are repeated until it is determined that the initiated transaction is successful; and based on determining that the initiated transaction is successful, storing, by the electronic device, the position of the electronic device with respect to the POS terminal for use in determining the optimal position of the electronic device for future transactions with the POS terminal.