Code Duplication    Length = 7-8 lines in 3 locations

lib/authorize_net/cim/transaction.rb 3 locations

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