spree-contrib / spree_marketplace Goto Github PK
View Code? Open in Web Editor NEWTurn Spree into a marketplace by extending spree drop ship.
Home Page: http://guides.spreecommerce.org
License: BSD 3-Clause "New" or "Revised" License
Turn Spree into a marketplace by extending spree drop ship.
Home Page: http://guides.spreecommerce.org
License: BSD 3-Clause "New" or "Revised" License
Hey guys. is this gem supportable with latest version of spree?
Hello,
I noticed the build is actually failing and i encounter the same issue with my development instance. I did a little bit digging around.(relative new to spree but have several years with rails). I think the issue lies in the ability configuration. The supplier only allowed to "admin" which does not actually grant "supplier" the ability to create product.
However, in the spree_ship_drop gem, it is also trying to limit the capability of supplier to recreate an existing product belonging to other suppliers. Can you explain this behavior a bit?
Currently, it is not supporting for rails5, do we expect any upgrade from this?
I am using rails 5 spree version 3.3.2 , i need a marketplace gem , but this gem is not working for this version kindly update it..
Hi,
Is there a way i can add stripe connect as the payment provider. I looked at the admin section and there is an option to add Stripe as the payment gateway but no 'Strip Connect'.
Thank you,
Hi Jeff,
This isn't really an issue I just didn't see any other place to contact you. I just wanted to clarify what the setting for commission rates mean for the suppliers. I assume that it means that the Stripe account owner will take x percentage from the transactions on those suppliers right? So if I wanted to take a 10% cut from all of Spree transactions I would need to specify that in the settings for each supplier?
Thanks!
Hi,
I have this problem on create supplier:
branch: stripe_2_2
NoMethodError in Spree::Admin::SuppliersController#create
undefined method `+' for nil:NilClass
recipient = Stripe::Recipient.create(
:name => (self.merchant_type == 'business' ? self.name : self.address.first_name + ' ' + self.address.last_name),
:type => (self.merchant_type == 'business' ? 'corporation' : "individual"),
:email => self.email,
:bank_account => self.bank_accounts.first.try(:token)
> require 'oauth2'
> class Spree::Admin::StripeConnectController < Spree::Admin::BaseController
>
> # before_filter :load_supplier
> before_filter :set_client, :only => [:setup, :stripeauth]
>
> def set_client
> @client = OAuth2::Client.new(ENV['stripe_client_id'], ENV['stripe_api_key'], {:site => 'https://connect.stripe.com', :authorize_url => '/oauth/authorize', :token_url => '/oauth/token'})
> end
>
> def index
> end
>
> _**def stripeauth**_
> # brand_id = spree_current_user.supplier_id
> # url = @client.auth_code.authorize_url({:scope => 'read_write'})
> # logger.info "Redirect: #{brand_id}: #{@client.inspect}: #{url}"
> # redirect_to url
> end
>
> def setup
> code = params["code"]
> @resp = @client.auth_code.get_token(code, :params => {:scope => 'read_write'})
> @access_token = @resp.token
> @refresh_token = @resp.refresh_token
> @stripe_user_id = @resp["stripe_user_id"]
> @stripe_publishable_key = @resp["stripe_publishable_key"]
> SpreeStripeAccount.save_tokens(@access_token, @refresh_token, @stripe_user_id, @stripe_publishable_key)
> redirect_to "/be/admin/"
> end
>
> private
> def load_supplier
> @supplier = Spree::Supplier.friendly.find(params[:supplier_id])
> end
> end
>
>
Hi, I keep getting unauthorized when calling stripeauth. Where is the permission of supplier set?
I'd like to pitch in and help with spree_marketplace, spree_drop_ship, and other projects of yours. Most pressing is getting them to work with Spree >= 2.1 and Rails 4.0.0. I see @pusewicz has already commented on spree_drop_ship for the same reason.
Can you tell me roughly what needs to be done? I'll get to work and put together a pull request.
Thanks!
Hi,
After installing spree_marketplace and spree_dropship, I encountered and error when creating a test supplier. "Undefined method + for nil class". Strang thing is that I can't find that method.
Here's the server dump :
NoMethodError (undefined method `+' for nil:NilClass):
/Library/Ruby/Gems/2.0.0/bundler/gems/spree_marketplace-f08bf563f6a1/app/models/spree/supplier_decorator.rb:25:in `stripe_recipient_setup'
activesupport (4.1.0) lib/active_support/callbacks.rb:424:in `block in make_lambda'
activesupport (4.1.0) lib/active_support/callbacks.rb:160:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:160:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `run_callbacks'
activerecord (4.1.0) lib/active_record/callbacks.rb:306:in `create_record'
activerecord (4.1.0) lib/active_record/timestamp.rb:57:in `create_record'
activerecord (4.1.0) lib/active_record/persistence.rb:482:in `create_or_update'
activerecord (4.1.0) lib/active_record/callbacks.rb:302:in `block in create_or_update'
activesupport (4.1.0) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `run_callbacks'
activerecord (4.1.0) lib/active_record/callbacks.rb:302:in `create_or_update'
activerecord (4.1.0) lib/active_record/persistence.rb:103:in `save'
activerecord (4.1.0) lib/active_record/validations.rb:51:in `save'
activerecord (4.1.0) lib/active_record/attribute_methods/dirty.rb:21:in `save'
activerecord (4.1.0) lib/active_record/transactions.rb:268:in `block (2 levels) in save'
activerecord (4.1.0) lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `block in transaction'
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/database_statements.rb:219:in `within_new_transaction'
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
activerecord (4.1.0) lib/active_record/transactions.rb:208:in `transaction'
activerecord (4.1.0) lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
activerecord (4.1.0) lib/active_record/transactions.rb:268:in `block in save'
activerecord (4.1.0) lib/active_record/transactions.rb:283:in `rollback_active_record_state!'
activerecord (4.1.0) lib/active_record/transactions.rb:267:in `save'
/Library/Ruby/Gems/2.0.0/bundler/gems/spree-9f8ad3db225f/backend/app/controllers/spree/admin/resource_controller.rb:47:in `create'
actionpack (4.1.0) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.0) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.0) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.0) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.0) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.0) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.0) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.0) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.0) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.1.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.0) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:676:in `call'
railties (4.1.0) lib/rails/engine.rb:514:in `call'
railties (4.1.0) lib/rails/railtie.rb:194:in `public_send'
railties (4.1.0) lib/rails/railtie.rb:194:in `method_missing'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:676:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:35:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
activerecord (4.1.0) lib/active_record/migration.rb:380:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.0) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.0) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.0) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.0) lib/rails/engine.rb:514:in `call'
railties (4.1.0) lib/rails/application.rb:144:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
logging (1.8.2) lib/logging/diagnostic_context.rb:323:in `call'
logging (1.8.2) lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
Hi Jeff,
Please merge from railsdog/spree_marketplace so this gem would be a little more current and compatible with spree/spree [3-0-stable]
-Nghia
There is a minor issue related to Stripe when filling for the first time a Supplier profile.
Stripe::InvalidRequestError in Spree::Admin::SuppliersController#update
--
Name must contain first name and last name.
If the supplier's company name is made of a single word, Spree crashes when updating his Stripe account because Stripe recipients creation/editing require a two-words name for all recipient of individual
type. It could be correct with a single word name if the stripe account was of a corporation
type but it seems that Suppliers are locked on individual
in spree_marketplace.
The recipient's full, legal name. For type individual, should be in the format "First Last", "First Middle Last", or "First M Last" (no prefixes or suffixes). For corporation, the full incorporated name.
So two ways to fix it would be to:
"First Last"
format. (But it would be blocking for some company)individual
to a corporation
accountGetting error while running locally and attempting to access to /admin/products
.
It says undefined method scoped
:
GemFile:
source 'https://rubygems.org'
ruby '2.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
group :production, :staging do
gem "pg"
gem 'rails_12factor'
end
group :development, :test do
gem "sqlite3-ruby"
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'spree'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-3-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-3-stable'
gem 'spree_drop_ship', github: 'jdutil/spree_drop_ship'
gem 'spree_marketplace', github: 'jdutil/spree_marketplace'
Whe I install de gem shows me this error
Bundler could not find compatible versions for gem "spree_core":
In snapshot (Gemfile.lock):
spree_core (= 3.2.1)
In Gemfile:
spree (~> 3.2.1) was resolved to 3.2.1, which depends on
spree_core (= 3.2.1)
spree (~> 3.2.1) was resolved to 3.2.1, which depends on
spree_core (= 3.2.1)
spree (~> 3.2.1) was resolved to 3.2.1, which depends on
spree_core (= 3.2.1)
spree (~> 3.2.1) was resolved to 3.2.1, which depends on
spree_core (= 3.2.1)
spree (~> 3.2.1) was resolved to 3.2.1, which depends on
spree_core (= 3.2.1)
spree_marketplace was resolved to 2.0.0.beta, which depends on
spree_core (~> 2.3.0)
Help me to solve this error
Maybe I'm wrong, but as a supplier, I can add new images to a product from another vendor if I access /admin/products/not-my-product/images
From the supplier_ability.rb
can [:admin, :manage], Spree::Image do |image|
image.viewable.product.supplier_ids.include?(user.supplier_id)
end
can :create, Spree::Image
How can i patch this?
Any help would be welcome.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.