Magento: 2.4.6
Braintree: 4.5.0
When a braintree transaction failed with a reason like 'Processor Declined' or 'Gateway Rejected', Magento also created an order with 'Canceled' status. How to stop create an order when transaction failed?
Check this two event's
sales_order_place_after
sales_model_service_quote_submit_before
and check save() method. Need to remove save() method from observer file.
Ex. $this->orderRepository->save($orderInstance);