Table of Contents
- AX, AL, DZ, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BV, BR, IO, BN, BG, BF, BI, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, HR, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FJ, FI, FR, PF, TF, GM, GE, DE, GH, GI, GR, GD, GU, GT, GG, GY, HM, HN, HK, HU, IS, IN, ID, IE, IM, IL, IT, JP, JE, JO, KZ, KE, KI, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, NR, NP, NL, NZ, NI, NE, NG, NU, NF, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RO, RU, SH, KN, LC, PM, VC, WS, SM, ST, SA, RS, SC, SL, SG, SX, SK, SI, SB, SO, GS, ES, LK, SR, SJ, SE, CH, TW, TZ, TH, TG, TK, TO, TT, TN, TM, TC, TV, UA, AE, GB, US, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW
2Checkout Dynamic Checkout
Subscriptions are not supported with 2Checkout at this time. If you intend to sell subscriptions with your FoxyCart store, you will need to make use of another payment gateway.
Setting Up 2Checkout for FoxyCart
- In your 2Checkout administration, proceed to the “Webhooks & API” section found under “Integrations”
- Within the “Instant Notification System (INS)” section, check the checkbox labelled “Enable INS” and click “Update”. Note that there are also settings for the “IPN” in 2Checkout, which Foxy doesn't utilise, just the “INS”.
- Within the “Redirect URL” section, check the checkbox for “Enable return after sale”, and set the “Return method” dropdown to “Header redirect”. Leave the “Approved URL” text input blank. Click “Update”.
- At the top of the “Webooks & API” section, select the “INS settings” tab (again, note “INS” and not “IPN”)
- Click the “Add endpoint” button
- On the Add endpoint page, enter a name for the endpoint (like “Foxy.io”), and enter your store's notification endpoint. This will look like
yourdomain.foxycart.comis your Foxy store domain. If you have a custom subdomain, you will use that instead of the
- Save the new endpoint
- Back on the INS settings page, under “Trigger list”, click the “Edit” button for the “Invoice Status Changed” trigger
- On the Edit trigger page, complete the following settings
- Under “General Settings”, set the radio input to “Enabled”
- Under “Endpoints”, check the checkbox for your Foxy.io endpoint within the “Available endpoints” panel and click the blue right arrows button in the middle to move it to the right “Selected endpoints” panel.
- Under “Parameters” ensure these 6 items are checked:
- Click “Save trigger”
- Go back to the main “Webooks & API” page of the 2Checkout administration
- In the “API” section, note the “Merchant Code”, this is the “account number” needed for the Foxy payments configuration
- In the “Secret word” section, note the “Instant Notification Service (INS) secret word”, this is the “secret word” needed for the Foxy payments configuration (you may need to click the eye button to the right of the text input to see all in 2Checkout).
- Copy these two settings into the respective fields in your Foxy store administration, on the “payments” page after enabling “Accept payments using your 2Checkout account”.
Additional configuration to support receipt redirect
By default, 2Checkout shows its own thank you screen when a customer completes their payment. It supports a redirect option (which you enabled in the steps above), but Foxy needs the customer redirected to a dynamic URL that can't be set within the admin which is completed through the “Header redirect” option.
The catch though is that it appears that 2Checkout will only allow customers to be redirected to a URL that matches the primary URL on the 2Checkout account. If these don't match, then the customer won't be redirected back to the Foxy receipt, but will instead just see the 2Checkout thank you page.
Foxy will still be notified through the INS notification that the payment completed, so the customer will get the Foxy email receipt if that's configured to send. If you would like the customer to be redirected to the Foxy receipt (for analytics or other purposes), you will need to request that the URL for your 2Checkout account be updated to your Foxy store domain, for example
https://yourstore.foxycart.com (or your custom subdomain if you're using that).
Here is a quote from 2Checkout:
If the Merchant would like to update the URL on their account, they need to contact our Underwriting team or us at firstname.lastname@example.org and we will make sure the account is updated.
Note that someone with authorized access to the 2Checkout account will want to make the request.
Obtaining a Test Account
Signup for 2Checkout here. Know more? Feel free to edit this page with info.
Test Card Numbers
If your 2Checkout account is configured in demo mode, you can complete test purchases by using the following details for your order:
- First Name:
- Last Name:
- Card Number:
4111 1111 1111 1111
- Card Expiry: Any future date
- Card CVV: Any 3 digit number
Troubleshooting & Interpreting Response Codes
Contact 2Checkout for info. Know more? Feel free to edit this page with info.
Important Notes and Caveats
Possible Action: Datafeed Handling
At the time of the customer completing the transaction - we don't necessarily know whether the transaction was completed yet or not. We instead rely on a notification from the gateway after the checkout has been completed to confirm whether the transaction was approved or not. To handle this, transactions are initially marked as pending, and when we get a confirmation from the gateway on the result of the transaction, we update it accordingly. Each time the status changes, a datafeed will be sent to your endpoint if configured with the transaction details and the
status node will be present.
status node can contain one of three different values:
rejected. Depending on the types of actions you're needing to perform at your datafeed endpoint, you need to make sure the appropriate status value is present first.
User Notes and Experiences
If you have tips, experience, or helpful notes related to this gateway that would benefit others, please add them below, including your name and the date. We reserve the right to edit or remove comments that don't add value to this page.