Skip to content

Instantly share code, notes, and snippets.

@hexgnu
Created February 1, 2012 04:45
Show Gist options
  • Save hexgnu/1715154 to your computer and use it in GitHub Desktop.
Save hexgnu/1715154 to your computer and use it in GitHub Desktop.
def validate_payment_profile(options)
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
options = {
:customer_profile_id => self.cim_id,
:customer_payment_profile_id => self.get_cim_payment_profile[:payment_profile_id],
:validation_mode => :test
}
validate_payment_profile(options)
end
# NOTE this method will charge the member $0.01, which will
# promptly be voided... use with care
def live_validate_payment_profile
options = {
:customer_profile_id => self.cim_id,
:customer_payment_profile_id => self.get_cim_payment_profile[:payment_profile_id],
:validation_mode => :live
}
validate_payment_profile(options)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment