# Question about adding taxes with PHP

**URL:** <https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492>\
**Category:** Questions\
**Tags:** payments-api, sdk, web-payments-sdk\
**Created:** [November 8, 2024, 1:38pm UTC](https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492 "2024-11-08T13:38:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pascalf1324](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pascalf1324](https://developer.squareup.com/forums/u/pascalf1324)\
**Post date:** [November 8, 2024, 1:38pm UTC](https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492/1 "2024-11-08T13:38:45Z")

</div>

Hello,

I have 2 small questions about taxes. On my site I sell subscriptions.  
Being in Canada, I have to charge taxes when the member is in Canada, but if the member is in France for example, I do not have to charge taxes.

My first question: Can I in my PHP code, when I create the subscription, add the taxes dynamically depending on whether the member is in Canada or not. So ± 15% if the member is in Canada and 0% elsewhere in the world! Is it possible? If yes, what is the API(sdk for PHP) please.

My second question, I use the Web Payment SDK with the verifyBuyer function. And in the VerifyBuyer, we have to put the price “amount”, for verification. Should the “amount” contain the price with taxes included.  
For example, if I sell a product for $10 here in Canada, the total price is $11.50, so in the “amount” field, should I put $10 or it is better to put $11.50

Thank you so much !

Pascal

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [November 8, 2024, 1:39pm UTC](https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492/2 "2024-11-08T13:39:04Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Payments Pricing with Square APIs and SDKs](https://developer.squareup.com/docs/payments-pricing)**
>
> Learn about the processing fees that Square charges for payments made with Square payment APIs.

> **[Payment Minimums](https://developer.squareup.com/docs/payment-minimums)**
>
> Learn about the minimum payment amounts required for any Square payment related API.

> **Additional Documentation**
>
> [Customize the Checkout Amount](https://developer.squareup.com/docs/reader-sdk/quick-start/step-4)  
> [Localize In-App Payments](https://developer.squareup.com/docs/in-app-payments/localize-ios)  
> [Take a Cash Payment](https://developer.squareup.com/docs/reader-sdk/quick-start/step-3)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![pascalf1324](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pascalf1324](https://developer.squareup.com/forums/u/pascalf1324)\
**Post date:** [November 8, 2024, 2:08pm UTC](https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492/3 "2024-11-08T14:08:43Z")

</div>

Hi !  
Thanks for the reply, this does not answer my question! It is about taxes and the verifyBuyer function.

Thanks

---

<div class="post-metadata">

**Author:** ![pascalf1324](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pascalf1324](https://developer.squareup.com/forums/u/pascalf1324)\
**Post date:** [November 8, 2024, 2:36pm UTC](https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492/4 "2024-11-08T14:36:47Z")

</div>

Hi,

I found a solution and I would like to know if it is the right thing for subscriptions… via APIs in PHP (skd)

Here my code :

```auto
$body = new \Square\Models\CreateSubscriptionRequest($locationId, $Token);
$body->setIdempotencyKey($idempotencyKey);
$body->setPlanVariationId($planVariationId);
$body->setCardId($result->getCard()->getId());
$body->setCustomerId($customerId);
$body->setTaxPercentage("5.0"); // <---- i added this
$api_response = $client->getSubscriptionsApi()->createSubscription($body);

```

I added $body-\>setTaxPercentage(“5.0”); // for 5% taxs  
and it seems to work and I have the right amount in the dashboard.

Is it OK to do it this way?

When there is no tax, I will not put this line, otherwise when there will be taxes, I change the “5.0” to the right tax percentage!

Is this way of doing things OK?

If so, there is only one question left to answer, which is : regarding the “amount” of verifybuyer, namely whether the amount should contain taxes?

Thank you

---

<div class="post-metadata">

**Author:** ![josh-square](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@josh-square](https://developer.squareup.com/forums/u/josh-square)\
**Post date:** [November 8, 2024, 3:31pm UTC](https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492/5 "2024-11-08T15:31:40Z")

</div>

Hey @pascalf1324! Yes, that’s the correct way to handle taxes with subscriptions.

For `verifyBuyer`, you’ll want to set the amount to the total that will be charged to the card (so including taxes, if present).

I would like to call out though that we have a new payment flow now that will allow you too take payments without having to explicitly call `verifyBuyer`. Square will automatically determine whether buyer verification is needed. You can find details here: [Take a card Payment with the Web Payments SDK](https://developer.squareup.com/docs/web-payments/take-card-payment)

---

<div class="post-metadata">

**Author:** ![pascalf1324](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pascalf1324](https://developer.squareup.com/forums/u/pascalf1324)\
**Post date:** [November 8, 2024, 4:33pm UTC](https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492/6 "2024-11-08T16:33:20Z")

</div>

Hi Josh

Thanks for your message and the explanations! It is very appreciated.

I have 2 questions regarding the BETA version of the payment flow.

1- When will the old version be deprecated? Will I receive a notification by email or other ? is there a date ?

2- Currently I ask for first name, last name, address, email, phone, city, region, country. With the BETA version, do I have to ask the user for this too or, Squareup will take care of it in the new version?

Thanks again, and have a great day!

---

<div class="post-metadata">

**Author:** ![josh-square](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@josh-square](https://developer.squareup.com/forums/u/josh-square)\
**Post date:** [November 8, 2024, 9:13pm UTC](https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492/7 "2024-11-08T21:13:24Z")

</div>

1- There’s no set date for deprecation or retirement yet. For deprecations, we send out email notices to the email address associated with your Square developer account.

2- Information like `billingContact` is passed through the `tokenize()` method in the new flow: [Set up the new payment flow](https://developer.squareup.com/docs/web-payments/take-card-payment#set-up-the-new-payment-flow)

---

<div class="post-metadata">

**Author:** ![pascalf1324](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pascalf1324](https://developer.squareup.com/forums/u/pascalf1324)\
**Post date:** [November 8, 2024, 9:32pm UTC](https://developer.squareup.com/forums/t/question-about-adding-taxes-with-php/19492/8 "2024-11-08T21:32:25Z")

</div>

Thanks sooo much Josh !  
Have a great weekend !
