result.credit_card_verification está retornando nil mesmo em erro no braintree
Estou usando o braintree para processamento de pagamentos e estou tentando obterCódigos de Resposta do Processador de Braintree com Ruby.
Aqui está o meu código:
verification = result.credit_card_verification
response_code = verification.try(:processor_response_code)
Estou recebendo a verificação como nula mesmo quando há erro.
Existe algo mais para obter códigos de resposta do processador?
Eu tenho esse código deAqui
Aqui está o meu result.erros:
:errors: !ruby/object:Braintree::Errors
errors: !ruby/object:Braintree::ValidationErrorCollection
errors: []
nested:
:customer: !ruby/object:Braintree::ValidationErrorCollection
errors: []
nested:
:credit_card: !ruby/object:Braintree::ValidationErrorCollection
errors:
- !ruby/object:Braintree::ValidationError
code: '81707'
attribute: cvv
message: CVV must be 4 digits for American Express and 3 digits for
other card types.
- !ruby/object:Braintree::ValidationError
code: '81713'
attribute: expiration_year
message: Expiration year is invalid.
- !ruby/object:Braintree::ValidationError
code: '81703'
attribute: number
message: Credit card type is not accepted by this merchant account.
- !ruby/object:Braintree::ValidationError
code: '81715'
attribute: number
message: Credit card number is invalid.
nested:
:billing_address: !ruby/object:Braintree::ValidationErrorCollection
errors: []
nested: {}