Created
February 1, 2012 04:46
-
-
Save hexgnu/1715161 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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