Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

re: undefined method `shipping_method' #158

Open
ckw2013 opened this issue Jul 14, 2013 · 20 comments
Open

re: undefined method `shipping_method' #158

ckw2013 opened this issue Jul 14, 2013 · 20 comments

Comments

@ckw2013
Copy link

ckw2013 commented Jul 14, 2013

Hi,

I am currently trying to set up Spree Paypal Express. It does not seem to work at this stage. Whenever I try to checkout with Spree Paypal Express, it gives me this error:

undefined method `shipping_method' for #Spree::Order:0x714ac50

This is my gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.13'

gem 'mysql'

group :assets do
gem 'sass-rails', '> 3.2.3'
gem 'coffee-rails', '
> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

gem 'spree', '~> 2.0.3'
gem 'spree_gateway', :github => 'spree/spree_gateway', :branch => '2-0-stable'
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise' , branch: '2-0-stable'
gem 'spree_static_content', :github => 'spree/spree_static_content', branch: '2-0-stable'
gem 'spree_editor', :github => 'spree/spree_editor'

gem 'spree_contact_us', :github => 'rterbush/spree_contact_us', branch: '2-0-stable'
gem 'spree_newsletter_subscribers', :github => 'Michael1969/Spree-Newsletter-Subscribers', branch: 'master'
gem 'datashift'
gem 'datashift_spree'

gem 'spree_paypal_express', :git => 'git://github.com/spree/spree_paypal_express.git', :branch => '2-0-stable'

gem 'therubyracer', :platforms => :ruby

group :development do
gem 'quiet_assets'
end

What would be the best way to resolve this issue? Thanks.

Thanks,

K

@ckw2013
Copy link
Author

ckw2013 commented Jul 14, 2013

Hi,

I have added all the standard shipping methods and shipping categories. I am currently setting Spree Paypal Express for a New Zealand based Spree website. Thanks.

Thanks,

K

@kylemacey
Copy link

+1

@radar
Copy link

radar commented Jul 23, 2013

Hi @ckw2013 + @kylemacey, could you please do me a favour and attempt to use the better_spree_paypal_express extension which I mention here? https://groups.google.com/forum/#!topic/spree-user/zXSL3Y1GAUw. My extension should be a replacement for spree's spree_paypal_express extension, but I need some beta testers to give it a run through. If you could do that, then that'd be mighty helpful.

Thanks!

@vishalzambre
Copy link

after using this extension it gives me following error

ActiveRecord::SubclassNotFound in Spree/admin/payment_methods#index

Showing /Users/lebin/.rvm/gems/ruby-1.9.3-p125/bundler/gems/spree-9e4cfd575319/backend/app/views/spree/admin/payment_methods/index.html.erb where line #34 raised:

The single-table inheritance mechanism failed to locate the subclass: 'Spree::BillingIntegration::PaypalExpress'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Spree::PaymentMethod.inheritance_column to use another column for that information.

Extracted source (around line #34):

31:
32:
33:
34: <% @payment_methods.each do |method|%>
35:
36: <%= method.name %>
37: <%= method.type %>

Rails.root: /Users/lebin/Workspace/ship.li
Application Trace | Framework Trace | Full Trace

@radar
Copy link

radar commented Jul 23, 2013

@vishalzambre Please remove any Payment Method from your DB that uses Spree::BillingIntegration::PayPalExpress. That is what is causing this problem.

@vishalzambre
Copy link

NoMethodError in Spree::Admin::PaymentMethodsController#create

undefined method `new' for PayPal:Module

@radar
Copy link

radar commented Jul 23, 2013

Please provide stack traces when posting about errors. Please file a new issue on the better_spree_paypal_express project with this error, the related stack trace your Gemfile, and steps to reproduce the error. Thanks!

On Tue, Jul 23, 2013 at 5:00 PM, Vishal Zambre [email protected]
wrote:

NoMethodError in Spree::Admin::PaymentMethodsController#create

