AuthorizeNet / sdk-ruby

Ruby SDK for the Authorize.Net API
Other
87 stars 111 forks source link

ArgumentError: invalid value for BigDecimal(): "Visa" #163

Closed MeisterMichael closed 5 years ago

MeisterMichael commented 6 years ago

Several credit cards we process are generating the following argument error from the response, while generating successful authorizations. Thus our customers are being charged, and we don't know it because of the error, so aren't sending them their product.

Why is this happening. What can we do to fix it for now, and how long until the plugin is updated so this doesn't happen.

Thanks.

ArgumentError: invalid value for BigDecimal(): "Visa"
…/authorizenet-1.9.5/lib/authorize_net/
authorize_net.rb:  40:in `BigDecimal'
…/authorizenet-1.9.5/lib/authorize_net/
authorize_net.rb:  40:in `value_to_decimal'
…s/authorizenet-1.9.5/lib/authorize_net/aim/
response.rb:  54:in `block in initialize'
…s/authorizenet-1.9.5/lib/authorize_net/aim/
response.rb:  50:in `each'
…s/authorizenet-1.9.5/lib/authorize_net/aim/response.rb:  50:in `initialize'
…s/authorizenet-1.9.5/lib/authorize_net/cim/
response.rb:  90:in `new'
…s/authorizenet-1.9.5/lib/authorize_net/cim/
response.rb:  90:in `direct_response'
ashtru commented 6 years ago

Can you provide the request you are trying to send? It's not clear for which field, the ArgumentError is thrown. For this, you can share the relevant portion of your code, where you are constructing the request, and when sending it to Authorize.Net.

Another thing, I notice that you are using the older style of making requests for AIM, CIM and ARB. There used to be parsing and validation errors in the older classes. You can check out the new sample codes at sample-code-ruby. You can follow the mapping: AIM->PaymentTransactions, CIM -> CustomerProfiles, ARB -> RecurringBilling. Please respond if you have any questions/issues following them.

gnongsie commented 5 years ago

Hi all,

Based on the response from @ashtru , I'm closing this issue.

Kindly reopen if the issue persists.