The Afterpay payment app on Shopify supports a Test Mode. This means you are able to mock all supported transactions including:
Do not enable test mode on your live site. Once the payment method is activated in the store settings, it is live for customers to use. Only use a staging or development Shopify store for testing.
Before you enable Test Mode, complete the initial Afterpay application configuration. To do this, follow the steps in Add Afterpay at Checkout to verify your merchant account in the Business Hub.
To enable Test Mode for Afterpay:
From your Shopify admin, go to Settings > Payments.
In the Additional payment methods section, click Afterpay.
In the Test mode section, activate the toggle.
Click Save.
You’re now ready to test Afterpay transactions in your dedicated test store.
To check if Sandbox has been configured correctly, go to your test site and conduct a test transaction. Once it has been redirected to the Afterpay Login page, check the URL and it should be a Sandbox URL.
For example:
portal.sandbox.afterpay.com/v2/checkout/en-AU/password
For Afterpay transactions, follow the instructions here to create a sandbox customer account and mock various transaction approval outcomes.