I just came on to the forums and looked for more information about this, but the only thread I can find about it isn’t very helpful - it was abandoned before the problem was solved.
My problem is, the QuickStart guide for the payments API is quite vague and I’m relatively new to PHP. For one thing, the introduction says there’s an option for Square-hosted checkout pages but it’s never shown in the guide. That was the solution I originally wanted to use but due to the lack of documentation, I went for the self-hosted option.
I now have a setup working in localhost sandbox with Card Payments, Google Pay and Strong Customer Authentication (I’m based in the UK), but the instructions on deploying the files are essentially useless. It doesn’t even show what to do with the production access token. My understanding is that the Sandbox server uses the DotENV library, but how to either enable support or choose a new solution for your production environment is not clear to me.
I’ve gotten in touch via the Solutions Partner page but, frankly, I can’t afford to hire help right now so I’d appreciate any advice you could give. Thank you.
That’s great that you got the quickstart to work! Square lets developers build an ecosystem for businesses to seamlessly accept payments online, in store, or on the go through Payments and eCommerce APIs. Our API’s are best utilized by someone with API coding experience or working directly with a developer.
If you don’t have experience in building API tools and would like to accept payments online, we recommend either using Square Online Store or connecting your Square account with one of our eCommerce partners.
Under my specific circumstances, going to another platform isn’t an option. I have an existing website which is written in PHP and requires a specific .htaccess file.
This website used to be integrated with another of my sites running WooCommerce, but I’m shutting down the second site because it was never used except for people buying this one product - which is why I need to integrate it with something else.
Okay, well with the Quickstart you will want to make sure that you do all the deployment tasks. For testing locally you can duplicate the
env.example and instead of renaming it
env.sandbox call it
env.production. Then run
npm start to start the server locally.
Also we do have some additional samples of the Web Payments SDK with includes an example in PHP.