All of a sudden my credit card fields can no longer take input. Was working fine a few weeks ago, now the fields show up but they can take no user input.
Add event to cart and go to next page and see how it doesnt work. Any help is appreciated.
All of a sudden my credit card fields can no longer take input. Was working fine a few weeks ago, now the fields show up but they can take no user input.
Add event to cart and go to next page and see how it doesnt work. Any help is appreciated.
@jeremyredd it looks like you are using the SqPaymentForm
. That for is fully retired. You’ll need to migrate to the Web Payments SDK to process payments.
Thanks Bryan, are their any code examples we can use like with the previous PHP integration?
Yes, we do have a PHP sample.
Bryan
Getting a error in PHP code after following all instructions----
Warning : Use of undefined constant CURLAUTH_BASIC - assumed ‘CURLAUTH_BASIC’ (this will throw an Error in a future version of PHP) in C:\inetpub\wwwroot\ecomlab\vendor\apimatic\unirest-php\src\Unirest\Request.php on line 89
Warning : Use of undefined constant CURLPROXY_HTTP - assumed ‘CURLPROXY_HTTP’ (this will throw an Error in a future version of PHP) in C:\inetpub\wwwroot\ecomlab\vendor\apimatic\unirest-php\src\Unirest\Request.php on line 89
Warning : Use of undefined constant CURLAUTH_BASIC - assumed ‘CURLAUTH_BASIC’ (this will throw an Error in a future version of PHP) in C:\inetpub\wwwroot\ecomlab\vendor\apimatic\unirest-php\src\Unirest\Request.php on line 89
Fatal error : Uncaught TypeError: Argument 1 passed to Square\ApiHelper::appendUrlWithTemplateParameters() must be of the type string, null given, called in C:\inetpub\wwwroot\ecomlab\vendor\square\square\src\SquareClient.php on line 304 and defined in C:\inetpub\wwwroot\ecomlab\vendor\square\square\src\ApiHelper.php:47 Stack trace: #0 C:\inetpub\wwwroot\ecomlab\vendor\square\square\src\SquareClient.php(304): Square\ApiHelper::appendUrlWithTemplateParameters(NULL, Array, false) #1 C:\inetpub\wwwroot\ecomlab\vendor\square\square\src\Apis\LocationsApi.php(176): Square\SquareClient->getBaseUri() #2 C:\inetpub\wwwroot\ecomlab\utils\location-info.php(31): Square\Apis\LocationsApi->retrieveLocation(‘67DE3EQ108NQZ’) #3 C:\inetpub\wwwroot\ecomlab\utils\location-info.php(50): LocationInfo->__construct() #4 C:\inetpub\wwwroot\ecomlab\index.php(3): include(‘C:\inetpub\wwwr…’) #5 {main} thrown in C:\inetpub\wwwroot\ecomlab\vendor\square\square\src\ApiHelper.php on line 47
Is this with the PHP sample? Were you first able to get it to run by following the README.md?
Yes, I have gotten it further along, followed example and readme file. Now I am getting this error when hitting the pay button"
Error: SyntaxError: Unexpected token ‘<’, “
”… is not valid JSON
You can see it here, set in sandbox mode.
https://nac-issa.org/squareecom/
Please help, desperate
When I tested I got:
**Fatal error** : Uncaught TypeError: Argument 1 passed to Square\ApiHelper::appendUrlWithTemplateParameters() must be of the type string, null given, called in D:\vhosts\nac-issa.org\httpdocs\SquareEcom\vendor\square\square\src\SquareClient.php on line 304 and defined in D:\vhosts\nac-issa.org\httpdocs\SquareEcom\vendor\square\square\src\ApiHelper.php:47 Stack trace: #0 D:\vhosts\nac-issa.org\httpdocs\SquareEcom\vendor\square\square\src\SquareClient.php(304): Square\ApiHelper::appendUrlWithTemplateParameters() #1 D:\vhosts\nac-issa.org\httpdocs\SquareEcom\vendor\square\square\src\Apis\PaymentsApi.php(163): Square\SquareClient->getBaseUri() #2 D:\vhosts\nac-issa.org\httpdocs\SquareEcom\process-payment.php(56): Square\Apis\PaymentsApi->createPayment() #3 {main} thrown in **D:\vhosts\nac-issa.org\httpdocs\SquareEcom\vendor\square\square\src\ApiHelper.php** on line **47**
Please try the latest code at:
https://nac-issa.org/squareecom/
there is no longer a PHP error, I fixed that. The new error your system is throwing is:
“square.js:1 Error: SyntaxError: Unexpected token ‘<’, “
”… is not valid JSON”
I still get the above error. I see you’ve added some alerts and a page to post the source_id
. If you revert those changes does it work?
negative, never makes it pass the bad json error…
square.js:1 Error: SyntaxError: Unexpected token ‘<’, “
”… is not valid JSON
If you print the request prior to sending it to our servers is it valid JSON?
removed all alerts, just sits there with same error in the console
seems this line in location-info.php is where is crashes
$location = $this->square_client->getLocationsApi()->retrieveLocation(getenv(‘SQUARE_LOCATION_ID’))->getResult()->getLocation();
Is the location_id
correctly set in the client?
.env file
SQUARE_LOCATION_ID=LWKNJHQZR11YN
Bumping this thread up to see if I can get a reply