How is a Braintree vault payment processed on the Magento 2 server side?

Context: How is a vault payment implemented?

Step 1. How are the payment data assigned to the chosen payment on an order placement?

It triggers the following events:

  1. payment_method_assign_data_vault (it is handled by the Magento\Vault\Observer\PaymentTokenAssigner observer)

Step 2. Magento\Sales\Model\Order\Payment\Operations\AuthorizeOperation::authorize()

Step 3. Magento\Vault\Observer\AfterPaymentSaveObserver::execute()

See also: