Skip to main content

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:

  1. Download the 2Checkout Payment module from Github and click on the Releases tab to find the latest release.
    magento step 1.png
  2. You can also download the connector directly from the Master branch, as it always reflects the latest release.
  3. Upload the files to your server, to your instance of Magento 2. Each file must be uploaded to the correct directory.
    magento2_branch.jpg
  4. Sign in to your Magento 2 administration panel and navigate to System → Cache management.
    magento 2 integration_2.png
  5. On the Cache management page, click on the Flush Magento Cache button.
    magento 2 integration_3.png
  6. Go back to the System tab and select Index Management.
    magento 2 integration_4.png
  7. On the Index Management page, select the Update on save option and click on the Submit button to re-index all templates.
    magento 2 integration_5.png
  8. In the Magento admin panel, go to Stores → Configuration.
    magento 2 integration_6.png
  9. Under Configuration, click on the Sales tab and scroll down to Payment methods.
    magento 2 integration_7.png
  10. 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.

    magento 2 integration_8.png

  11. 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.
    magento 2 integration_9.png

  12. 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.
    magento 2 integration_10.png
  13. Select your settings for the 2Checkout Payment API option and click on Save Config to save your settings.
    magento 2 integration_11.png
    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

  1. Sign in to your 2Checkout Merchant Control Panel account.
  2. Navigate to Dashboard → Integrations → Webhooks & API section.
    Webhooks & API section
  3. Locate the Merchant Code, Secret key, and the Buy-link Secret Word to be used in the Magento 2 administration panel.
  4. Under Integrations, click on the IPN Settings tab.
    IPN Settings
  5. 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/.
  6. 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.

The sessionID expires in 10 minutes.

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:

  • Goes beyond the efforts of typical payment providers
  • The key elements of commerce that capture customer attention
  • Offers new options for global distribution
  • Supports conversion optimization techniques to boost the bottom line
go-beyond-payments.png

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.

  1. Download the 2Checkout payment module from GitHub.
  2. Upload the files to your server under your store’s directory.
  3. Log in to your Zen Cart admin panel.
  4. Navigate to Modules and click on Payment.
    Integrate_Zen_Cart_1.jpg
  5. On the Payment Modules page, select 2Checkout API, 2Checkout Convert Plus, or 2Checkout InLine and click on Install Module, as shown below.
    Integrate_Zen_Cart_2.jpg
  6. 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.

    Integrate_Zen_Cart_3.jpg

  7. Under Test Mode select No for live sales or Yes for test sales.
  8. Click Save Changes.

2Checkout Settings

  1. Log in to your 2Checkout Merchant Control Panel account.
  2. Navigate to Integrations → Webhooks & API section.
    Webhooks & API section
  3. 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.
      Add IPN URL
    • 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.

 

Order details page

Overview

Use the Order details page to get order information, request refunds, confirm purchase orders and send invoices via email.

Order details page sections

Order status section

The Order status section is the main order information area at the top of the page shows details such as:

  • The unique order reference number
  • Order status
  • Date when the order was placed
  • Date when the order was completed
  • Chargeback status in scenarios in which a dispute was registered, along with its evolution
  • Order number
  • External reference number
  • Payment method
  • Notifications sent to the merchant (view additional info in the Order History section, at the bottom of the page)

Order details

The Order details area displays information about:

  • Product names
  • SKUs (stock-keeping units, provided that they're defined)
  • Price details and pricing options info
  • Extra info
  • Discounts
  • Taxes including VAT, sales tax, and shipping fees
  • Affiliate info and commission
  • Link source
  • Additional information

The Order details area also enables fast access to any subscriptions associated with products sold to customers.

In addition, via the Delivery details link you can access Delivered codes and the Product download link sent.

order status page_1.JPG

Shipping details

The Shipping details area displays information regarding the delivery of your tangible/physical products. Use this section to view the order shipping method, the tracking URL and Number provided to the customer, and the additional information you filled in when marking the order as shipped.

This section is displayed only for orders that have a physical product.

order status page_3.JPG

Comments

The comments area displays any comments attached to this order using the Add comment functionality. Comments can be removed from an order by clicking the Delete button. Comment deleting is only available to the control panel users who added the notes.

Billing details and delivery address

This area provides the billing and delivery information that customers enter during the purchase order.

Use the link on the Customer ID to access the Customer account of the shopper using the subscription(s) associated with the product(s) purchased via a specific order.

Order history

The order history area displays information on order status evolution, the notifications sent as well as delivery details. Use the filters at the top of this section to view only specific details or all data in chronological order.

order status page_2.JPG

Order details page actions

Resend notifications

Information on the number of sent vendor notifications is displayed in the area at the top of the screen when viewing the details for a specific Order.

At the same time, the Order history area at the bottom of the Order Details page is designed to let you filter only details on both email and Instant Payment Notifications (IPN) sent by the 2Checkout system.

To resend notifications for an order for which you've already received the initial IPN and email messages, follow these steps:

  1. Log in to your Merchant Control Panel.
  2. Navigate to the Orders & customers.
  3. Click on Order search and add your desired filter to search for a specific order.
  4. On the Order Details page, click on the Resend notification(s) button in the Order status section, at the top of the page.
  5. Check the checkbox next to the Debug IPN option and click Resend. You'll receive a visual output of the IPN content sent to you, so you can use the information to fine-tune your script.

order status page_4.JPG.png

View subscription

Use the View Subscription link to access details on the subscriptions associated with products sold as a part of specific orders.

Delivery details

Use the Delivery details link to any access Delivered codes and Product download link sent. The Delivery details pop-up also enables you to resend both delivered codes and product download links to customers, using the email address specified in the popup window.

Mark as shipped

For orders that require the physical delivery of a product, use the Mark as Shipped button to confirm the shipment of the product. Optionally, you can fill in a tracking number and additional shipping information, before marking the order as shipped.

Print package slip

Use the Print Package Slip functionality to print a document containing order and shipment information. Add this document to the package sent, so that customers who purchase tangible goods may use it for identifying their packages.

Requesting a refund

Refunds can be requested for each order.

Add a comment

Attach comments to orders by clicking the Add comment button.

Print

You can print the Order details page by clicking the Print button in the Order details section.

order status page_5.png

Confirm or cancel Purchase Orders

When customers use Purchase Orders as a payment method, to confirm or cancel the order, click to edit it after you identified it using Order search. In the area at the top of the screen, you can access the files uploaded as a part of the PO payment process, but also cancel or confirm the Purchase Order.

Once the PO payment is complete, the following information will be displayed when viewing the order:

Upgrades and renewal orders

Upgrades and renewal orders are marked accordingly, just as in the screenshots below:

Screenshot

Screenshot1

 

 

Send invoices on-demand via email

This feature enables you to send and re-send invoices via email for orders placed through the 2Checkout system.

To send invoices on-demand via email, the following requirements must be met:

  • a shopper invoice has to be attached to the order;
  • orders need to have been finalized, reaching the Complete status. This feature is also available for Refund orders as well as those paid with a Purchase Order (with the Pending status).

Send/re-send an invoice

To send or re-send an invoice, follow these steps:

  1. Go to Orders & customers → Order Search.
  2. Search for the order for which you'll send/re-send the invoice.
  3. Click the reference number of the items returned to the query to access the Order Details page.
  4. Click Send invoice.
  5. By default, the email field is prefilled with the email address extracted from the Billing details for the order. This piece of information is editable, and you can enter another email address to which the invoice will be sent.

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo