Invalid card Data problem

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:

  1. Where to Provide APPLICATION_ID and LOCATION_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. :blush:

Thanks in advance!

:wave: 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:

Additional Documentation

Sandbox Payments
Configure the Order-Ahead Sample Application
Test in the Sandbox

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.

i even tried with the dummy card details that you provide in the tutorial 4111 1111 1111 with cvv 123

i even tried with the dummy card details that you provide in the tutorial 4111 1111 1111 with cvv 123
[/quote]

Hello,

If you attempted to use the sample card details provided in the tutorial and it still didn’t work, it’s likely because these dummy card details are only meant for testing purposes in specific environments that support test transactions. They won’t work in live systems or any real-world payment gateways. If you’re testing a payment integration, ensure you’re in a sandbox or test mode provided by the payment gateway.

What are the steps to reproduce? I just tested the quickstart and it worked as expected. :slightly_smiling_face: