to finish implementing a custom payment method I need to know how to convert the quote to the actual order.
From payment gateway, my custom controller is called. Inside that controller, I can access Checkout Session object. When I call getQuoteId on that object, I get the actual quote id, however, when I call getLastRealOrderId, nothing is returned, so I think I need to do a previous step first.
Thanks but all sites give no explanation, they only show code so the questions are: how to create the order programmatically and only when success payment, the confirmation e-mail to customer to be sent automatically?