Skip to content

Instantly share code, notes, and snippets.

@hexgnu
Created February 1, 2012 04:46
Show Gist options
  • Save hexgnu/1715161 to your computer and use it in GitHub Desktop.
Save hexgnu/1715161 to your computer and use it in GitHub Desktop.
def validate_payment_profile(params)
options = {
:customer_profile_id => self.cim_id,
:customer_payment_profile_id => self.get_cim_payment_profile[:payment_profile_id],
:validation_mode => :test
}
options.merge!(params)
response = GATEWAY.validate_customer_payment_profile(options)
validation_hash = {
:success => (response.success? ? true : false),
:message => response.params["direct_response"]["message"]
}
return validation_hash
end
def field_validate_payment_profile
validate_payment_profile(:validation_mode => :test)
end
# NOTE this method will charge the member $0.01, which will
# promptly be voided... use with care
def live_validate_payment_profile
validate_payment_profile(:validation_mode => :live)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment