Skip to content

Instantly share code, notes, and snippets.

@hexgnu
Created February 1, 2012 04:42
Show Gist options
  • Save hexgnu/1715145 to your computer and use it in GitHub Desktop.
Save hexgnu/1715145 to your computer and use it in GitHub Desktop.
%w[test live].each do |mode|
define_method "#{mode}_validate_payment_profile" do
options = {
:customer_profile_id => self.cim_id,
:customer_payment_profile_id => self.get_cim_payment_profile[:payment_profile_id],
:validation_mode => :"#{mode}"
}
response = GATEWAY.validate_customer_payment_profile(options)
validation_hash = {
:success => (response.success? ? true : false),
:message => response.params["direct_response"]["message"]
}
return validation_hash
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment