Code Monkey home page Code Monkey logo

Comments (14)

duff avatar duff commented on August 15, 2024

I'd be curious if the error ever happens without zeus. Just trying to eliminate possibilities.

from spreedly-gem.

iainsmith avatar iainsmith commented on August 15, 2024

Yes I'm hitting the same error without zeus. Any ideas?

NoMethodError: undefined method at_xpath for nil:NilClass from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/common/fields.rb:10:in block in initialize_fields from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/common/fields.rb:9:in each from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/common/fields.rb:9:in initialize_fields from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/transactions/gateway_transaction.rb:26:in initialize from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/transactions/gateway_transaction.rb:13:in new from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/transactions/gateway_transaction.rb:13:in initialize from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/transactions/auth_purchase.rb:11:in initialize from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/transactions/transaction.rb:14:in new from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/transactions/transaction.rb:14:in new_from from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/environment.rb:211:in api_post from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spreedly-2.0.4/lib/spreedly/environment.rb:43:in purchase_on_gateway from /Users/..../code/../app/models/payment_manager.rb:11:in charge from (irb):15 from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/console.rb:90:in start from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/console.rb:9:in start from /Users/..../.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:64:in <top (required)> from bin/rails:4:in require from bin/rails:4:in <main>irb(maijq:016:0>

from spreedly-gem.

duff avatar duff commented on August 15, 2024

Looks like it's happening when the gateway_transaction is attempting to initialize. I'd love to see the response body when the exception happens. Looks like it's having difficulty finding one of the fields. I wonder which one it is.

from spreedly-gem.

sosedoff avatar sosedoff commented on August 15, 2024

@duff, i'm having the same issue. Initialization fails. The chunk of response that triggers error:

<transactions>
  <transaction>
    <amount type="integer">199</amount>
    <on_test_gateway type="boolean">false</on_test_gateway>
    <created_at type="datetime">2013-10-15T19:05:33Z</created_at>
    <updated_at type="datetime">2013-10-15T19:05:33Z</updated_at>
    <currency_code>USD</currency_code>
    <succeeded type="boolean">false</succeeded>
    <state>failed</state>
    <token>REMOVED</token>
    <transaction_type>Purchase</transaction_type>
    <order_id>REMOVED</order_id>
    <ip nil="true"/>
    <description>The Description</description>
    <merchant_name_descriptor>REMOVED</merchant_name_descriptor>
    <merchant_location_descriptor>REMOVED</merchant_location_descriptor>
    <gateway_specific_fields nil="true"/>
    <gateway_specific_response_fields nil="true"/>
    <message key="messages.cannot_use_redacted_gateway">Unable to use a gateway because it's been redacted.</message>
    <gateway_token>REMOVED</gateway_token>
    <payment_method>
      <token>REMOVED</token>
      <created_at type="datetime">2013-10-11T20:15:25Z</created_at>
      <updated_at type="datetime">2013-10-11T20:15:25Z</updated_at>
      <email>REMOVED</email>
      <data nil="true"/>
      <storage_state>retained</storage_state>
      <last_four_digits>1111</last_four_digits>
      <card_type>visa</card_type>
      <first_name>REMOVED</first_name>
      <last_name>REMOVED</last_name>
      <month type="integer">12</month>
      <year type="integer">2015</year>
      <address1>REMOVED</address1>
      <address2 nil="true"/>
      <city>REMOVED</city>
      <state>REMOVED</state>
      <zip>REMOVED</zip>
      <country>REMOVED</country>
      <phone_number nil="true"/>
      <full_name>REMOVED</full_name>
      <payment_method_type>credit_card</payment_method_type>
      <errors>
      </errors>
      <verification_value></verification_value>
      <number>XXXX-XXXX-XXXX-1111</number>
    </payment_method>
    <api_urls>
    </api_urls>
  </transaction>
</transactions>

Thoughts?

from spreedly-gem.

duff avatar duff commented on August 15, 2024

Hi @sosedoff,

Looks like the message there says:

 <message key="messages.cannot_use_redacted_gateway">Unable to use a gateway because it's been redacted.</message>

from spreedly-gem.

duff avatar duff commented on August 15, 2024

Looks like the gateway you're trying to use to do the purchase has been redacted.

from spreedly-gem.

sosedoff avatar sosedoff commented on August 15, 2024

@duff, i know, this is intended. I was testing purchase on redacted gateway. The problem is with command
that returns transactions history: env.list_transactions. It breaks.

from spreedly-gem.

duff avatar duff commented on August 15, 2024

Sorry @sosedoff,

I think I'm missing some context. How does it break? What error are you getting?

from spreedly-gem.

sosedoff avatar sosedoff commented on August 15, 2024

Im getting error when calling env.list_transactions. Backtrace:

/Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/common/fields.rb:10:in `block in initialize_fields': undefined method `at_xpath' for nil:NilClass (NoMethodError)
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/common/fields.rb:9:in `each'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/common/fields.rb:9:in `initialize_fields'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/transactions/gateway_transaction.rb:26:in `initialize'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/transactions/gateway_transaction.rb:13:in `new'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/transactions/gateway_transaction.rb:13:in `initialize'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/transactions/auth_purchase.rb:11:in `initialize'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/transactions/transaction.rb:14:in `new'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/transactions/transaction.rb:14:in `new_from'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/transactions/transaction.rb:37:in `block in new_list_from'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/nokogiri-1.6.0/lib/nokogiri/xml/node_set.rb:237:in `block in each'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/nokogiri-1.6.0/lib/nokogiri/xml/node_set.rb:236:in `upto'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/nokogiri-1.6.0/lib/nokogiri/xml/node_set.rb:236:in `each'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/transactions/transaction.rb:36:in `map'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/transactions/transaction.rb:36:in `new_list_from'
    from /Users/sosedoff/.rvm/gems/ruby-2.0.0-p247@gimme/gems/spreedly-2.0.4/lib/spreedly/environment.rb:81:in `list_transactions'

Then i monkey-patched connection class to get response output before it gets processed by the library.
I provided response body in my previous message. Sorry, i was not very clear in describing the issue.

from spreedly-gem.

duff avatar duff commented on August 15, 2024

Coolo. If you could share the transaction's token, I should be able to replicate it here and see if I can put together a fix.

from spreedly-gem.

sosedoff avatar sosedoff commented on August 15, 2024

Ok, let me lookup the exact transaction token.

from spreedly-gem.

sosedoff avatar sosedoff commented on August 15, 2024

Here is the transaction token that triggers error on both find_transaction and list_transactions:

D23rZq2muGCYQUMVGu1a2qcG9PK

from spreedly-gem.

duff avatar duff commented on August 15, 2024

Just pushed a new version of the gem with the fix.

Thanks for the help in narrowing it down! This was the fix in case you're curious: d58a51e

version 2.0.5 of the gem includes the fix.

from spreedly-gem.

sosedoff avatar sosedoff commented on August 15, 2024

Thanks for the quick fix!

from spreedly-gem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.