undefined method `new' for PayPal:Module

Reply to this email directly or view it on GitHub:
#158 (comment)

@DavideMiozzi
Copy link

Hi,
I'm facing the same problem @ckw2013 is having. What's different in my case is that I removed the delivery step in the checkout flow, as we are selling digital goods.
I can't see why I should switch to better_spree_paypal_express if it can be used only with Paypal's sandbox and in development. My client wouldn't be very happy of getting just fake money.
I could have a look at the original extension and try to fix the issue myself, @radar, do you have any suggestions about where to start from?
Cheers.

@radar
Copy link

radar commented Aug 7, 2013

@DavideMiozzi: You're missing the whole point of the better_spree_paypal_express repo. You said this:

I can't see why I should switch to better_spree_paypal_express if it can be used only with Paypal's sandbox and in development. My client wouldn't be very happy of getting just fake money.

The whole point to the better_spree_paypal_express extension is to provide... a better spree paypal express extension. The way we're going about this is that we've got a complete rewrite of the extension underway in that repository. We need people to "kick the tyres" on it and make sure that it's working. While we don't encourage using it in production (and we even have a great big header in the README for that), it would be nice if some people did try putting through some test payments in a staging environment and make sure that it works with PayPal proper.

Not in any single place have I said that spree_paypal_express is absolutely dead and you should never ever ever use it. There are situations where it is applicable (1-3-stable and lesser, I think). It's very obviously broken for 2-0-stable and therefore I would appreciate some help getting better_spree_paypal_express up to scratch.

I could have a look at the original extension and try to fix the issue myself, @radar, do you have any suggestions about where to start from?

You're on your own here. I hate the original extension's code with the passion of a thousand burning suns and that's why I've elected to go for a rewrite of the whole thing.

@DavideMiozzi
Copy link

I got your point @radar, I'm a big fan of re-writing from scratch things that just don't work, the same way my boss is a big fan of getting things up and running by the next 15 minutes. That's why I was more prone in patching the old gem just to have something working quickly. But judging from how you despise it, I guess I had better find a different solution, waiting for the better_... to be ready and possibly contributing to it.
Cheers.

@radar
Copy link

radar commented Aug 9, 2013

I understand where your boss is coming from. He needs to understand though that its not as easy sometimes as just chucking in some code and hoping it works. Attempting to upgrade the current extension to be compatible with Spree 2.0 AND have it work "correctly" would be a mammoth effort.

Please beta test the new extension and let me know if you find any problems with it.

On Thu, Aug 8, 2013 at 5:48 PM, Davide Miozzi [email protected]
wrote:

I got your point @radar, I'm a big fan of re-writing from scratch things that just don't work, the same way my boss is a big fan of getting things up and running by the next 15 minutes. That's why I was more prone in patching the old gem just to have something working quickly. But judging from how you despise it, I guess I had better find a different solution, waiting for the better_... to be ready and possibly contributing to it.

Cheers.

Reply to this email directly or view it on GitHub:
#158 (comment)

@matthewashby
Copy link

Hi Radar, Is there any update on this?

We have just spent a fortnight configuring a new spree shop for a customer, only to find that Paypal Express payment appears broken. This is quite frustrating as the site still has it listed as a selling point (http://guides.spreecommerce.com/developer/payments.html).

@msevestre
Copy link

@matt: Have you tried the new (better) paypal extension?
https://github.com/radar/better_spree_paypal_express

On Thu, Aug 29, 2013 at 3:28 PM, matthewashby [email protected]:

Hi Radar, Is there any update on this?

We have just spent a fortnight configuring a new spree shop for a
customer, only to find that Paypal Express payment appears broken. This is
quite frustrating as the site still has it listed as a selling point (
http://guides.spreecommerce.com/developer/payments.html).


Reply to this email directly or view it on GitHubhttps://github.com//issues/158#issuecomment-23488838
.

@matthewashby
Copy link

No as it says it is not ready for production. If we are told that it is basically good-to-go then great, but if it is several months away then my client cannot wait.

@msevestre
Copy link

Maybe you could give it a test drive and see if it works in production?

On Thu, Aug 29, 2013 at 3:54 PM, matthewashby [email protected]:

No as it says it is not ready for production. If we are told that it is
basically good-to-go then great, but if it is several months away then my
client cannot wait.


Reply to this email directly or view it on GitHubhttps://github.com//issues/158#issuecomment-23490771
.

@GeekOnCoffee
Copy link

Last I had heard, the only reason the "not ready for production" warning is in place, is because nobody has used it in production enough to validate that it works. I'd take a look at the open issues, make sure there's nothing that is a show-stopper, and then give it a try.

@matthewashby
Copy link

Can it be used in production? Is anyone else running it?

@peterberkenbosch
Copy link
Member

I will be running a master version on Spree master real soon. Have it
setup already, still working on content..

Peter.

matthewashby mailto:[email protected]
August 29, 2013 3:58 PM

Can it be used in production? Is anyone else running it?


Reply to this email directly or view it on GitHub
#158 (comment).

@matthewashby
Copy link

We would consider running it live if:

  1. We can get another payment method working to fall back on
  2. We are not going to be left on our own if we need support

@radar
Copy link

radar commented Aug 30, 2013

@matthewashby There is no reason that I can see why it would not work in production. It has been tested on PayPal's own sandbox and the tests are passing. Please do try it out in production next week. If you need any help with it, please contact me directly on irc.freenode.net #spree, or by email: [email protected].

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

No branches or pull requests

9 participants