Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ahmadoji01 opened this issue Jun 9, 2021 · 5 comments
Labels

Comments

@ahmadoji01
Copy link

ahmadoji01 commented Jun 9, 2021

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'

@ahmadoji01
Copy link
Author

Solved by downgrading the Ruby version from 3.0.1 to 2.7.3.

I will keep this open until the developers notice

@mtylty
Copy link

mtylty commented Jun 21, 2021

@uzzybotak thanks for opening and issue. This is definitely worth checking out.

@stale
Copy link

stale bot commented Aug 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 21, 2021
@RyanofWoods
Copy link
Contributor

Hi there @ahmadoji01 👋 Thank you for the issue, but apologies for the delay.

I looked into this deeper and it turns out the the dependency paypal-checkout-sdk does not support Ruby 3.0 yet.

Thank you for bringing it to our attention. I will update the gemspec and we will make this gem support Ruby 3.0 as soon as the paypal dependencies support it 👍


ps. I just want to note, if you setup the PaymentMethod/Gateway by static_model_preferences, then you should not need to use the wizard. As the wizard is for setting up the PaymentMethod when you do not have credentials. But regardless, the Ruby 3.0 incompatibility affects the whole gem and not just the wizard.

@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants