x

square payment gateway integration error using php

Exception when calling TransactionApi->charge:

C:\wamp\www\square_pay\v3\connect-php-sdk-master1\payment-process.php:38:
object(stdClass)[6]
  public 'errors' => 
    array (size=1)
      0 => 
        object(stdClass)[7]
          public 'category' => string 'AUTHENTICATION_ERROR' (length=20)
          public 'code' => string 'UNAUTHORIZED' (length=12)
          public 'detail' => string 'The `Authorization` http header of your request was malformed. The header value is expected to be of the format "Bearer TOKEN" (without quotation marks), where TOKEN is to be replaced with your access token (e.g. "Bearer ABC123def456GHI789jkl0"). For more information, see https://developer.squareup.com/docs/build-basics/using-rest-api#__set-the-headers__. If you are seeing this error message while using one of our officially supported SDKs, please report this to developers@squareup.com.' (length=491)
1,145 Views
Message 1 of 3
Report
2 REPLIES 2
Alumni

Hi there @ndulg 👋

 

Did you happen to catch the link included within the text you shared with us here? There's a link to our page from our developer documentation about using the REST API. If you're not able to find what you need by reading through the steps there, I linked some developer resources here that should get you where you need to be.

 

For more information, see https://developer.squareup.com/docs/build-basics/using-rest-api#__set-the-headers__. If you are seeing this error message while using one of our officially supported SDKs, please report this to developers@squareup.com.

 

Did you see the above error message while using one of our officially supported SDKs? If so, please let us know by sending a message over to developers@squareup.com.

 

Valentina
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
1,089 Views
Message 2 of 3
Report

It would be great to see integrate square payment gateway.

697 Views
Message 3 of 3
Report