Skip to main content

A/B testing to increase conversion rates

Are you intrigued by the idea of a/b testing, but aren't sure how to get started? Or are you already a/b testing, and are looking to up your game?

Join Evgeniya Ivonina, Head of Website Development at Movavi, and Danny Gonzalez, Director of Conversion Optimization of Sell points as they walk us through their experiences with a/b testing. See how they generated a 5.5% increase in conversion rate and 22% increase in RPV with 2Checkout's CRO services.

Danny and Evgeniya will share details of three tests they ran on the checkout page to optimize cart conversion rates and get a 15x return on investment.

What you'll learn:

  • The four most important steps in any CRO program.
  • How asking your customers a question can generate valuable test ideas.
  • Why insights are more valuable than "winning" tests.
  • How small changes to UX can make a huge difference.
Join Our Webinar

 

Set the cart language for InLine Cart

Overview

Use the Cart object to set the language of the InLine checkout by callingTwoCoInlineCart.cart.setLanguage(language-code).

Use case

  1. Add an HTML link or button in your page like the one below.
  2. Create a JavaScript click handler to execute the Inline Client desired methods.
  3. Use theTwoCoInlineCart.products.add({code, quantity, options})method to prepare your catalog product.
  4. In order to set the language use theTwoCoInlineCart.cart.setLanguage('es')method.
  5. Use theTwoCoInlineCart.cart.checkout()method to show the cart on your page.

Sample request

HTML

<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>

JavaScript

window.document.getElementById('buy-button').addEventListener('click', function() {
  TwoCoInlineCart.products.add({
    code: "74B8E17CC0"
  });
  TwoCoInlineCart.cart.setLanguage('es');
  TwoCoInlineCart.cart.checkout();
});

Demo

After setting the cart language using the above method, your cart should look like this:

InLine Checkout languages

English Native 2Checkout language codes
Arabic العربية ar
Brazilian Portuguese Português do Brasil pt-br
Bulgarian български език bg
Chinese Mandarin Traditional 繁体中文 zy
Chinese Simplified(Cantonese) 中文 zh
Croatian Hrvatski jezik hr
Czech Česky cs
Danish Dansk da
Dutch Dutch nl
English English en
Finnish Suomi fi
French Français fr
German Deutsch de
Greek Ελληνικά el
Hebrew עִבְרִית he
Hindi हिन्दी hi
Hungarian Magyar hu
Italian Italiano it
Japanese 日本語 ja
Korean 한국어 ko
Norwegian Norsk no
Persian فارسی fa
Polish Polski pl
Portuguese Português pt
Romanian Română ro
Russian Русский ru
Serbian Србија sr
Slovak Slovenčina sk
Slovenian Slovène sl
Spanish Español es
Swedish Svenska sv
Thai ไทย th
Turkish Türkçe tr

 

Cross-sell

Overview

Use this object to retrieve information about the cross-sell campaigns you configured for your account. 

Parameters

CrossSellCampaign

Object

MasterProducts

Array

 

Array of product codes for the items you set to trigger the cross-sell campaign.

DisplayType

String

 

  • cart – Shopping cart
  • review – Review page
  • finish – Thank you page

DisplayInEmail

Boolean

 

True or false depending on whether you set the cross-sell campaign to display in payment receipt emails or not.

Products

Array of objects

 

Details below

CampaignCode

String

 

Unique, system-generated cross-sell campaign code.

Name

String

 

Campaign name.

StartDate

String

 

YYYY-MM-DD. The start date you set for the cross-sell campaign.

EndDate

String

 

YYYY-MM-DD. The end date you set for the cross-sell campaign.

 

Products

Object

ProductCode

String

 

Product code for the item you set as recommended for the cross-sell campaign.

Discount

String

 

Value of the discount. This is a percentage.

DiscountType

String

 

PERCENT – you can only set discounts as a percentage from the product price.

 

ConvertPlus checkout with review page

Overview

ConvertPlus offers support for multiple checkout options with/without a review page. As a merchant, you have the possibility to define your own purchase flows with/without review and offer your shoppers the optimal checkout experience. By including a review page before your shoppers finalize their purchase you give them the opportunity to review their order and go back to update their checkout details.

Availability

Available to merchants using the ConvertPlus shopping cart, only for default and one-column templates.

Benefits

Workflow

To implement the checkout with review follow these steps:

  1. Log in to your 2Checkout Merchant Control Panel account.
  2. Navigate to Setup → Generate links.
  3. On the Checkout links page, click on the ConvertPlus tab.
  4. In the ConvertPlus flows section, select the Checkout with review option.

flow with review_1.png

5. Continue with the selection of one or more products from the drop-down list.

6. Scroll down to the Checkout link section and click on Generate link.

7. After you generate a buy-link in with the review flow enabled, the buy-link contains the review=1 parameter and the checkout page will look like in the image below. At this point, the shopper can click on Continue to review before they place the order.

flow with review_2.png

8. On the Review page, before hitting the Place order button, the shopper can edit the order details, the billing details, and/or the card details by clicking on the Edit links, as shown below.

  • When clicking on the Edit link in the Order summary section, the shopper is redirected to the Secure Checkout page to edit the order details
  • When clicking on the Edit link in the Billing information section, the shopper is redirected to the Secure Checkout page to edit his details
  • When clicking on the Edit link in the Payment information section (card no. and security code obfuscated), the shopper is prompted with the Payment details form to edit CC details
  • When clicking on the Edit link in the Delivery information section, the shopper is redirected to the Secure Checkout page to edit the delivery details
  • When selecting a different payment method from the review page, the shopper is redirected to the checkout page with the new payment method

flow with review_3.png

9 Proven Affiliate Management Tips to Increase Your Sales

Growing an affiliate program for your business is as challenging as is rewarding. Merchants (i.e. advertisers) connected to the 2Checkout network get on average 25% of their sales via the affiliates they engage with.

 

But just plugging into a network doesn't mean instant success. Defining and following the best strategy to increase affiliate sales is not an easy task. But support is at hand.

 

This e-book will help you:

  • Understand your brand and figure out if affiliate marketing works for you
  • Prepare and launch your affiliate program
  • Increase your sales through 9 proven hands-on tips and tricks
9-proven-affiliate-management-tips-lp.png

Create price option groups

Overview

Use the addPriceOptionGroup method to create price option groups for your subscription plans/products.

  • Send options for each pricing group or 2Checkout throws an exception.
  • When adding an interval with no min/max values or overlapping values, 2Checkout throws an exception. 

Parameters

sessionID

Required (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.

PriceOptionsGroup

Required (object)

 

Use this object to create a new price option group for your account.

Response

bool(true)

Request

<?php

$host   = "https://api.avangate.com";
$client = new SoapClient($host . "/soap/4.0/?wsdl", array(
    'location' => $host . "/soap/4.0/",
    "stream_context" => stream_context_create(array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    ))
));


function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}

$merchantCode = "YOURCODE123"; //your account's merchant code available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$key          = "SECRET_KEY"; //your account's secret key available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')

$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);

try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}

catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}


$PriceOptionGroup = new stdClass();
$PriceOptionGroup->Name = 'New Multi Users';
$PriceOptionGroup->Description = 'Quos aut ipsam ipsum omnis aut molestiae. Et quod molestias distinctio. Fugiat sit asperiores reprehenderit officia eaque quae quia. Aperiam quia quia illo eos nesciunt accusamus.';
$PriceOptionGroup->Translations = array();
$PriceOptionGroup->Translations[0] = new stdClass();
$PriceOptionGroup->Translations[0]->Name = 'xdrki7ljix';
$PriceOptionGroup->Translations[0]->Description = 'Beatae doloribus ipsam voluptatem et. Iure dignissimos non amet. Quibusdam fugiat dolor repudiandae temporibus harum.';
$PriceOptionGroup->Translations[0]->Language = 'en';
$PriceOptionGroup->Translations[1] = new stdClass();
$PriceOptionGroup->Translations[1]->Name = '37wr8ie2dj';
$PriceOptionGroup->Translations[1]->Description = 'Esse distinctio voluptatibus omnis et et quia dolor. Quibusdam dicta dolores odio consequatur velit voluptate. Laboriosam reiciendis libero vel quae molestiae ad.';
$PriceOptionGroup->Translations[1]->Language = 'ru';
$PriceOptionGroup->Type = 'RADIO';
$PriceOptionGroup->Options = array();
$PriceOptionGroup->Options[0] = new stdClass();
$PriceOptionGroup->Options[0]->Name = 'SingleUser';
$PriceOptionGroup->Options[0]->Description = 'Nisi ea autem a labore similique. Minus natus cumque nemo. Aut aliquam laboriosam dolorem ad.';
$PriceOptionGroup->Options[0]->Translations = array();
$PriceOptionGroup->Options[0]->Translations[0] = new stdClass();
$PriceOptionGroup->Options[0]->Translations[0]->Name = '0q2r3kcj0q';
$PriceOptionGroup->Options[0]->Translations[0]->Description = 'Voluptatem in vitae rerum ea tempore. Non cumque ullam optio quis. Laborum maxime sunt facere. Dolor fugit a fugiat quasi facere totam.';
$PriceOptionGroup->Options[0]->Translations[0]->Language = 'en';
$PriceOptionGroup->Options[0]->Translations[1] = new stdClass();
$PriceOptionGroup->Options[0]->Translations[1]->Name = 'dwfxuw4lrn';
$PriceOptionGroup->Options[0]->Translations[1]->Description = 'Debitis omnis maiores quia praesentium totam error corrupti. Consectetur eum magnam quam vero. Sit aperiam natus perspiciatis iusto sint ut fugit. Adipisci illum non voluptatem voluptas.';
$PriceOptionGroup->Options[0]->Translations[1]->Language = 'it';
$PriceOptionGroup->Options[0]->Code = 'singleuser1';
$PriceOptionGroup->Options[0]->SubscriptionImpact = new stdClass();
$PriceOptionGroup->Options[0]->SubscriptionImpact->Impact = 'Add';
$PriceOptionGroup->Options[0]->SubscriptionImpact->Months = 1;
$PriceOptionGroup->Options[0]->PriceImpact = new stdClass();
$PriceOptionGroup->Options[0]->PriceImpact->Method = 'FIXED';
$PriceOptionGroup->Options[0]->PriceImpact->Amounts = array();
$PriceOptionGroup->Options[0]->PriceImpact->Amounts[0] = new stdClass();
$PriceOptionGroup->Options[0]->PriceImpact->Amounts[0]->Currency = 'USD';
$PriceOptionGroup->Options[0]->PriceImpact->Amounts[0]->Amount = 90.61;
$PriceOptionGroup->Options[0]->PriceImpact->Amounts[1] = new stdClass();
$PriceOptionGroup->Options[0]->PriceImpact->Amounts[1]->Currency = 'EUR';
$PriceOptionGroup->Options[0]->PriceImpact->Amounts[1]->Amount = 6.70;
$PriceOptionGroup->Options[0]->PriceImpact->ImpactOn = 'BASE';
$PriceOptionGroup->Options[0]->PriceImpact->Impact = 'ADD';
$PriceOptionGroup->Options[0]->PriceImpact->Percent = 39;
$PriceOptionGroup->Options[0]->Default = false;
$PriceOptionGroup->Options[1] = new stdClass();
$PriceOptionGroup->Options[1]->Name = 'MultiUser';
$PriceOptionGroup->Options[1]->Description = 'Vero voluptatum fuga et repellendus sed qui. Dolores molestiae error non ad aperiam. In error quos eum quas repudiandae pariatur et suscipit.';
$PriceOptionGroup->Options[1]->Translations = array();
$PriceOptionGroup->Options[1]->Translations[0] = new stdClass();
$PriceOptionGroup->Options[1]->Translations[0]->Name = 'MultiUser';
$PriceOptionGroup->Options[1]->Translations[0]->Description = 'Debitis et saepe facere blanditiis. Tempore et nemo aut ullam possimus ipsum nisi. Ad libero et consequuntur aliquam libero. Rerum aut illum eveniet earum.';
$PriceOptionGroup->Options[1]->Translations[0]->Language = 'en';
$PriceOptionGroup->Options[1]->Translations[1] = new stdClass();
$PriceOptionGroup->Options[1]->Translations[1]->Name = 'dw5zgkcki9';
$PriceOptionGroup->Options[1]->Translations[1]->Description = 'Vel et excepturi veniam. In iusto eveniet pariatur hic labore. Et qui dolorem accusantium molestias iusto.';
$PriceOptionGroup->Options[1]->Translations[1]->Language = 'pt';
$PriceOptionGroup->Options[1]->Code = 'multiuser999';
$PriceOptionGroup->Options[1]->SubscriptionImpact = new stdClass();
$PriceOptionGroup->Options[1]->SubscriptionImpact->Impact = 'ADD';
$PriceOptionGroup->Options[1]->SubscriptionImpact->Months = 2;
$PriceOptionGroup->Options[1]->PriceImpact = new stdClass();
$PriceOptionGroup->Options[1]->PriceImpact->Method = 'FIXED';
$PriceOptionGroup->Options[1]->PriceImpact->Amounts = array();
$PriceOptionGroup->Options[1]->PriceImpact->Amounts[0] = new stdClass();
$PriceOptionGroup->Options[1]->PriceImpact->Amounts[0]->Currency = 'USD';
$PriceOptionGroup->Options[1]->PriceImpact->Amounts[0]->Amount = 65.03;
$PriceOptionGroup->Options[1]->PriceImpact->Amounts[1] = new stdClass();
$PriceOptionGroup->Options[1]->PriceImpact->Amounts[1]->Currency = 'EUR';
$PriceOptionGroup->Options[1]->PriceImpact->Amounts[1]->Amount = 64.58;
$PriceOptionGroup->Options[1]->PriceImpact->ImpactOn = 'BASE';
$PriceOptionGroup->Options[1]->PriceImpact->Impact = 'ADD';
$PriceOptionGroup->Options[1]->PriceImpact->Percent = 51;
$PriceOptionGroup->Options[1]->Default = true;
$PriceOptionGroup->Code = null;
$PriceOptionGroup->Required = false;
try {
    $NewPriceOptionGroup = $client->addPriceOptionGroup($sessionID, $PriceOptionGroup);
}

catch (SoapFault $e) {
    echo "NewPriceOptionGroup: " . $e->getMessage();
    exit;
}

var_dump("NewPriceOptionGroup", $NewPriceOptionGroup);


?>

Pay-per-Usage

Use this option to create and assign PAYPERUSE price options to your portfolio.

For non PAYPERUSAGE cases, the Usage and UsagePricingModel fields are not required.

 Request sample with PAYPERUSE

 <?php
declare(strict_types=1);

class Configuration
{
    public const MERCHANT_CODE = '';
    public const MERCHANT_KEY = '';
    public const URL = 'http://api.2checkout.com/soap/6.0';
    public const ACTION = 'addPriceOptionGroup';
    public const ADDITIONAL_OPTIONS = null;
    //array or JSON
    public const PAYLOAD = <<<JSON
{
    "Type": "INTERVAL",
    "Code": "PayPerUsage-CODE",
    "Required": false,
    "Name": "Pay per usage pricing option group",
    "Description": "Test option description",
    "Usage": "PAYPERUSAGE",
    "UsagePricingModel": "STEPPED",
    "Options": [
        {
            "Code": "9876545678",
            "ScaleMin": "1",
            "ScaleMax": "9",
            "SubscriptionImpact": {
                "Months": "0.00",
                "Impact": null
            },
            "PriceImpact": {
                "Amounts": {
                    "USD": {
                        "Currency": "USD",
                        "Amount": "1.00"
                    },
                    "EUR": {
                        "Currency": "EUR",
                        "Amount": "6.00"
                    }
                },
                "ImpactOn": null,
                "Method": "FIXED",
                "Percent": null,
                "Impact": null
            },
            "Default": false,
            "Name": "translation_5f90150268bef",
            "Description": "Translation value",
            "Translations": [
                {
                    "Name": "translation_5f90150268bf7",
                    "Description": "Translation value",
                    "Language": "RO"
                },
                {
                    "Name": "translation_5f90150268bef",
                    "Description": "Translation value",
                    "Language": "EN"
                },
                {
                    "Name": "translation_5f90150268bf9",
                    "Description": "Translation value",
                    "Language": "FR"
                },
                {
                    "Name": "translation_5f90150268bf5",
                    "Description": "Translation value",
                    "Language": "RU"
                }
            ]
        },
        {
            "Code": "98765456789",
            "ScaleMin": "10",
            "ScaleMax": "19",
            "SubscriptionImpact": {
                "Months": "0.00",
                "Impact": null
            },
            "PriceImpact": {
                "Amounts": {
                    "USD": {
                        "Currency": "USD",
                        "Amount": "1.00"
                    },
                    "EUR": {
                        "Currency": "EUR",
                        "Amount": "6.00"
                    }
                },
                "ImpactOn": null,
                "Method": "FIXED",
                "Percent": null,
                "Impact": null
            },
            "Default": false,
            "Name": "translation_5f90150268bef",
            "Description": "Translation value",
            "Translations": [
                {
                    "Name": "translation_5f90150268bf7",
                    "Description": "Translation value",
                    "Language": "RO"
                },
                {
                    "Name": "translation_5f90150268bef",
                    "Description": "Translation value",
                    "Language": "EN"
                },
                {
                    "Name": "translation_5f90150268bf9",
                    "Description": "Translation value",
                    "Language": "FR"
                },
                {
                    "Name": "translation_5f90150268bf5",
                    "Description": "Translation value",
                    "Language": "RU"
                }
            ]
        }
    ],
    "Translations": [
        {
            "Name": "Pay per usage pricing option group",
            "Description": "Test option description",
            "Language": "EN"
        }
    ]
}
JSON;
}

class Client
{
    public function call(
        string $url = Configuration::URL,
        $payload = Configuration::PAYLOAD,
        string $action = Configuration::ACTION
    ): ?object {
        if (is_array($payload)) {
            $payload = json_encode($payload);
        }
        if (!empty($payload)) {
            // SoapClient works with objects(StdClass)
            $payload = json_decode($payload);
        }
        $soapClient = $this->getClient($url);
        $sessionId = $this->getSession($soapClient);
        $args = array_filter([$sessionId, $payload]);

        return $soapClient->$action(...$args);
    }

    public function getClient(string $url): SoapClient
    {
        return new SoapClient(
            $url.'?wsdl',
            [
                'location' => $url,
                'cache_wsdl' => WSDL_CACHE_NONE,
            ]
        );
    }

    public function getSession(SoapClient $client)
    {
        $date = gmdate('Y-m-d H:i:s');
        $merchantCode = Configuration::MERCHANT_CODE;
        $key = Configuration::MERCHANT_KEY;
        $string = strlen($merchantCode).$merchantCode.strlen($date).$date;
        $hash = hash_hmac('md5', $string, $key);
        $client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');

        return $client->login($merchantCode, $date, $hash);
    }
}

try {
    $client = new Client();
    var_dump($client->call());
} catch (Exception $ex) {
    var_dump($ex);
}

