Hi everyone,
I’m new to using Square’s Web Payments and would really appreciate some guidance! I’m working with the starter template provided in the following GitHub repository:
Square Web Payments Quickstart - README.
I’ve followed all the steps outlined in the README file, but I’m running into a couple of issues:
- Where to Provide
APPLICATION_ID
andLOCATION_ID
:
I tried adding them to.env.sandbox
like this:
makefile
Copy code
APPLICATION_ID = sandbox-sq0idb-zZ3J9zVMZsfiq52IBATImQ
LOCATION_ID = LZ2NPBF2RWR1P
However, it didn’t work. Instead, I manually added them inside card-payment.html
, and that worked for enabling the card payment option.
2. Error with Test Card in Sandbox:
I entered a Visa card number (test card), along with its expiry date and CVV. However, the page didn’t prompt me for a zip code, so I didn’t provide one. Upon submitting, I received the following error:
arduino
Copy code
1. category: "INVALID_REQUEST_ERROR"
2. code: "SANDBOX_NOT_SUPPORTED"
3. detail: "Invalid card number for sandbox."
4. field: "card_data.number"
Could someone please point out where I might be going wrong?
Any help would be greatly appreciated, especially since I’m just getting started with this.
Thanks in advance!