Closed xeruf closed 2 years ago
Full Issue:
Started GET "/solidus_paypal_commerce_platform/shipping_rates?order_id=R977809399&order_token=[FILTERED]&address%5Bcity%5D=Berlin&address%5Bstate%5D=&address%5Bcountry_code%5D=DE&address%5Bpostal_code%5D=10117" for 127.0.0.1 at 2022-09-29 20:29:49 +0200
Processing by SolidusPaypalCommercePlatform::ShippingRatesController#simulate_shipping_rates as */*
Parameters: {"order_id"=>"R977809399", "order_token"=>"[FILTERED]", "address"=>{"city"=>"Berlin", "state"=>"", "country_code"=>"DE", "postal_code"=>"10117"}}
Spree::User Load (0.1ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."spree_api_key" = ? LIMIT ? [["spree_api_key", "undefined"], ["LIMIT", 1]]
Spree::Order Load (0.1ms) SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."number" = ? LIMIT ? [["number", "R977809399"], ["LIMIT", 1]]
Spree::User Load (0.1ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."id" = ? LIMIT ? [["id", 3], ["LIMIT", 1]]
CACHE Spree::Order Load (0.0ms) SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."number" = ? LIMIT ? [["number", "R977809399"], ["LIMIT", 1]]
CACHE Spree::User Load (0.0ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."id" = ? LIMIT ? [["id", 3], ["LIMIT", 1]]
TRANSACTION (0.0ms) begin transaction
Spree::Country Load (0.1ms) SELECT "spree_countries".* FROM "spree_countries" WHERE "spree_countries"."iso" = ? LIMIT ? [["iso", "DE"], ["LIMIT", 1]]
Spree::State Load (0.1ms) SELECT "spree_states".* FROM "spree_states" WHERE "spree_states"."country_id" = ? AND "spree_states"."abbr" = ? ORDER BY "spree_states"."name" ASC LIMIT ? [["country_id", 57], ["abbr", ""], ["LIMIT", 1]]
Spree::State Load (0.1ms) SELECT "spree_states".* FROM "spree_states" WHERE "spree_states"."country_id" = ? AND "spree_states"."name" = ? ORDER BY "spree_states"."name" ASC LIMIT ? [["country_id", 57], ["name", ""], ["LIMIT", 1]]
Spree::Store Load (0.0ms) SELECT "spree_stores".* FROM "spree_stores" WHERE "spree_stores"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
Spree::Order Exists? (0.1ms) SELECT 1 AS one FROM "spree_orders" WHERE "spree_orders"."number" = ? AND "spree_orders"."id" != ? LIMIT ? [["number", "R977809399"], ["id", 10], ["LIMIT", 1]]
Spree::Adjustment Load (0.0ms) SELECT "spree_adjustments".* FROM "spree_adjustments" WHERE "spree_adjustments"."order_id" = ? AND "spree_adjustments"."source_type" = ? [["order_id", 10], ["source_type", "Spree::PromotionAction"]]
Spree::LineItem Load (0.0ms) SELECT "spree_line_items".* FROM "spree_line_items" WHERE "spree_line_items"."order_id" = ? ORDER BY "spree_line_items"."created_at" ASC, "spree_line_items"."id" ASC [["order_id", 10]]
Spree::Product Load (0.0ms) SELECT "spree_products".* FROM "spree_products" INNER JOIN "spree_variants" ON "spree_products"."id" = "spree_variants"."product_id" WHERE "spree_variants"."id" = ? LIMIT ? [["id", 45], ["LIMIT", 1]]
TRANSACTION (0.0ms) rollback transaction
Completed 422 Unprocessable Entity in 35ms (Views: 0.2ms | ActiveRecord: 0.8ms | Allocations: 31326)
this only happens when I try to checkout with credit card or SEPA, if I use PayPal itself it works
Hi @xeruf 👋
Sorry, I am a bit confused, the PayPal screenshot is showing that the store cannot ship to the Berlin address, but this only happens when I try to checkout with credit card or SEPA, if I use PayPal itself it works
sounds like it's fine in PayPal. I am little confused. You'll need to state what countries you support shipping in by Spree::ShippingMethod
and possibly zones, you can do this via /admin/shipping_methods
.
The preference keys for the PaymentMethod can be found via terminal or code:
SolidusPaypalCommercePlatform::PaymentMethod.first.preferences.keys
=> [:server, :test_mode, :client_id, :client_secret, :paypal_button_color, :paypal_button_size, :paypal_button_shape, :paypal_button_layout, :display_on_cart, :display_on_product_page, :display_credit_messaging, :venmo_standalone, :force_buyer_country]
The following are only the extra ones that come from this PCP PaymentMethod, and doesn't show the standard ones from Solidus: https://github.com/solidusio/solidus_paypal_commerce_platform/blob/1f862dd0e2c4a3c22d5bb6f93e88d779cad1c845/app/models/solidus_paypal_commerce_platform/payment_method.rb#L6-L16
Thank you! Let me clarify: When I use this plugin and pay with a paypal account, it processes just fine, but when I use paypal payment without an account through Credit Card or SEPA I get this error.