Having some trouble with the Solidus Paypal Commer...
# support
t
Having some trouble with the Solidus Paypal Commerce Platform gem. Just upgraded this site to Solidus 3 and Ruby 3 and noticed this after, but can't confirm it was working before since the last Paypal payment processed was back in September and reverting all my changes doesn't seem to fix it. We're using Hatchbox Classic with nginx in case that may be relevant. Currently during checkout if someone selects Paypal as the payment type and clicks the Paypal button, the Paypal popup opens and immediately throws an alert "There was a problem connecting with PayPal." The console shows:
Copy code
#<OpenStruct name="AUTHENTICATION_FAILURE", message="Authentication failed due to invalid authentication credentials or a missing Authorization header.", links=[#<OpenStruct href="<https://developer.paypal.com/docs/api/overview/#error>", rel="information_link">]>
Traced it back to models/solidus_paypal_commerce_platform/gateway.rb in the
create_order
block. I added a
binding.pry
before
@client.execute(request)
and the request doesn't seem to have any bearer token. If I do
request.headers["Authorization"] = "Bearer (redacted bearer token)"
it works. Not sure how the gem would normally handle the authentication but if anyone has any pointers, please let me know.
Temporarily reverted to a fork of an older commit of the gem
07e58774090add0660b175bfaf22f0925884f6b3
which seems to work after updating the gemspec to allow Ruby 3 and monkey patching to fix an error where it is trying to call URL.escape. Still hoping to figure out what's wrong with the current version of the gem in our installation.
w
@Tyler Kocheff, does it work with
07e58774090add0660b175bfaf22f0925884f6b3
but not with
c4e7fb9b3a7c48cb4f90129b725ad46995822bfb
?
t
Actually, it works with that one too. I had assumed that change might have broken it, but it looks like it's the next one that it's broken on:
fee386c89cc76300fab98e0e17a31c9ceac5e4f9
w
That commit has something relevant: renaming
authorizationString
method to
authorization_string
. Is it possible that you are using the old name somewhere? Do you have something for
grep -r authorizationString .
in your project root?