Skip to content

"Something went wrong" after clicking the Accept and Integrate button on PayPal integration wizard page #132

@ahmadoji01

Description

@ahmadoji01

The environment I used:
Rails 6.1.3 @ Local Development Environment
MacOS BigSur 11.2.3 Terminal
Ruby 3.0.1

What I have done:

  1. Run the rails generate solidus_paypal_commerce_platform:install command
  2. Configuring the Solidus PayPal API credentials on config/initializers/spree.rb with these lines
config.static_model_preferences.add(
    SolidusPaypalCommercePlatform::PaymentMethod,
    'paypal_commerce_platform_credentials', {
      test_mode: !Rails.env.production?,
      client_id: 'credential goes here',
      client_secret: 'credential goes here',
      display_on_product_page: true,
      display_on_cart: true,
    }
  )

How I reproduce the errors:

  1. Login to Admin Panel
  2. Go to Settings > Payment Page
  3. Click the "Setup PayPal Commerce Platform" button
  4. Fill in the email and password on PayPal Commerce Platform integration wizard popup from PayPal
  5. Click the "Accept and Integrate" button
  6. Popup closed and the admin panel says "Something went wrong"

Messages from Rails Console:

Started POST "/solidus_paypal_commerce_platform/wizard" for ::1 at 2021-06-09 22:33:18 +0700
Processing by SolidusPaypalCommercePlatform::WizardController#create as */*
  Parameters: {"authCode"=>"C21AAIERkUIiMjzR2HUuKm6BV53--PNPuN-RdzCTvDsXOEJT9_m7n5yN0gxiqNgIRaOFe5Tj1fkwAdfg9PjY2JEMcx6ZmXrYQ", "sharedId"=>"AWZG0SyysxSuqGnm4HZHKIYt2QLaNP2E4CwARJo5RSbnurdSVtQ6FavjIww7OusNGR24MqAKtc_x8jjO", "nonce"=>"xBRMZHxqyfpM2hNRD5tGhtDFRVtuI1Z5xhftE1KwiZB477UYkliUY5Kov4ioQd9qM151DbLmBIPOVrKMdqOVGnXrtQHpIhYVyNIJzS2Z8VYHHOdbnpeADI7khFxe60b5"}
  Spree::User Load (0.4ms)  SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."spree_api_key" = ? LIMIT ?  [["spree_api_key", "ca56066af735e67b192d66544ade6e9e09b46034c5be283e"], ["LIMIT", 1]]
   (0.1ms)  SELECT "spree_roles"."name" FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = ?  [["user_id", 1]]
  Spree::Role Load (0.1ms)  SELECT "spree_roles".* FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = ?  [["user_id", 1]]
Completed 500 Internal Server Error in 38ms (ActiveRecord: 0.6ms | Allocations: 7474)


  
NoMethodError (undefined method `escape' for URI:Module):
  
paypalhttp (1.0.0) lib/paypalhttp/serializers/form_encoded.rb:8:in `block in encode'
paypalhttp (1.0.0) lib/paypalhttp/serializers/form_encoded.rb:7:in `each'
paypalhttp (1.0.0) lib/paypalhttp/serializers/form_encoded.rb:7:in `encode'
paypalhttp (1.0.0) lib/paypalhttp/encoder.rb:23:in `serialize_request'
paypalhttp (1.0.0) lib/paypalhttp/http_client.rb:72:in `execute'
solidus_paypal_commerce_platform (0.3.2) lib/solidus_paypal_commerce_platform/client.rb:29:in `execute'
solidus_paypal_commerce_platform (0.3.2) lib/solidus_paypal_commerce_platform/client.rb:51:in `fetch_api_credentials'
solidus_paypal_commerce_platform (0.3.2) app/controllers/solidus_paypal_commerce_platform/wizard_controller.rb:40:in `api_credentials'
solidus_paypal_commerce_platform (0.3.2) app/controllers/solidus_paypal_commerce_platform/wizard_controller.rb:32:in `payment_method_params'
solidus_paypal_commerce_platform (0.3.2) app/controllers/solidus_paypal_commerce_platform/wizard_controller.rb:10:in `create'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions