While integrating a payment gateway with our site we seldom come to a case where user already
entered credit card information is not able to get verified. Thus a particular amount is being lost by the site
owner. There are various resaon for credit card verfication failure one of the most common being card
getting expiered before the payment request was fired. To handle this particular case it is always advisable
to check your credit card being used when a user fills the payment form. In case of Braintree we can achieve
the same by making an update request for the user credit card with the minimal information with verified flag
being set to true.
result = Braintree::PaymentMethod.update("the_payment_method_token",
:options => {
:verify_card => true
}
)
begin
result = Braintree::PaymentMethod.update("bjzc82",:options => {:verify_card => true})
if result.success?
p "Congraulations! Your transaction has been successfully!"
else
p "Something went wrong while processing your transaction. Please try again!"
end
rescue
p "Something went wrong while processing your transaction"
end
** Note that an update will create a transaction, so if your processing options are set to reject transactions without CVV, you will need to include CVV as a parameter, or disable this rule in the control panel.
1) Log into the Control Panel
2) Navigate to Settings > Processing > CVV
3) Click Edit and uncheck CVV Not Provided (I)
0 Comment(s)