Method: AuthorizeNet::CIM::Transaction#update_payment_profile
- Defined in:
- lib/authorize_net/cim/transaction.rb
#update_payment_profile(payment_profile, profile_id, options = {}) ⇒ Object
Sets up and submits a updateCustomerPaymentProfileRequest transaction. If this transaction has already been run, this method will return nil. Otherwise it will return an AuthorizeNet::CIM::Response object.
payment_profile
-
An AuthorizeNet::CIM::PaymentProfile object describing the profile to update.
profile_id
-
Takes either a String containing the ID of the CustomerProfile who owns this PaymentProfile, or a CustomerProfile object with the ID populated.
Typical usage:
payment_profile.cust_type = :business
response = transaction.update_payment_profile(payment_profile, '123456')
puts response.success?
Options:
validation_mode
-
Set to :testMode, :liveMode or :none (the default) to indicate what sort of PaymentProfile validation to do.
215 216 217 218 219 220 221 222 |
# File 'lib/authorize_net/cim/transaction.rb', line 215 def update_payment_profile(payment_profile, profile_id, = {}) = @@create_payment_profile_option_defaults.merge() @type = Type::CIM_UPDATE_PAYMENT @fields.merge!(payment_profile.to_hash) set_fields(:validation_mode => [:validation_mode]) handle_profile_id(profile_id) make_request end |