Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:amount' element is invalid #325

Open
linyunjiang opened this issue Apr 9, 2019 · 1 comment

Comments

@linyunjiang
Copy link

linyunjiang commented Apr 9, 2019

def credit(amount, creditcard, response_code, gateway_options = {})
create_transaction(amount, creditcard, :refund, transaction_options(gateway_options).merge(trans_id: response_code))
end

def void(response_code, creditcard, gateway_options = {})
create_transaction(nil, creditcard, :void, transaction_options(gateway_options).merge(trans_id: response_code))
end

def cancel(response_code)
response = void(response_code, nil)
response = credit(nil, nil, response_code) unless response.success?
response
end

We use cancel method in authorize_net_cim.rb, when code into credit(nil, nil, response_code), it will always return
=> #<ActiveMerchant::Billing::Response:0x00007fde9655cdd8 @authorization=nil, @avs_result={"code"=>nil, "message"=>nil, "street_match"=>nil, "postal_match"=>nil}, @cvv_result={"code"=>nil, "message"=>nil}, @emv_authorization=nil, @error_code="E00003", @fraud_review=nil, @message= "The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:amount' element is invalid - The value &#39;&#39; is invalid according to its datatype 'Decimal' - The string &#39;&#39; is not a valid Decimal value.", @params= {"messages"=> {"result_code"=>"Error", "message"=> {"code"=>"E00003", "text"=> "The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:amount' element is invalid - The value &#39;&#39; is invalid according to its datatype 'Decimal' - The string &#39;&#39; is not a valid Decimal value."}}}, @success=false, @test=false>

@jericdeleon
Copy link

We are encountering this too. Has there been any progress?

@linyunjiang If you don't mind, what did you end up doing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants