# Square payments api v2 giving payment process 404 error

**URL:** <https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817>\
**Category:** Questions\
**Tags:** square-online, checkout-api, sdk, payments-api\
**Created:** [June 16, 2021, 9:49am UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817 "2021-06-16T09:49:24Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaeel1625](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shaeel1625](https://developer.squareup.com/forums/u/shaeel1625)\
**Post date:** [June 16, 2021, 9:49am UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/1 "2021-06-16T09:49:24Z")

</div>

i am trying to integrate square payments php api in my website, i am using this source i have followed all the steps but it gives me an error when i proceed to payment after inputting all the card details, the console shows /process payment 404 not found, like the one shown below.  
The payment process file is already in the folder, only change i made from the source is that i used “composer install” instead of “composer.phar install” because that was not working.

 ![1_Poundland-Promotion](https://global.discourse-cdn.com/square/original/1X/54a255394a39f2194e28ca16890273eda0f32e2b.jpeg)

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [June 16, 2021, 4:48pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/2 "2021-06-16T16:48:23Z")

</div>

👋 What is the source that you are using? Doesn’t look like the link was included in the post. Looking at the error you are correct the it’s definitely not finding the payment request. I’ll be on the lookout for your response with the source.

---

<div class="post-metadata">

**Author:** ![shaeel1625](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shaeel1625](https://developer.squareup.com/forums/u/shaeel1625)\
**Post date:** [June 17, 2021, 11:28am UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/3 "2021-06-17T11:28:28Z")

</div>

> **[square/connect-api-examples](https://github.com/square/connect-api-examples/tree/master/connect-examples/v2/php_payment)**
>
> master/connect-examples/v2/php\_payment

This is the link I am using as a source. I got it from Square developer forum.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [June 17, 2021, 6:11pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/4 "2021-06-17T18:11:26Z")

</div>

👋 Thanks for bringing this to our attention. We found the issue and a fix has been deployed. You can now get the updated example. 🙂

---

<div class="post-metadata">

**Author:** ![shaeel1625](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shaeel1625](https://developer.squareup.com/forums/u/shaeel1625)\
**Post date:** [June 17, 2021, 8:22pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/5 "2021-06-17T20:22:08Z")

</div>

ok thanks for that please tell where i can get the updated example? on the same link ?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [June 17, 2021, 10:06pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/6 "2021-06-17T22:06:08Z")

</div>

Yes, the same link has been updated.

---

<div class="post-metadata">

**Author:** ![shaeel1625](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shaeel1625](https://developer.squareup.com/forums/u/shaeel1625)\
**Post date:** [June 18, 2021, 12:13pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/7 "2021-06-18T12:13:08Z")

</div>

I am using the updated version of V2 payment but I am getting the same Error The only thing i am doing differently from the source is using “composer install” instead of “composer.phar install”.

---

<div class="post-metadata">

**Author:** ![shaeel1625](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shaeel1625](https://developer.squareup.com/forums/u/shaeel1625)\
**Post date:** [June 19, 2021, 6:30pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/8 "2021-06-19T18:30:00Z")

</div>

hello Bryan-square i am looking for the response  
thanks!

---

<div class="post-metadata">

**Author:** ![shaeel1625](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shaeel1625](https://developer.squareup.com/forums/u/shaeel1625)\
**Post date:** [June 21, 2021, 11:28am UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/9 "2021-06-21T11:28:21Z")

</div>

I am using the recommended link but its not working can you please share some help full material so i can make my Api working i am looking for your response!

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [June 21, 2021, 7:29pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/10 "2021-06-21T19:29:50Z")

</div>

@shaeel1625, Looks like there was an undefined variable. A fix has been merged and it is working as expected now. Thanks again for bringing this to our attention. 🙂

---

<div class="post-metadata">

**Author:** ![shaeel1625](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shaeel1625](https://developer.squareup.com/forums/u/shaeel1625)\
**Post date:** [June 25, 2021, 11:06am UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/11 "2021-06-25T11:06:39Z")

</div>

hello the API was working fine but now its showing me again an error i attaching the screenshot so you can check please provide solution ASAP thanks

 ![1_Poundland-Promotion (1)](https://global.discourse-cdn.com/square/original/1X/83102bb980d237f7ed976ab9c26767f7fda6160a.jpeg)

---

<div class="post-metadata">

**Author:** ![shaeel1625](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shaeel1625](https://developer.squareup.com/forums/u/shaeel1625)\
**Post date:** [June 27, 2021, 5:56pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/12 "2021-06-27T17:56:21Z")

</div>

i am looking for your response

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [June 28, 2021, 4:34pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/13 "2021-06-28T16:34:27Z")

</div>

This is with the most recently updated example? If so would you mind sharing the `process-payment.php`? Please be sure to redact any access tokens if you have them hard coded.

---

<div class="post-metadata">

**Author:** ![majid6291](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/majid6291/32/661_2.png) [@majid6291](https://developer.squareup.com/forums/u/majid6291)\
**Post date:** [July 8, 2021, 5:59pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/14 "2021-07-08T17:59:06Z")

</div>

Yes[,](https://apktiger.com/lords-mobile-mod-apk/) you’re right.

---

<div class="post-metadata">

**Author:** ![Psimon](https://avatars.discourse-cdn.com/v4/letter/p/edb3f5/32.png) [@Psimon](https://developer.squareup.com/forums/u/Psimon)\
**Post date:** [July 17, 2022, 10:17pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/15 "2022-07-17T22:17:57Z")

</div>

hello Bryan, having the same issue here too

**sandbox api** : “[https://sandbox.web.squarecdn.com/v1/square.js](https://sandbox.web.squarecdn.com/v1/square.js)”

**process-payment.php**

```auto
<?php

require 'square/square-php-sdk/example-autoload.php';

use Square\SquareClient;

use Square\LocationsApi;

use Square\Exceptions\ApiException;

use Square\Http\ApiResponse;

use Square\Models\ListLocationsResponse;

use Square\Models\Money;

use Square\Models\CreatePaymentRequest;

use Square\Models\createPayment;

use Square\Environment;

$data = json_decode(file_get_contents('php://input'), true);

$square_client = new SquareClient([

'accesstToken' => '',

'environment' => Environment::SANDBOX,

]);

$payments_api = $square_client->getPaymentsApi();

$money = new Money();

$money->setAmount(100);

// Set currency to the currency for the location

$money->setCurrency("USD");

$orderId = rand(9000, 1000);

$create_payment_request = new CreatePaymentRequest($data['sourceId'], $orderId, $money);

$response = $payments_api->createPayment($create_payment_request);

if ($response->isSuccess()) {

echo json_encode($response->getResult());

} else {

echo json_encode($response->getErrors());

}

?>

```

Also I will appreciate if you recommend a documentation that shows how to integrate square up card payment in Laravel.

I am looking forward for the response, thanks

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 18, 2022, 5:39pm UTC](https://developer.squareup.com/forums/t/square-payments-api-v2-giving-payment-process-404-error/2817/16 "2022-07-18T17:39:57Z")

</div>

If you remove `$orderId` from the payment request does it work as expected? It looks like you’re generating a random `order_id` instead of using the one that we generate when calling [CreateOrder](https://developer.squareup.com/reference/square/orders-api/create-order). 🙂
