Comments (14)
I'd be curious if the error ever happens without zeus. Just trying to eliminate possibilities.
from spreedly-gem.
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.
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.
@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.
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.
Looks like the gateway you're trying to use to do the purchase has been redacted.
from spreedly-gem.
@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.
Sorry @sosedoff,
I think I'm missing some context. How does it break? What error are you getting?
from spreedly-gem.
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.
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.
Ok, let me lookup the exact transaction token.
from spreedly-gem.
Here is the transaction token that triggers error on both find_transaction
and list_transactions
:
D23rZq2muGCYQUMVGu1a2qcG9PK
from spreedly-gem.
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.
Thanks for the quick fix!
from spreedly-gem.
Related Issues (20)
- When will the new version be available?
- Search by metadata using list_payment_methods
- Feature: Return 'description' for Gateway tokens
- store_on_gateway - This API call cannot be made with a publishable API key HOT 1
- Rubygems new version
- Apple pay as a payment method
- uninitialized constant Spreedly::VERSION (NameError)
- MIssing support of email attribute HOT 1
- Support more fields for Spreedly::Refund response
- Support more fields for Spreedly::Authorization response
- Support for adding bank accounts
- Support currency option on `#verify_on_gateway` method HOT 3
- Is there a way to test API credentials? HOT 1
- Do you have testing mocks? HOT 1
- Don't raise exceptions for missing fields HOT 1
- De-emphasize support for the Spreedly gem HOT 4
- Callback url can't be blank Redirect url can't be blank HOT 5
- Complete receiver API HOT 1
- Support Stored Credentials
- Don't parse nil payment method attributes as empty strings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spreedly-gem.