This article walks you through creating a test Payment Set and then completing transactions through that payment set for Foxy version 2.0. This allows you to test your checkout (you may be testing new code on the store or trying out a new gateway) while not interfering with your live store. While this article discusses using a test account (where live payments will not be processed), you can also use it with a live account. If not using Foxy's testing credentials, you'll need to get sandbox or test credentials from the gateway.
This article assumes that you are not currently using the
template_set parameter on your store.
There are other uses for payment sets, so reach out if you have a need for using different gateways in different situations.
Here's how to set it up:
Create a Payment Set
- Go to your payment sets settings in the Foxy admin
- Under select a payment set, select Add a New Payment Set.
- You can call it test Payment Set (or whatever name you prefer), and click Add New Payment Set to save.
- Next, go to the payment section in the Foxy admin
- Under select a payment set, select the new payment set that you just created.
- Ensure that the which servers do you want to use? setting is set correctly - if you're wanting to run test payments only, it should be set to Test Servers
- Check the box next to Let customers pay with a Credit or Debit Card. A dropdown list will appear.
Note: If this is already checked, double-check that your new payment set from in step 5 is selected ― otherwise, you might be changing your store's live payment set.
- In the bank card payment method dropdown, select your desired gateway. You can use Authorize.net if you want to use a Foxy test account.
- Enter your gateway credentials or check the use default test account checkbox if you're using Foxy's default test credentials for testing.
- Click Update Payment Gateway to save.
After it's saved, just to check things out, you can select the dropdown for select a payment set. If you select Default Payment Method Set, you should see the configuration for the normal ordering gateway.
Create a Template Set
Now, you need to create a Template Set that you can use to direct Foxy to process the "payment" using the gateway configured in your new Payment Set.
- Go to the template sets section in the Foxy admin
- In the select a template set dropdown, select Add a New Template Set.
- Enter a code for your Template Set, for example
test. The description can be whatever you like.
- Under the payment set dropdown, select the payment set you created above. Ensure the locale is configured to one with a currency that your gateway can support.
- Click Add New Template Set to save.
Testing the new Template/Payment Set
Finally, your new Template Set is ready to use.
- Modify the following link using your own store's domain in place of
example.foxycart.com, and update the
template_set=testportion, if you set your Template Set code to something other than
testwhen creating it earlier:
- Copy/paste the modified link into your browser's address bar and load it. You'll be taken to your store. The link will direct Foxy to use the test payment method you just created for checking out. This only changes it for the current cart session in your browser ― the customers will still be directed to the live payment.
- Add products to the cart as normal and go to checkout.
- For a test gateway, you may be able to use the credit card number
4111111111111111, any expire, any CVV number. If that doesn't work, you can search online for test payment card numbers for your gateway, or reach out to Foxy support for help.
Note that you can view your test transactions in the Foxy admin transactions report section by selecting a transaction type of test in the transaction filter criteria.
Don't worry if you accidentally get to the live Payment Set in the checkout and type in the test card number above ― it'll fail with that number on a live gateway.
Resetting the Template Set in the cart
Once you're satisfied with your tests, you can return your cart session back to the default template set but using a link like this - again updating the
example.foxycart.com subdomain to your own Foxy store subdomain: