Quick tips on American SALES TAX for developers who are setting up an ecommerce store for USA based organization

So, all of the info you read below is the summary of 6 hours I spent yesterday in gathering information about taxes in USA. – to be particular – Sales Tax. Not Income tax

To start with, USA has 50 states, meaning constituent political entity. All states have their own rules for sales tax and there is no nation-wide sales tax as such. So if you are an store owner in any particular, you will have to charge your customers taxes, which you are supposed to pay to the state.

Now when I say “charge your customers taxes”, I mean- obviously that is why you are here. There are two types of taxes based on the final location of the product after the purchase.

So there are origin based taxes and destination based taxes. Some states require you to charge customer depending upon your (seller’s) location. Summary- If you are located in an origin-based state and make sales to customers within that state, you would charge sales tax based on your location, including any local and state taxes.  Example – Illinois

Destination Based tax – If you are in state A and you make a sale to a customer living in state B, you have an obligation to collect and pay sales tax of state B, ONLY if you have a Nexus in state B

Now you must be wondering Nexus, what is a nexus in tax terms? So a nexus is kind of a link of your business to/in a certain state. Lets say your business is Registered and has a brick mortar office in state X, and you sell a lot to customers in state Y. Depending upon the volume and nature of transactions, State government requires you to register a Nexus in state Y so that you can collect sales tax for State Y- as simple as that. However, terms and legislation criteria on whether you should register a Nexus vary a lot from state to state. But it usually comes in scope when you are selling 250,000+ USD in a state which is not your home state.

Home state means where you run business.

Summary: You only charge sales tax if your customer’s shipping address is in your home state i.e., where your store is. Customers out of your state dont need to pay any taxes which purchasing from you.

Now coming to tax rates:

Tax rates are honestly very confusing when talking about USA. They have unreal system of managing tax rates and enduring tax-evasion problem.

Usually states have same taxes or even some countries have a fixed tax depending upon the product hierarchy, but that is not the case with USA.

There are chances that two addresses in same pincode will have different tax rates, YES! I am NOT kidding!

As per jurisdictions, the tax rates are combined. There is a State Tax Rate, County Tax Rate and City Tax Rate and maybe others too.

Combining all these give you an estimated tax rate which can be categorized per Pincode or ZIPcode but wont be 100% accurate. An Example is here – ZIP Codes: The wrong tool for the job However the article seems like an exaggeration because they want to sell their product/service of course.

Bottom Line- It can get really messy when dealing with Sales Tax in USA. Since I am not the tax guy and have no relation with accountancy whatsoever, there are chances that many of the things I stated above might be wrong. However, I believe that what I read online and the information that I gathered was from trust-able sources. The e-commerce store setup that I did was based on Magento 2, so I managed to create tax rates for each state. Later on, I found out I only needed to create tax rates for only one state i.e., our home state.

Here is a full list of all states combined: USA-allpincodes-mar2019.csv

And you can use following tax rates area wise- in Magento2 format

AlabamaIndianaNebraskaRhode Island
AlaskaIowaNevadaSouth Carolina
ArizonaKansasNew HampshireSouth Dakota
ArkansasKentuckyNew JerseyTennessee
CaliforniaLouisianaNew MexicoTexas
ColoradoMaineNew YorkUtah
ConnecticutMarylandNorth CarolinaVermont
DelawareMassachusettsNorth DakotaVirginia
FloridaMichiganOhioWashington
GeorgiaMinnesotaOklahomaWashington, DC
HawaiiMississippiOregonWest Virginia
IdahoMissouriPennsylvaniaWisconsin
IllinoisMontanaPuerto RicoWyoming

Reference for CSVs: https://www.avalara.com/taxrates/en/download-tax-tables.html

Reference for other details:
1. https://www.avalara.com/us/en/learn/whitepapers/origin-vs-destination-sales-tax.html
2. https://blog.taxjar.com/states-where-amazon-com-collects-sales-tax/
3. https://en.wikipedia.org/wiki/Sales_taxes_in_the_United_States
4. https://quickbooks.intuit.com/r/taxes/what-is-nexus-and-how-does-it-affect-your-small-business/

How to transpose an array in PHP with irregular subarray size?

    function transposeCsvData($data)
    {
	    $ct=0;
	    foreach($data as $key => $val)
        {
	        //echo count($val);
		    if($ct< count($val))
                $ct=count($val);
		    }
		//echo $ct;
	    $blank=array_fill(0,$ct,array_fill(0,count($data),null));
	    //print_r($blank);
	
	    $retData = array();
        foreach ($data as $row => $columns)
        {
            foreach ($columns as $row2 => $column2) 
            {
                $retData[$row2][$row] = $column2;
                }
            }
	    $final=array();
	    foreach($retData as $k=>$aval)
	    { 
            $final[]=array_replace($blank[$k], $aval);
           }
        return $final;
        }

Test Code

$a[]=array("name","john","sam","patrick");
$a[]=array("color","orange","green");
$a[]=array("bikes","suzuki","audi","mercedes","bmw","volks","rover");
$a[]=array("techgiants","samsung","amazon");

print_r(transposeCsvData($a));

Output

Array
(
    [0] => Array
        (
            [0] => name
            [1] => color
            [2] => bikes
            [3] => techgiants
        )

    [1] => Array
        (
            [0] => john
            [1] => orange
            [2] => suzuki
            [3] => samsung
        )

    [2] => Array
        (
            [0] => sam
            [1] => green
            [2] => audi
            [3] => amazon
        )

    [3] => Array
        (
            [0] => patrick
            [1] => 
            [2] => mercedes
            [3] => 
        )

    [4] => Array
        (
            [0] => 
            [1] => 
            [2] => bmw
            [3] => 
        )

    [5] => Array
        (
            [0] => 
            [1] => 
            [2] => volks
            [3] => 
        )

    [6] => Array
        (
            [0] => 
            [1] => 
            [2] => rover
            [3] => 
        )

)

SQL Notes

