Skip to content

Instantly share code, notes, and snippets.

@dpmccabe
Created January 13, 2012 16:14
Show Gist options
  • Save dpmccabe/1607258 to your computer and use it in GitHub Desktop.
Save dpmccabe/1607258 to your computer and use it in GitHub Desktop.
if @result.credit_card_verification
@account.transactions.build(
:approved => false,
:avs_error_response_code => @result.credit_card_verification.avs_error_response_code,
:avs_postal_code_response_code => @result.credit_card_verification.avs_postal_code_response_code,
:avs_street_address_response_code => @result.credit_card_verification.avs_street_address_response_code,
:cvv_response_code => @result.credit_card_verification.cvv_response_code,
:gateway_rejection_reason => @result.credit_card_verification.gateway_rejection_reason,
:processor_response_code => @result.credit_card_verification.processor_response_code,
:processor_response_text => @result.credit_card_verification.processor_response_text,
:status => @result.credit_card_verification.status,
:ttype => @account.getting_fresh? ? "get fresh (verification)" : "stay fresh (verification)"
)
else
@account.transactions.build(
:approved => false,
:validation_errors => @result.errors.collect { |error| "(#{error.code}) #{error.message}" }.join("\n"),
:status => "validation_error",
:ttype => @account.getting_fresh? ? "get fresh (verification)" : "stay fresh (verification)"
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment