Simulate Online Payment of Invoice for Testing

I am writing tests for my code which generates and emails an invoice to our customer, however right now I have to:

  1. Run the create invoice and email
  2. Open my email client, launch payment URI and complete payment manually
  3. Run my follow up scripts that reads webhook events etc to update my local status

The question: Can I automate step 2 (simulate an online payment) using an existing Square REST API? I’ve tried using the payments API, but have not been successful.

I’d rather avoid having to use chromedriver or other web spoofing framework to do this as it feels somewhat heavy handed for tests scripts.

Thanks!

Since the client is entering sensitive information like their card data in the Square hosted invoice page there isn’t a way to automate a test for this. This is for the customers security. :slightly_smiling_face:

Ok. Web page spoofing it is then. Thanks!