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: reimbursement_helpers.rb
    path of file: ./repos/solidus/core/app/models/spree/reimbursement_type
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Spree
  module ReimbursementType::ReimbursementHelpers
    # Ordered list of payment methods that
    
    def create_refund(reimbursement, payment, amount, simulate)
      refund = reimbursement.refunds.build({
        payment: payment,
        amount: amount,
        reason: Spree::RefundReason.return_processing_reason
      })

      if simulate
        refund.readonly!
      else
        refund.save!
        refund.perform!
      end