Chris Todorov
02/13/2023, 6:37 PMBFX462heo
02/14/2023, 7:45 AMTyler Kocheff
02/15/2023, 2:20 PMYou have already activated stringio 3.0.4, but your Gemfile requires stringio 3.0.5. Prepending 'bundle exec' to your command may solve this. (Gem::LoadError)
We have a couple Solidus sites on the same Hatchbox server, and sometimes doing a bundle update
on one causes this error. Only way around it I have found so far is to go into the Ruby version the site is running on, and do a gem install stringio -v 3.0.5
which fixes it for that site. Yesterday I did this, and it fixed the site I was working on, but broke another Solidus site running on that server until I did a bundle update
on that one as well. Looks like stringio
is required by psych
which is required by solidus_core
. Is there any way to prevent this from happening?Zyad A
02/15/2023, 7:27 PMconfig.active_storage.service_urls_expire_in = false
BFX462heo
02/17/2023, 10:50 AMjakemumu
02/18/2023, 7:10 AM➜ sandbox git:(main) ✗ bin/rails server
The git source <https://github.com/solidusio/solidus.git> is not yet checked out. Please run `bundle install` before trying to start your application
➜ sandbox git:(main) ✗ bundle install
Fetching <https://github.com/solidusio/solidus.git>
fatal: Needed a single revision
Git error: command `git rev-parse --verify ''` in directory
/Users/jacobpenn/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/cache/bundler/git/solidus-169f1ecb1aee2122950e6d586daf2410f62df66e has failed.
Revision does not exist in the repository <https://github.com/solidusio/solidus.git>. Maybe you misspelled it?
If this error persists you could try removing the cache directory
'/Users/jacobpenn/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/cache/bundler/git/solidus-169f1ecb1aee2122950e6d586daf2410f62df66e'
Sébastien Ternest
02/20/2023, 5:26 PM/admin/payments
and create a new Stripe payment using the static preferences.”
/admin/payments => no route ...Do you mean /admin/payments_methods ?
Sébastien Ternest
02/20/2023, 5:35 PMTom Wilson
02/21/2023, 11:24 PMTom Wilson
02/21/2023, 11:26 PMshipment.ship
and order_shipping.ship
. It seems like there's some intention to potentially invert the relationship these method calls have with each other. (ie, today, shipment.ship
invokes order_shipping.ship_shipment
, and it seems like it might intend to be the other way?)Tom Wilson
02/21/2023, 11:26 PMTom Wilson
02/21/2023, 11:28 PMorder_shipping
and shipment
methods. (The order_shipping
method can update the state of the shipment to shipped
, but it does so via a direct column update rather than via the statemachine, and so therefore will not invoke state machine callbacks)BFX462heo
02/22/2023, 2:26 PMjakemumu
02/22/2023, 5:58 PMKurtis
02/23/2023, 11:06 AMsuper: no superclass method shipping_category_id' for #<Spree::Variant:0x00007fe5cd511cc8>
Kurtis
02/23/2023, 11:06 AMKurtis
02/23/2023, 11:06 AMKurtis
02/23/2023, 11:20 AMKurtis
02/23/2023, 11:57 AMKurtis
02/23/2023, 11:58 AMKurtis
02/23/2023, 12:51 PMZyad A
02/24/2023, 12:35 PMmodule PayMob
class Gateway
API_URL = "<https://accept.paymob.com/api>"
attr_reader :api_key
def initialize(options)
@api_key = options.fetch(:api_key)
end
def authorize(money, auth_token, options = {})
response = request(
:post,
"/auth/tokens",
payload_for_charge(money, auth_token, options).merge(capture: false),
)
if response.success?
ActiveMerchant::Billing::Response.new(
true,
"Transaction Authorized",
{},
authorization: response.parsed_response["token"],
)
else
ActiveMerchant::Billing::Response.new(
false,
response.parsed_response["error"],
)
end
end
#changed the option parameters as per the API
def purchase(money, auth_token, options = {})
response = request(
:post,
'/ecommerce/orders',
{
"auth_token": authorization,
"delivery_needed": false,
"amount_cents": money,
"items": []
}
)
if response.success?
ActiveMerchant::Billing::Response.new(
true,
"Transaction Purchased",
{},
order_key: response.parsed_response["id"],
)
else
ActiveMerchant::Billing::Response.new(
false,
response.parsed_response["error"],
)
end
end
def capture(money, transaction_id, options = {})
response = request(
:post,
'acceptance/payment_keys',
{
"auth_token": authorization,
"amount_cents": money,
"expiration": 3600,
"order_id": order_key,
"billing_data": {},
"currency": "EGP",
"integration_id": 3410599
}
)
if response.success?
ActiveMerchant::Billing::Response.new(
true,
"Transaction Captured",
{},
token: response.parsed_response["token"],
)
else
ActiveMerchant::Billing::Response.new(
false,
response.parsed_response["error"],
)
end
end
private
def request(method, uri, body = {})
HTTParty.send(
method,
"#{API_URL}#{uri}",
headers: {
"Authorization" => "Bearer #{api_key}",
"Content-Type" => "application/json",
"Accept" => "application/json",
},
body: body.to_json,
)
end
def payload_for_charge(money, auth_token, options = {})
{
auth_token: auth_token,
amount: money,
currency: options[:currency],
description: "Payment #{options[:order_id]}",
billing_address: options[:billing_address],
}
end
end
end
class PayMob::PaymentMethod < Spree::PaymentMethod
end
Ashish Khetarpal
02/25/2023, 6:44 AMBFX462heo
02/27/2023, 9:55 AMbundle
? Or do I need to do something else?
Thanks in advance.Georg Keferböck
03/01/2023, 5:00 PMTest Account
03/01/2023, 11:48 PM/home/myuser/.bundle/ruby/3.1/bundler/gems/rails-5cbf61502c69/activerecord/lib/active_record/attribute_methods/serialization.rb:207:in 'serialize': missing keyword: :coder If no default coder is configured, a coder must be provided to serialize. (ArgumentError)
`from /home/myuser/myapp/vendor/solidus/core/lib/spree/preferences/persistable.rb10in block in <module:Persistable>'
persistable.rb
looks like this:
module Spree
module Preferences
module Persistable
extend ActiveSupport::Concern
included do
include Spree::Preferences::Preferable
serialize :preferences, Hash
after_initialize :initialize_preference_defaults
end
private
def initialize_preference_defaults
if has_attribute?(:preferences)
self.preferences = default_preferences.merge(preferences)
end
end
end
end
end
Any idea what to do?Tyler Kocheff
03/06/2023, 4:01 PMFotios Lindiakos
03/06/2023, 11:42 PMcartons
where all the products would be in a single order (3xA and 6xB) and then break it up into 3 cartons (1xA and 2xB, 1xA and 2xB, ...). at least in that case, the payment data model stays the same (1 payment for 1 order). but the order's "state" gets a little more complicated w.r.t shipment status. another approach would be to generate 3 distinct orders, but it seems trickier to get them all under a single payment.
does anybody have any suggestions or prior art on doing something like this?BFX462heo
03/07/2023, 9:57 AMrails db:rollback STEP=2
command, the schema.rb
is modified in all the tables rather than only PayPal tables. The rollback command removes all the null: false
from all the columns of all the tables....Tyler Kocheff
03/07/2023, 2:52 PMsolidus_auth_devise
we would like to require users to confirm their email address if the order total is below a certain amount before they can check out as a fraud prevention measure (lots of fraudulent orders on the cheapest items in the store). We have this part working with some monkey patching, but noticed if the user registers an account during check out, once they confirm and log in, their cart is not associated, so they login to an empty cart.
Found the setting allow_unconfirmed_access_for
which does let the cart associate but then allows the user to check out without confirming their email first. Is there any way to associate the cart immediately upon account creation without letting a user check out while unconfirmed? Or maybe block checkout from fully completing if the user hasn't confirmed their email yet? My initial thought is that maybe the latter might be easier to implement.
I found some of the logic in the warden
and devise
gem, but wondering if anyone has worked this out already or if there's a different setting I'm missing.
Edit: Maybe this actually isn't working. I can't reproduce it in the normal checkout flow, but after deploying this yesterday, somehow over 12 guest orders have still come through that should have been forced to register. Not sure if there's some other way these might be coming in? Hoping anyone has any insight.
Edit 2 (sorry): Looks like the method I took is only blocking the frontend form from appearing, so hitting the /checkout/registration
endpoint with a valid auth token and the email field filled out still allows a user to guest checkout. Not sure if we did this wrong or if this is a bug.