I'm having an issue where I cannot correctly post to the authorize.net API from the official gem. Having dig into the problem, I can see that the request being generated by the gem is incomplete - the transaction section is missing.
I've opened an issue on github here, though the crux seems to be the following:
In the build_nodes
method, the following is called:
puts "has_content(value, data): #{has_content(value, data)}"
proc = Proc.new { puts 'PROC CALLED'; build_nodes(builder, value, data) }
builder.send(nodeName, &proc) if has_content(value, data)
When I run the specs for the gem, I get the following output:
has_content(value, data): true
PROC CALLED
Whereas running via irb, I get:
irb(main):011:0> response = tx.create_transaction_auth_capture(100.00, '3...266', '27...61', AuthorizeNet::Order.new())
has_content(value, data): true
=> nil
Given that the proc is passed directly to the builder (Nokogiri::XML), I would expect that it would get called, though it seems that it does not.
Does anyone know why the proc is not getting called in this case?
Looks like this has been fixed or at least worked around here: https://github.com/AuthorizeNet/sdk-ruby/issues/21#issuecomment-70976714