Request sample without PAYPERUSE

 <?php
declare(strict_types=1);

class Configuration
{
    public const MERCHANT_CODE = '';
    public const MERCHANT_KEY = '';
    public const URL = 'http://api.2checkout.com/soap/6.0';
    public const ACTION = 'addPriceOptionGroup';
    public const ADDITIONAL_OPTIONS = null;
    //array or JSON
    public const PAYLOAD = <<<JSON
{
    "Type": "RADIO",
    "Code": "RADIO-CODE",
    "Required": false,
    "Name": "Radio pricing option group",
    "Description": "Test option description",
    "Options": [
        {
            "Code": "9876545678",
            "ScaleMin": "1",
            "ScaleMax": "9",
            "SubscriptionImpact": {
                "Months": "0.00",
                "Impact": null
            },
            "PriceImpact": {
                "Amounts": {
                    "USD": {
                        "Currency": "USD",
                        "Amount": "1.00"
                    },
                    "EUR": {
                        "Currency": "EUR",
                        "Amount": "6.00"
                    }
                },
                "ImpactOn": null,
                "Method": "FIXED",
                "Percent": null,
                "Impact": null
            },
            "Default": false,
            "Name": "translation_5f90150268bef",
            "Description": "Translation value",
            "Translations": [
                {
                    "Name": "translation_5f90150268bf7",
                    "Description": "Translation value",
                    "Language": "RO"
                },
                {
                    "Name": "translation_5f90150268bef",
                    "Description": "Translation value",
                    "Language": "EN"
                },
                {
                    "Name": "translation_5f90150268bf9",
                    "Description": "Translation value",
                    "Language": "FR"
                },
                {
                    "Name": "translation_5f90150268bf5",
                    "Description": "Translation value",
                    "Language": "RU"
                }
            ]
        },
        {
            "Code": "98765456789",
            "ScaleMin": "10",
            "ScaleMax": "19",
            "SubscriptionImpact": {
                "Months": "0.00",
                "Impact": null
            },
            "PriceImpact": {
                "Amounts": {
                    "USD": {
                        "Currency": "USD",
                        "Amount": "1.00"
                    },
                    "EUR": {
                        "Currency": "EUR",
                        "Amount": "6.00"
                    }
                },
                "ImpactOn": null,
                "Method": "FIXED",
                "Percent": null,
                "Impact": null
            },
            "Default": false,
            "Name": "translation_5f90150268bef",
            "Description": "Translation value",
            "Translations": [
                {
                    "Name": "translation_5f90150268bf7",
                    "Description": "Translation value",
                    "Language": "RO"
                },
                {
                    "Name": "translation_5f90150268bef",
                    "Description": "Translation value",
                    "Language": "EN"
                },
                {
                    "Name": "translation_5f90150268bf9",
                    "Description": "Translation value",
                    "Language": "FR"
                },
                {
                    "Name": "translation_5f90150268bf5",
                    "Description": "Translation value",
                    "Language": "RU"
                }
            ]
        }
    ],
    "Translations": [
        {
            "Name": "Radio pricing option group",
            "Description": "Test option description",
            "Language": "EN"
        }
    ]
}
JSON;
}

class Client
{
    public function call(
        string $url = Configuration::URL,
        $payload = Configuration::PAYLOAD,
        string $action = Configuration::ACTION
    ): ?object {
        if (is_array($payload)) {
            $payload = json_encode($payload);
        }
        if (!empty($payload)) {
            // SoapClient works with objects(StdClass)
            $payload = json_decode($payload);
        }
        $soapClient = $this->getClient($url);
        $sessionId = $this->getSession($soapClient);
        $args = array_filter([$sessionId, $payload]);

        return $soapClient->$action(...$args);
    }

    public function getClient(string $url): SoapClient
    {
        return new SoapClient(
            $url.'?wsdl',
            [
                'location' => $url,
                'cache_wsdl' => WSDL_CACHE_NONE,
            ]
        );
    }