CREATE TABLE `clients` (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `name` varchar(11) NOT NULL,
  `associate` varchar(100) NOT NULL,
  `revenue` int(12) NOT NULL,
  `profit` int(12) NOT NULL,
   PRIMARY KEY (`id`),
   FOREIGN key (`associate`) references `emp`(`emp_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

alter table `emp` add COLUMN `phone` int(12) not null after `name`
alter table `emp` add COLUMN `phone` int(12) null after `name`
alter table `emp` modify `phone` int(12) null
alter table `emp` drop column `phone`


ALTER TABLE `emp`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `emp_code` (`emp_code`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `emp`
--
ALTER TABLE `emp`
  MODIFY `id` int(4) NOT NULL AUTO_INCREMENT;
COMMIT;

How to fix Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI error in SSH?

Put this in your bash profile and run source ~/.bashrc

alias composer="/opt/cpanel/ea-php71/root/usr/bin/php /opt/cpanel/composer/bin/composer"

As Composer is now available via WHM you can use this to find it:

which composer

This returned path “/opt/cpanel/composer/bin/composer” for me. If this returns nothing then disregard the rest of this answer, as Composer is not available to you at system level.

You can now use php-cli to call this with Composer’s absolute path:

php-cli /opt/cpanel/composer/bin/composer install
php-cli /opt/cpanel/composer/bin/composer update
php-cli /opt/cpanel/composer/bin/composer require whatever/example

You may however need to alias php-cli if your system claims this isn’t found. It very much depends how PHP has been deployed on the WHM server. Learn how to fix PHP CLI error. You can do this by adding a user alias to the end of your “.bashrc” or “.bash_profile” file as follows:

alias php-cli=/opt/cpanel/ea-php72/root/usr/bin/php

Replace ea-php72 with the release of PHP you want to use. Submit this as a command in the shell to make it available immediately, otherwise it’ll become available when you open your next Bash session.

If you want to make this available with just composer alone you could create this alias again in “.bashrc”:

alias composer=/opt/cpanel/ea-php72/root/usr/bin/php /opt/cpanel/composer/bin/composer

Reference: https://stackoverflow.com/a/53478183/2229148

How to switch your DNS to Google DNS or Cloudflare DNS on Windows 10?

So, this is the scenario. You are using some local ISP which has its own DNS server fulfilling your DNS requests but to speed things up and not rely upon a DNS server which is updated less frequently. For that purpose,we can switch our computer’s DNS to some other public DNS like Google’s or Cloudflare DNS.

Step 1: Right click the Network Icon in your task bar.

Network Icon in Taskbar
Right Click the network icon in taskbar

Step 2: Choose “Open Network & Sharing Settings

Click Open Network & Sharing Settings
Click Open Network & Sharing Settings

Step 3: Click on “Change Adapter Options

change adapter options
change adapter options

Step 4: Right click on the active hardware and select “properties

adapter properties
adapter properties

Step 5: Select “Internet Protocol Version 4 (TCP/IPv4)” and Click Properties button in the bottom

IPv4 Properties

Step 6: Input the IP addresses after choosing “Use the following DNS Server Addresses

put dns ip here
put dns ip here

Step 7: Select OK to close the pop up window. Restart your browser and have a better browsing experience.


Cloudflare’s Public DNS Servers/addresses for IPv4:

1.1.1.1
1.0.0.1

Cloudflare’s Public DNS Servers/addresses for IPv6:

2606:4700:4700::1111
2606:4700:4700::1001

Google’s DNS Servers for IPv4:

8.8.8.8
8.8.4.4

The Google Public DNS IPv6 addresses are:

2001:4860:4860::8888
2001:4860:4860::8844

What happened to googleforwork.com? Welcome the new cloudconnect.goog domain

So GoogleforWork.com is now being redirected to cloud.google.com and the same applies for its subdomain connect.googleforwork.com.

Earlier the campaigns at google work communities are now hosted at www.cloudconnect.goog

It is interesting to note that it uses .goog and not .google TLD, here is some more info about .goog TLD

In the past we have seen .google tld for many purposes like AI to Everyone at ai.google     and Google’s design lab and research on design technology

The future will be interesting in terms of TLDs when banks, tech giants and telecom companies are switching their websites to their own custom TLDs and regular people can hardly remember the apparently new gTLDs.

Testing Configuration for Paytm Gateway Plugin India

Paytm Payment Gateway Testing Data

Online payment solutions for all your transactions by Paytm Woocommerce Plugin

Download the plugin here: https://github.com/Paytm-Payments/Paytm_Woocommerce_Kit

Enable/Disable
Enable/Disable Enable Paytm Payments.
Title
Title
Paytm
This controls the title which the user sees during checkout.

Description
Description
The best payment gateway provider in India for e-payment through credit card, debit card & netbanking.
This controls the description which the user sees during checkout.

Merchant Identifier
Merchant Identifier
<provided link below>
Merchant Id Provided by Paytm

Secret Key
Secret Key
<provided link below>
Merchant Secret Key Provided by Paytm

Website
Website
WEBSTAGING
Website Name Provided by Paytm

Industry Type
Industry Type
Retail
Industry Type Provided by Paytm

Channel ID
Channel ID
WEB
Channel ID Provided by Paytm

Transaction URL
Transaction URL
https://securegw-stage.paytm.in/theia/processTransaction
Transaction URL Provided by Paytm

Transaction Status Url
Transaction Status Url
https://securegw-stage.paytm.in/merchant-status/getTxnStatus
Transaction Status URL Provided by Paytm

API Keys

You can get your keys here https://dashboard.paytm.com/next/apikeys

API keys are unique credentials issued to every merchant. While MID is used as an identification used for all exchange correspondence, merchant key is used to encrypt every API request to Paytm and decrypt every response from Paytm. Ensure that you keep the merchant key on server side and should not be shared with anyone. In case API keys are compromised, please reach out to our helpdesk to get new API keys.

  • MID (Merchant ID) – Unique identifier issued to every merchant.
  • Merchant Key – This is a unique secret key used for secure encryption of every request. This needs to be kept on server side and should never be shared with anyone.
  • Industry Type ID – This is part of bank and paymode configuration done wrt to an account.
  • Website – This parameter is used to support multiple callback URLs to post the transaction response. Each URL needs to be mapped to a website parameter.

Test API Details are something like this:

  • Test Merchant ID WArHEFXXXXXXXXXXXXXX <–wont work
  • Test Account Secret Key XXXXXXXXOcv1u7P2 <- wont work

Testing Resources / Testing Instruments

Source: https://developer.paytm.com/docs/testing-integration

  • Testing Debit/Credit Card
Card NumberAny Visa or Master Card
Expiration Month & YearAny Future month and Year
CVV123
OTP123123
  • Testing Paytm Wallet Details
Mobile Number77777 77777
PasswordPaytm12345
OTPDoesn’t require 2nd factor authentication489871
  • Testing Netbanking Details
Bank NameAndhra Bank
User IDtest
PasswordTest

Note:
In case you are testing on production environment, use live paymode details to complete the transaction. Once the transaction is successful, you can initiate refund from the dashboard.

What are Customer Relationship Management (CRM) Software?

What Is CRM?

CRM, also known as Customer Relationship Management can be understand as the software which was developed to improve the customer services and to make the customer services much more efficient.

CRM Software act as the single tools which has the ability to bring your sales, marketing, customer support services at one place and helps you to manage them at one single platform.

Who uses a CRM system?

CRM System can be easily customized and changed by the different Organisations and companies according to their needs and requirements. The CRM software can be used by the any business types and size for increasing their sales, marketing, and customer support services i.e, Small Scale Startups, Large Organizations, Real-estate, Healthcare, Insurance and the list goes on and on….

Customer relationship management systems can be easily customized to meet the specific needs of any business type and size. Start-ups, large enterprises, and verticals like real-estate, healthcare, insurance, legal, media, restaurants, travel, banking, tax, freelancers, and non-profits all use a customer relationship management software for increasing their sales, marketing, and customer support efforts.

With CRM you get,

300%

Improvement in
lead conversion rates.

41%

Revenue increase
per sales person.

27%

Improvement in
customer retention.

24%

Decreased
sales cycles

23%

Decreased sales and
marketing costs.

Here is a list of some famous CRM Software

Salesforce helps you to connect to your customer in a whole new way to build more meaningful and lasting relationship. With a single view of every customer interaction you can sell, service and market. With the help of salesforce you will get more lead, close more deals much faster, Increase customer loyalty, retention and satisfaction. You can also manage your business anytime and anywhere.

Full feature package: Salesforce Lightning Professional

Cost when billed annually: $75 per user, per month

Cost when billed monthly: n/a

Pipedrive focuses your mind on the pipeline and shuffles deals with due activities to the top in the list. In pipedrive your emails, calls, progress are tracked automatically. Pipedrive is rated the easiest sales tool to implement by leading software site. Pipedrive supports visual indicators which shows you where to focus and what actions are needed to close more sales.

Full feature package: Pipedrive Platinum

Cost when billed annually: $62.50 per user, per month

Cost when billed monthly: $75 per user, per month

In Microsoft dynamics you can engage with customers on any channel or device. You can personalise your services and deliver them fast. You can innovate with an application that is easy to tailor, extend and connect to other applications also which are already in use.

Full feature package: Dynamics 365 Plan

Cost: Starting at $210 per user, per month

Hubspot is a developer and marketer of the software products, it was founded 2006. Hubspot provide tools for social media marketing, content management, web analytics, landing page and search engine optimization. CRM has Integration Features of salesforce.com, sugarCRM, Netsuite, Microsoft Dynamics CRM and more.

Full feature package: HubSpot CRM is not a “full feature” CRM, and lacks reporting and certain sales process capabilities out of the box.

Cost: Free. Reporting can be added for $200/month

Zoho uses a open application programming interface for its writer, sheet, show, creator, meeting and product planner.it also has plugins into Microsoft excel and word, and plugins for Firefox. Zoho CRM has the some features like procurement, inventory, and some accounting functions from the realm of ERP. The free version is limited to 10 users only.

Full feature package: Zoho Enterprise

Cost when billed annually: $35 per user, per month

Cost when billed monthly: $45 per user, per month

amoCRM is very easy to use and also very powerful CRM Solution for the Organisations.it was founded in 2004 .The amoCRM is first CRM company to introduced integration with messaging application.It has easy to use pipeline management of data and information.it also gives a feature of sale automation to its users.

Full feature package: amoCRM Enterprise

Cost: $45 per user, per month, with a six-month minimum commitment

Nutshell is powerful and flexible enough to fit every to fit every sales model. Nutshell software helps in sales automation, We can manage our contacts and emails. We get the feature of reporting and performance tracking. It also offer pipeline management and friendly customer care.

Full feature package: Nutshell Pro

Cost when billed annually: $35 per user, per month

Cost when billed monthly: $39 per user, per month

Insightly CRM is for lifelong customer relationship, It can help you to grow your revenues more than 20% annually. Close more deal faster with work automation. In insightly, We can automatically convert closed deals to projects. It also provide apps integration to stay connected to apps you already use.

Full feature package: Insightly Professional

Cost when billed annually: $49 per user, per month

Cost when billed monthly: $59 per user, per month

Oracle is a complete, Integrated, Extensible application suite for modern customer experience. Oracle helps in analyze marketing performance, attribute revenue, and gain better insight into the customer experiences. We can deploy and use the CRM system easily, optimize sales performance and simplify everything in one place.

Full feature package: Oracle Sales Cloud Standard Edition

Cost: Starting at $100 per user, per month

SAP customer data cloud helps to create seamless customer experience and it also provide the data privacy, customer transparency and control. It provide personalise customer experience across the business. It helps in saving time and guesswork to accelerate sales and manage the sales territories and incentives.

Full feature package: SAP Business By Design CRM Sales

Cost when billed annually: $89 per user, per month

Cost when billed monthly: n/a

Copper is the Best CRM for G Suite users. Copper integrates with G Suite, gets rid of manual data entry, and It is super easy to use. If you can use Gmail, you’ll know how to use Copper. They have over 12,000 customers love using Copper and selling more with the CRM teams.

Full feature package: Copper Professional

Cost when billed annually: $49 per user, per month

Cost when billed monthly: $69 per user, per month

How to customize Magento 2 Maintenance mode page?

Edit the file pub/errors/default/503.phtml and put the following code

<?php
/**
 * How to edit and customize code of Magento 2 Maintenance 503 Page
 * Add analytics if any
 * Replace <COMPANY NAME> with your Organization Name
 */
?>
<!doctype html>
<title>Site Maintenance</title>
<style>
  body { text-align: center; padding: 150px; }
  h1 { font-size: 50px; }
  body { font: 20px Helvetica, sans-serif; color: #333; }
  article { display: block; text-align: left; width: 650px; margin: 0 auto; }
  a { color: #dc8100; text-decoration: none; }
  a:hover { color: #333; text-decoration: none; }
</style>

<article>
    <h1>We&rsquo;ll be back soon!</h1>
    <div>
        <p>Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. If you need to you can always <a href="mailto:[email protected] NAME">contact us</a>, otherwise we&rsquo;ll be back online shortly!</p>
        <p>&mdash; Team COMPANY NAME</p>
    </div>
</article>

SSL certification setup: Cloudflare.

This article will guide you to set your SSL certification using Cloudflare. Cloudflare is an internet security company which provides content delivery network service.

You can get free SSL certification as well as paid one from Cloudflare.

A breif discussion on SSL certification and https redirection.

So, Let’s start the process.

Steps:

Step1

Signup and Login to cloudflare. There you will get an option to add your site url. Do it and proceed.

Step2

Cloudflare will check your DNS records. You just click next and proceed.


Step3

Now choose your plan according to your needs. For this tutorial i preffered free plan. Paid plans will add some extra features and security to your site.

Step4

Now it will show you some details of your site to confirm. Just Click continue. And move on.

Step5

Cloudflare will give you two nameservers to replace with your default nameserver. Just login to your hosting provider and change it there. And then click continue.

If everything went good so far, cloudflare will activate security on your website. Click Re-check button to refresh cloudflare and it will show the status.

We are almost done. The last thing to do is – get your API key and paste it to wordpress plugin of cloudflare, and save API credentials.

That is it. Your site is now secured with a SSL certification from cloudflare. This certification is valid for 1 year.

https://www.cloudflare.com/