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: create_payment_source.rb
    path of file: ./repos/spree/core/app/services/spree/wallet
    
    the code of the file until where you have to start completion: module Spree
  module Wallet
    class CreatePaymentSource
      prepend Spree::ServiceModule::Base

      def call(payment_method:, params: {}, user: nil)
        return failure(nil, :missing_attri
    
      def call(payment_method:, params: {}, user: nil)
        return failure(nil, :missing_attributes) if params.nil?

        source_attributes = {
          payment_method_id: payment_method.id,
          user_id: user&.id,
          gateway_payment_profile_id: params[:gateway_payment_profile_id],
          gateway_customer_profile_id: params[:gateway_customer_profile_id],
          last_digits: params[:last_digits],
          month: params[:month],
          year: params[:year],
          name: params[:name]
        }

        source = payment_method.payment_source_class.new(source_attributes)

        source.save ? success(source) : failure(source)
      end