You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: payment.rb
    path of file: ./repos/spree/core/app/models/spree
    
    the code of the file until where you have to start completion: require_dependency 'spree/payment/processing'

module Spree
  class Payment < Spree::B
    
    def update_order
      order.updater.update_payment_total if completed? || void?

      if order.completed?
        order.updater.update_payment_state
        order.updater.update_shipments
        order.updater.update_shipment_state
      end