Integrate Magento 2
Overview
Magento is an open-source PHP-based eCommerce platform that offers merchants a high degree of flexibility and control over the user experience, catalog, content, and functionality of their online store. You can integrate your Magento 2 web store with 2Checkout by following the steps in this guide.
The new Magento connector will enable merchants to process orders with ConvertPlus, InLine Cart, and 2Pay.js.
Availability
Magento 2 integration is available only for 2Checkout accounts that handle their own tax and invoice management (2Sell and 2Subscribe accounts).
Merchants using the Magento connector built on the legacy 2Chechout hosted cart will be able to upgrade to the new Magento connector as well.
Magento Settings
Follow these steps to integrate Magento 2 connector:
- Download the 2Checkout Payment module from Github and click on the Releases tab to find the latest release.
- You can also download the connector directly from the Master branch, as it always reflects the latest release.
- Upload the files to your server, to your instance of Magento 2. Each file must be uploaded to the correct directory.
- Sign in to your Magento 2 administration panel and navigate to System → Cache management.
- On the Cache management page, click on the Flush Magento Cache button.
- Go back to the System tab and select Index Management.
- On the Index Management page, select the Update on save option and click on the Submit button to re-index all templates.
- In the Magento admin panel, go to Stores → Configuration.
- Under Configuration, click on the Sales tab and scroll down to Payment methods.
-
Under Payment methods, you will see 2checkout Hosted and 2checkout Payment API.
- Select 2Checkout hosted to use the ConvertPlus or InLine shopping carts.
- Select 2Checkout Payment API to use 2Pay.js.
-
After selecting your payment methods configuration, input your:
- Merchant Code in the field 2Checkout Merchant Id
- Buy-Link Secret Word in the field Buy link secret word
- Secret Key in the field Secret key
from the 2Checkout Merchant Control Panel.
- Select your settings for the 2Checkout hosted option and click on Save Config to save your settings. For the Use Inline Checkout field select No, if you want to use ConvertPlus as your default shopping cart.
-
Select your settings for the 2Checkout Payment API option and click on Save Config to save your settings.
The Test Mode dropdown enables or disables the demo mode. If it’s set to Yes, then any placed order is for demonstration purposes only and has no impact on the store.- The Merchant ID field is your Merchant Code which can be found in your 2Checkout Merchant Control Panel, under Integrations → Webhooks & API.
- The Secret key field is your Secret Key which can also be found in your 2Checkout Merchant Control Panel, under Integrations → Webhooks & API.
- The Secret Word field is the Buy-Link Secret Word which can be found in your 2Checkout Merchant Control Panel, under Integrations → Webhooks & API.
- The Use Inline Checkout dropdown determines if the InLine mode or the ConvertPlus mode is used. Setting the Use InLine Checkout option to No enables the ConvertPlus mode.
- The New Order Status sets the default status of the order when it’s created. We do recommend that you leave it as Processing. Unless you have a very good reason to set it to any other status.
- The Invoice Before Fraud Review dropdown issues an invoice before 2Checkout does a fraud review on the order.
- The Invoice After Fraud Review dropdown issues an invoice after 2Checkout does a fraud review.
We recommend you to have the “Invoice Before Fraud Review” option set to “No” and the “Invoice After Fraud Review” option set to “Yes”. Unless you have a good reason to issue the invoice before the fraud review. - The Invoice On Capture field issues an invoice on capturing a transaction.
Both “2checkout Hosted” and “2checkout Payment API” options must be configured. Usually, they have the same settings, but variations are possible.
2Checkout Settings
- Sign in to your 2Checkout Merchant Control Panel account.
- Navigate to Dashboard → Integrations → Webhooks & API section.
- Locate the Merchant Code, Secret key, and the Buy-link Secret Word to be used in the Magento 2 administration panel.
- Under Integrations, click on the IPN Settings tab.
- Set the IPN URL which should be: https://your-site-name.com/tco/ipn/notifications/ and select the SHA 2 / SHA 3 hash.
Example of IPN URL: http://example.com/tco/ipn/notification/. - Enable all Response tags and the Triggers in the IPN section. Those who are not required will simply not be used.
About Magento
Magento is a feature-rich, open-source, enterprise-class eCommerce solution that offers merchants a high degree of flexibility and control over the user experience, catalog, content, and functionality of their online store. In August 2011, Magento was acquired by eBay Inc. In May 2018 it was announced that Magento would be acquired by Adobe for $1.68bn with a view to integrating it into Adobe Experience Cloud, its Enterprise CMS platform. The transaction is expected to complete between June and August of 2018, Q3 of Adobe's fiscal year.
Launched in 2007, the Magento platform now serves tens of thousands of merchants worldwide and is supported by a global community of solution partners and third-party developers. Magento Go is a hosted, software-as-a-service solution that provides small and growing merchants with the eCommerce tools they need to succeed online. Based in Los Angeles, Magento, Inc. is a fast-paced, entrepreneurial organization dedicated to the mission of enabling the eCommerce ecosystem.
Authentication
Overview
Use the login method for the authentication process in the 2Checkout system.
Parameters
Parameters | Type/Description |
---|---|
merchantCode | Required (String) |
Your merchant identification code. | |
date | Required (String) |
GMT ISO Date format (e.g. 2010-01-01 12:13:14) | |
hash | Required (Object) |
Calculated HMAC_SHA256 signature based on merchantCode and date, using your secret key. |
Request
To create the HMAC_SHA256 source string use your merchant code and the date of the request, prefixing them with the length in bytes of each respective value, along with your account’s secret key (for UTF-8 characters the length in bytes might be longer than the string length). For example:
Parameters |
Type/Description |
---|---|
MerchantCode |
Your merchant account code. |
|
8AVANGATE
|
Date |
2010-05-13 12:12:12 |
|
192010-05-13 12:12:12
|
HMAC source string |
8AVANGATE192010-05-13 12:12:12
|
Secret key |
SECRET_KEY |
Calculated HMAC_SHA256 signature based on MerchantCode and Date, using your secret key: |
|
bf763db7d333e9c3038698cf59ada3e6 |
<?php
$host = "https://api.2checkout.com";
$merchantCode = "YOURCODE123";
//your account's merchant code available in the 'System settings' area of the cPanel:
//https://secure.2checkout.com/cpanel/account_settings.php
$key = "SECRET_KEY";
//your account's secret key available in the 'System settings' area of the cPanel:
//https://secure.2checkout.com/cpanel/account_settings.php
$now = gmdate('Y-m-d H:i:s'); //GMT date format)
$algo = "sha256";
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash = hash_hmac($algo, $string, $key);
try {
$client = new SoapClient($host . "/soap/6.0/?wsdl", array(
'location' => $host . "/soap/6.0/",
"stream_context" => stream_context_create(array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false
)
))
));
$sessionID = $client->login($merchantCode, $now, $hash, $algo);
echo("Auth token: {$sessionID}" . PHP_EOL);
}
catch (SoapFault $e) {
echo "Authentication: " . $e->getMessage() . PHP_EOL;
exit;
}
Response
Parameters |
Type/Description |
---|---|
sessionID |
String |
|
Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. |
Go beyond payments
Most payment providers don't do enough for your business New technologies have made it easier than ever to simply process payments. But not every payment provider includes all the crucial commerce elements required to meet customer needs. In fact, our research shows many companies spend a significant portion of their revenue (more than 11 percent) chasing after core needs that were not included in their payment solution. Successful online commerce demands more To build lasting customer relationships, you need a commerce solution that goes beyond payments and includes everything you need to reach customers with appropriate messages for each stage in the purchase lifecycle. In this whitepaper, 2Checkout outlines the key demands of online commerce that most payment providers do not meet, and reveals the combination of commerce, optimization, and distribution that will capture customers' attention. What you'll learn from this resource Download this whitepaper now and find out how a complete commerce solution:
|
![]() |
Integrate Zen Cart
Overview
Integrate Zen Cart to be able to process payments through the 2Checkout platform in over 200 countries and more than 100 currencies.
Zen Cart provides a complete package of solutions to different aspects of online business (features like billing, product display, multi-language options, different currencies, etc.).
Availability
Before you are able to start accepting payments, you need to request and finalize the activation of your live account by completing a form, and provide information that will help us verify the business and identity of the individuals involved in your business.
Zen Cart integration is available only for 2Checkout accounts that handle their own tax and invoice management (2Sell and 2Subscribe).
Zen Cart Settings
Perform the below set of instructions in your Zen Cart account to integrate it with 2Checkout.
- Download the 2Checkout payment module from GitHub.
- Upload the files to your server under your store’s directory.
- Log in to your Zen Cart admin panel.
- Navigate to Modules and click on Payment.
- On the Payment Modules page, select 2Checkout API, 2Checkout Convert Plus, or 2Checkout InLine and click on Install Module, as shown below.
-
Enter your 2Checkout information:
- your Seller ID. The Seller ID is your 2Checkout Merchant Code, and you can find it in the 2Checkout Merchant Control Panel, under Integration → Webhooks and API.
- your Secret Key. You can find it in the 2Checkout Merchant Control Panel, under Integration → Webhooks and API
- your Secret Word. The Secret Word is your 2Checkout Buy-Link Secret Word and you can find it in the 2Checkout Merchant Control Panel, under Integration → Webhooks and API.
- Under Test Mode select No for live sales or Yes for test sales.
- Click Save Changes.
2Checkout Settings
- Log in to your 2Checkout Merchant Control Panel account.
- Navigate to Integrations → Webhooks & API section.
- Enable the IPN webhook notification.
- Go to Integrations → Webhooks & API
- Scroll down to the Notifications section and
- Enable the IPN webhook
- For the Payment notification type field, select IPN or Email Text & IPN, and then click on the Configure IPN button.
- On the IPN settings page, click on the Add IPN URL button, input the IPN URL available on the configuration page in Zen Cart and select the SHA 2 / SHA 3 hash.
- Enable all triggers and response tags.
About Zen Cart
Zen Cart is an eCommerce and online store management software. It is PHP-based, using a MySQL database and HTML components, and supports both physical and digital products as well as services.
Zen Cart truly is the art of e-commerce: free, user-friendly, open-source shopping cart software. The eCommerce website design program is developed by a group of like-minded shop owners, programmers, designers, and consultants that think eCommerce web design could be and should be, done differently.
Security algorithms
2Checkout supports multiple hashing mechanisms to secure the APIs, webhooks, and order flows.