    public function getSession(SoapClient $client)
    {
        $date = gmdate('Y-m-d H:i:s');
        $merchantCode = Configuration::MERCHANT_CODE;
        $key = Configuration::MERCHANT_KEY;
        $string = strlen($merchantCode).$merchantCode.strlen($date).$date;
        $hash = hash_hmac('md5', $string, $key);
        $client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');

        return $client->login($merchantCode, $date, $hash);
    }
}

try {
    $client = new Client();
    var_dump($client->call());
} catch (Exception $ex) {
    var_dump($ex);
}

Subscription renewal notifications

Overview

Use the setRenewalNotificationStatus method to subscribe or unsubscribe shoppers from subscription renewal notifications.

Parameters

Parameters

Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

Status

Required (boolean)

 

true – enable subscription renewal notifications.

false – disable subscription renewal notifications.

Response

Boolean

true or false depending on whether or not the operation succeeded.

Request


<?php
$host   = "https://api.avangate.com";
$client = new SoapClient($host . "/soap/3.0/?wsdl", array(
    'location' => $host . "/soap/3.0/",
    "stream_context" => stream_context_create(array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    ))
));

function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
$merchantCode = "YOUR_MERCHANT_CODE";// your account's merchant code available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$key = "YOUR_SECRET_KEY";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);
try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}
catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}
$subscriptionReference = '30E47F8699';
$Status = true;
try {
    $Notifications = $client->setRenewalNotificationStatus($sessionID, $subscriptionReference, $Status);
}
catch (SoapFault $e) {
    echo "Notifications: " . $e->getMessage();
    exit;
}
var_dump("Notifications", $Notifications);

Top 10 myths of conversion optimization

Conversion rate optimization can be a humbling experience. You start with a hypothesis (your opinion on how to improve your website) and then run a test to see if you were right or wrong. There aren't too many professions that subject themselves to such quantifiable evaluation.

But there is good news for Marketers and eCommerce Managers: "surprising" test results often increase the conversion rate, and if a test does not beat the status quo, you have still learned a valuable insight about your customers. Knowing what moves the needle, and what does not, is the key to increasing revenue consistently quarter over quarter.

In this webinar, we explore the most insightful and sometimes surprising test results that often contradicted our idea of a "best practice".

Shannon MacLeod, Senior Director of Conversion Optimization at 2Checkout, and Alhan Keser, Director of Optimization Strategy at WiderFunnel

  • Share real examples of tests they have run on websites and shopping carts
  • Demonstrate the value of a tested practice versus a best practice
  • Provide tips on how to run a valid split test
Join Our Webinar

 

Unassign a product group

Overview

Use the unassignProductGroup method to unassign a product from a specific product group and assign it to the General product group instead.

Parameters

Parameters Type/Description

sessionID

Required (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.

productCode

Required (string)

 

The code of the product you wish assigned to the group.

groupCode Required (string)
  Unique, system-generated identifier assigned to product groups. 

Response

bool(true)
<?php

require ('PATH_TO_AUTH');

$productCode = "YOUR_PRODUCT_CODE";
$groupCode = "YOUR_PRODUCT_GROUP_CODE";

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'unassignProductGroup',
'params' => array($sessionID, $productCode, $groupCode)
);

var_dump (callRPC($jsonRpcRequest, $host));

?>

Retrieve a product group

Overview

Use the getProductGroup method to extract information about a specific product group you created for your account.

Parameters

Parameters Type/Description

sessionID

Required (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.

groupCode Required (string)
  Unique, system-generated identifier assigned to product groups. 

Response

Parameters Type/Description

ProductGroup

Array of objects

Request

<?php

require ('PATH_TO_AUTH');

$groupCode = 'YOUR_GROUP_CODE';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getProductGroup',
'params' => array($sessionID, $groupCode)
);

var_dump (callRPC((Object)$jsonRpcRequest, $host));

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