Quantcast
Channel: Square Developer Forums - Latest topics
Viewing all articles
Browse latest Browse all 1325

Uninitialized constant BearerAuthCredentials

$
0
0

Hi there, I’ve recently updated my square gem in a rails project to:

square.rb (38.1.1.20240717)
      apimatic_core (~> 0.3.9)
      apimatic_core_interfaces (~> 0.2.1)
      apimatic_faraday_client_adapter (~> 0.1.4)

I’m aware that we need to change the authentication from:

      client = Square::Client.new(
        access_token: Rails.application.credentials.dig(Rails.env.to_sym, :square, :access_token),
        environment: 'sandbox'
      )

to:

client = Square::Client.new(
        bearer_auth_credentials: BearerAuthCredentials.new(
          access_token: Rails.application.credentials.dig(Rails.env.to_sym, :square, :access_token)
        ),
        environment: 'sandbox'
      )

however when I run this, I get an error:

NameError (uninitialized constant [ControllerName]::BearerAuthCredentials):

Any suggestions?

Cheers

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 1325

Trending Articles