Code Duplication    Length = 7-8 lines in 3 locations

lib/authorize_net/cim/transaction.rb 3 locations

@@ 245-252 (lines=8) @@
242
    # Options:
243
    # +validation_mode+:: Set to :testMode, :liveMode or :none (the default) to indicate what sort of PaymentProfile validation to do.
244
    #
245
    def update_payment_profile(payment_profile, profile_id, options = {})
246
      options = @@create_payment_profile_option_defaults.merge(options)
247
      @type = Type::CIM_UPDATE_PAYMENT
248
      @fields.merge!(payment_profile.to_hash)
249
      set_fields(:validation_mode => options[:validation_mode])
250
      handle_profile_id(profile_id)
251
      make_request
252
    end
253
    
254
    # Sets up and submits a deleteCustomerPaymentProfileRequest transaction. If this transaction has already been
255
    # run, this method will return nil. Otherwise it will return an AuthorizeNet::CIM::Response object.
@@ 200-207 (lines=8) @@
197
    #   response = transaction.create_payment_profile(payment_profile, '123456')
198
    #   puts response.payment_profile_id if response.success?
199
    #
200
    def create_payment_profile(payment_profile, profile_id, options = {})
201
      options = @@create_payment_profile_option_defaults.merge(options)
202
      @type = Type::CIM_CREATE_PAYMENT
203
      @fields.merge!(payment_profile.to_hash)
204
      set_fields(:validation_mode => options[:validation_mode])
205
      handle_profile_id(profile_id)
206
      make_request
207
    end
208
    
209
    # Sets up and submits a getCustomerPaymentProfileRequest transaction. If this transaction has already been
210
    # run, this method will return nil. Otherwise it will return an AuthorizeNet::CIM::Response object. The
@@ 97-103 (lines=7) @@
94
    #   response = transaction.create_profile(profile)
95
    #   puts response.profile_id if response.success?
96
    # 
97
    def create_profile(profile, options = {})
98
      options = @@create_profile_option_defaults.merge(options)
99
      @type = Type::CIM_CREATE_PROFILE
100
      @fields.merge!(profile.to_hash)
101
      set_fields(:validation_mode => options[:validation_mode])
102
      make_request
103
    end
104
    
105
    # Sets up and submits a getCustomerProfileRequest transaction. If this transaction has already been
106
    # run, this method will return nil. Otherwise it will return an AuthorizeNet::CIM::Response object. The