2Checkout allows you to use your 2Checkout.com account with Restrict Content Pro to accept credit cards directly on your website.
Configuring 2Checkout is simple and only takes a few moments.
First, go to Restrict > Settings > General and enable 2Checkout:
Next, under 2Checkout Settings, enter your API credentials for 2Checkout. These are required in order to use 2Checkout and can be obtained from your 2Checkout account settings.
- Secret Word - This can be found under the Site Management section of the Account page.
- Private Key - This can be found one the API page.
- Publishable Key - This can be found one the API page.
- Seller ID - This can be found by clicking on the person icon in the top right corner of your screen. It is the Account Number:
With 2Checkout, customers will be shown a credit / debit card form directly on your registration form:
After filling in the credit / debit card details, the customer will be presented with a processing indicator. If the card is successfully charged, the customer will be redirected to the success page. If the card fails, the customer will be shown an error message.
Instant Notification Service
The Instant Notification Service is what 2Checkout uses to synchronize subscription information with Restrict Content Pro.
The URL that 2Checkout sends notifications to must be configured manually from your INS settings page.
Enter " http://yoursite.com/?listener=2checkout" in the Global URL field and click Apply.
Replace yoursite.com with the actual domain name of your website.
NOTE: if you do not configure the INS, subscription payment tracking will not work.
Testing 2Checkout Payment Gateway
To test that 2Checkout is working properly, please follow the instructions below to create a test 2Checkout account before you go live with your website to ensure everything is working properly.
To test Restrict Content Pro with 2Checkout, follow these steps:
- Register a test account at sandbox.2checkout.com
- Enter your API credentials in Settings as shown above.
- Enable Test Mode in Settings.
- Visit your website's registration page while logged out.
- Enter the user information. This can be anything, though a real email address that you have access to is advised.
- Choose a paid subscription level.
- Choose to auto renew (or not) the subscription.
- Choose "Credit Card" as the payment method.
- Enter "4000000000000002" for card number.
- Enter "222" for the CVC.
- Enter 12 / 2020 for the expiration. Any date in the future will work.
- Click Sign Up.
- You should now be redirect to the success page and logged-in as your new user.
- Check your 2Checkout account history to confirm the sale was created properly.
- Your new user now has a fully activated account.
Cancelling Members in 2Checkout
Customer subscriptions in 2Checkout can be cancelled directly from your Restrict > Members page. Members can also cancel their own subscriptions from their subscription details page.
Due to limitations of the 2Checkout API, however, these cancellation options will only be available if you place a special username and password inside of your wp-config.php file.
1. Create a new user in your 2Checkout account and give them API access
2. Add the username and password of the newly created user to your wp-config.php file:
define( 'TWOCHECKOUT_ADMIN_USER', 'USER NAME HERE' ); define( 'TWOCHECKOUT_ADMIN_PASSWORD', 'PASSWORD HERE' );
Once you have done this, members can be cancelled from your Restrict > Members page.