Skip to main content

Retrieve all campaigns

Overview

Use the searchCrossSellCampaigns method to extract information about the cross-sell campaigns you configured.

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.

Response

Parameters Type/Description

CrossSellCampaign

Object

Request

<?php

require ('PATH_TO_AUTH');

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'searchCrossSellCampaigns';
$jsonRpcRequest->params = array($sessionID);
$jsonRpcRequest->id = $i++;

var_dump(" \n Cross-sell campaigns: \n", callRPC($jsonRpcRequest, $host));

Retrieve an affiliate by code

Overview

Use the getAffiliate method to extract details about an affiliate by code.

Request Parameters

Parameters Required Type/Description
AffiliateCode Required String. Unique code which represents an affiliate.

Request Example

<?php
$apiVersion = '6.0';
// $apiHost = "http://api.secure.avangate.local";
$apiHost = "http://api.sandbox34.avangate.local";

$host = $apiHost."/soap/" . $apiVersion . "/";

$client = new SoapClient($host."?wsdl", array('location' => $host, 'cache_wsdl' => WSDL_CACHE_NONE));
$client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');

// $merchantCode = "AKULAJQW";
// $key = "P5LX&a&9=4Z)1!2L2*0N";

$merchantCode = "lucian";
$key = "SECRET_KEY";

$date = gmdate('Y-m-d H:i:s');
$string = strlen($merchantCode) . $merchantCode . strlen($date) . $date;
$hash = hash_hmac('md5', $string, $key);

try {
    $sessionID = $client->login($merchantCode, $date, $hash);
} catch (SoapFault $e) {
    echo  $e->getMessage();

}

var_dump("session: ". $sessionID);

$affiliateId = "79396127BA";
// Active:
// 1295 - 964CF2AF42
// 11541 - E4B69882C2
// 12951 - E8A1DB473C
// 12950 - 44857BFE94

// Pending:
// 13639 - F56BCF1E2E

// Rejected
// 65602 - 79396127BA

try {
    $response = $client->getAffiliate($sessionID, $affiliateId);
    print_r(json_encode($response));

} catch (SoapFault $e) {
    echo  $e->getMessage();
}

// print_r($response);

Response Parameters

Parameters Description

AffiliateCode

Unique, system-generated identifying code of the affiliate.
Status Merchant Affiliate relationship status.
AffiliateName Name of the affiliate.
Website Website of the affiliate.
CommissionList Affiliate commission list.
                                        ListName Name of the affiliate commission list.
                                        CommissionRate Value of the commission rate (in %).
RequestDate  
Categories Product category  of the affiliate.
NotifyUpdates Boolean. Value can be TRUE or FALSE.
TCSStatus  
AffiliateContact Affiliate contact details.
                                         FirstName Affiliate first name.
                                         LastName Affiliate last name.
                                        Phone Affiliate phone number.
                                        Email Affiliate email.
                                        Country Country of the affiliate.

Response Example

{  
   "AffiliateCode":"TFTF76455ee4YFCFCT6545465",
   "Status":"Active",
   "Affiliate Name":"STIC Soft E-Solutions Private Limited",
   "Website":"https://debasis.2checkout.com",
   "CommissionList":  {  
         "ListName":"CommissionList1",
         "CommissionRate":"25%"
    },
   "RequestDate":"2018-10-05",
   "Categories":["PC security","Mobile security","Tablet security"],
   "TCStatus":"Accepted",
   "AffiliateContact":{  
      "FirstName":"FN",
      "LastName":"LN",
      "Phone":"0040723483987",
      "Email":"FN.LN@2AFFLT.COM",
      "Country":"Spain"
   }
}

Shipping fees

Overview

Use this object to retrieve information about shipping fees. 

Parameters

ShippingFee

Array of objects

Name

String

 

The name of the shipping fee configuration. 

Code String
  Unique, system-generated shipping fee identifier. 

Amount

String

 

The shipping costs

Currency

String

 

The currency ISO code used for shipping costs - ISO 4217.

ApplyTo

String

 

Possible values:

• PRODUCT

• ORDER

Type

String

 

 

Possible values:

• FIXED

• PERCENT

 

Add leads for catalog products

Overview

The lead management functionality that exists for the ConvertPlus cart can be also integrated with a self-hosted cart.

Use the addLead method to create a lead when a customer abandons the cart before placing an order.

Request Parameters

Parameters Required Type/Description
Items Required Purchased products.
BillingDetails Required Array of strings. Billing information for the order.
DeliveryDetails Required Array of strings. Delivery information for the order.

Request Example

<?php

require ('PATH_TO_AUTH');

$Lead = new stdClass();

$Lead->CartId = "CartIdValue";
$Lead->Currency = "EUR";
$Lead->Language = "EN";
$Lead->ExternalReference = "REST_API_2CHECKOUT";
$Lead->Source = "testAPI.com";
$Lead->CustomerReference = "asdf1";
$Lead->MachineId = "123asd";

$Lead->Items = [];

$Item = new stdClass();
$Item->Code = "04C26C50F8";
$Item->Quantity = 2;
$Item->IsDynamic = false;
$Item->Tangible = true;
$Item->PurchaseType = "PRODUCT";
$Item->PriceOptions = [];

$priceOption = new stdClass();
$priceOption->Name = "group name 1";
$priceOption->Required = false;
$option = new stdClass();
$option->Name = 'add25';
$option->Value = 'add25';
$option->Surcharge = 100;
$priceOption->Options[] = $option;

$Item->PriceOptions[] = $priceOption;

$recurringOptions = new stdClass();
$recurringOptions->CycleLength = 6;
$recurringOptions->CycleUnit = 'MONTH';
$recurringOptions->CycleAmount = 100;
$recurringOptions->ContractLength = 2;
$recurringOptions->ContractUnit = 'YEAR';
$Item->RecurringOptions = $recurringOptions;

$marketingCampaigns = new stdClass();
$marketingCampaigns->Type = 23;
$marketingCampaigns->ParentCode = "m";
$marketingCampaigns->CampaignCode = 23;
$Item->MarketingCampaigns = $marketingCampaigns;

$Item->Price = new stdClass();
$Item->Price->Amount = 20;
$Item->Price->Type = "CUSTOM";

$additionalFields = [];

$additionalField = new stdClass();
$additionalField->Code = "TestFieldOne";
$additionalField->Text = "test text";
$additionalField->Value = "test value";
$additionalFields[] = $additionalField;
$Item->AdditionalFields = $additionalFields;

$Item->SubscriptionStartDate = date("Y-m-d H:i:s");

$Lead->Items[] = $Item;

$billingDetails = new stdClass();
$billingDetails->FirstName = "Customer";
$billingDetails->LastName = "2Checkout";
$billingDetails->Phone = null;
$billingDetails->Company = null;
$billingDetails->FiscalCode = "32423423";
$billingDetails->Email = "customer@2checkout.com";
$billingDetails->Address1 = "Test Address";
$billingDetails->Address2 = null;
$billingDetails->City = "LA";
$billingDetails->Zip = "12345";
$billingDetails->CountryCode = "RO";
$billingDetails->State = "CA";

$Lead->BillingDetails = $billingDetails;
$Lead->DeliveryDetails = clone($billingDetails);

$Lead->DeliveryInformation = new stdClass();
$Lead->DeliveryInformation->ShippingMethod = new stdClass();
$Lead->DeliveryInformation->ShippingMethod->Code = "sdfsd";

$Lead->PaymentDetails = new stdClass();
$Lead->PaymentDetails->Type = "CC";
$Lead->PaymentDetails->Currency = "EUR";
$Lead->PaymentDetails->PaymentMethod = new stdClass();
$Lead->PaymentDetails->PaymentMethod->RecurringEnabled = false;
$Lead->PaymentDetails->PaymentMethod->CardPayment = new stdClass();
$Lead->PaymentDetails->PaymentMethod->CardPayment->InstallmentsNumber = 23;
$Lead->PaymentDetails->CustomerIP = "1.2.3.4";

$Lead->LocalTime = date("Y-m-d H:i:s");

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

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

Response Example

class stdClass#18 (3) {
  public $LeadCode =>
  string(10) "60E6C4B574"
  public $CreatedAt =>
  string(19) "2019-11-05T16:39:36"
  public $Errors =>
  array(0) {
  }
}

 

Remove translations

Overview

Use the deletePromotionTranslations method to remove all localized texts from an existing promotion.

Parameters

Parameter Type/Description

sessionID

Required (string)

 

Output of the Login method.

promotionCode

Required (string)

 

The code corresponding to the promotion that you want to add translations to.

Response

Parameters Type/Description

Status

Boolean

  True or false.

Request

<?php

require ('PATH_TO_AUTH');

// Promotion code corresponding to the promotion you want to remove translations from
$promotionCode = '';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'deletePromotionTranslations',
'params' => array($sessionID, $promotionCode)
);
var_dump (callRPC($jsonRpcRequest, $host));

 

Retrieve product groups

Overview

Use the getProductGroups method to extract information about the product groups 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.

Response

Parameters Type/Description

ProductGroup

Array of objects

Request

 <?php

require ('PATH_TO_AUTH');

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getProductGroups',
'params' => array($sessionID)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));

?>

Generate SKU schema

Overview

Use the getSchema method to create a new SKU schema and define the combination criteria. The SKU number is a unique combination of Product ID (Product Code) plus all or minimum one of the following:

  • Currencies
  • Volume Discounts
  • Purchase Types
  • Pricing Options

Request Parameters

Parameters Required Type/Description
productCode Required String.  Product code as available in the Merchant Control Panel.
currencies Required String.
purchaseTypes Required String. The type of purchase applicable to the product: NEW_PRODUCT, RENEWAL, TRIAL, UPGRADE.
pricingConfigurationCodes Required  
                               code Required  
                               volumeDiscounts Required  
                               optionGroups Required  

Request Example

<?php

require ('PATH_TO_AUTH');

$inputSchema = new \stdClass();
$inputSchema->Products = [];
$inputSchema->Products[0] = new \stdClass();
$inputSchema->Products[0]->Code = '6B3CB17DDA_COPY1';
$inputSchema->Products[0]->Currencies = ['USD', 'EUR', 'GBP', 'BGN'];
$inputSchema->Products[0]->PurchaseTypes = ['NEW_PRODUCT', 'RENEWAL'];
$inputSchema->Products[0]->PricingConfigurationCodes = [];
$inputSchema->Products[0]->PricingConfigurationCodes[0] = new \stdClass();
$inputSchema->Products[0]->PricingConfigurationCodes[0]->Code = 'E684EC99B0';
$inputSchema->Products[0]->PricingConfigurationCodes[0]->VolumeDiscounts = [[1, 3], [4, 7]];
$inputSchema->Products[0]->PricingConfigurationCodes[0]->OptionGroups = [];
$inputSchema->Products[0]->PricingConfigurationCodes[0]->OptionGroups[0] = new \stdClass();
$inputSchema->Products[0]->PricingConfigurationCodes[0]->OptionGroups[0]->Code = 'GRUP_1';

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

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

Response Parameters

Parameters Type/Description
productCode Product code as available in the Merchant Control Panel.
pricingConfigurationCode  
productSku Empty when the list is generated by the platform and with unique values (per vendor) for each line of the file.
currency If currency is not selected to be included in the list (empty or null value) the the API defaults to "ANY". If currency is selected as an element of the SKU list creation, then it will be included - minimum one currency.
fromQty

The minimum value of the intervals set at product level for the specific Pricing configuration (volume discounts). In case volume discounts are not defined, the default value will be '1'.

toQty

The maximum value of the intervals set at product level for the specific Pricing configuration (volume discounts). In case volume discounts are not defined, the default value will be '99999'.

 

The intervals will be defined in the SKU list (at creation and upload) considering the product settings. In case intervals that are not defined in the Control Panel are included in the request, the request will return an error. 

'Expand quantities' should consider distinct SKUs for each qty of the interval. (optional)

purchaseType Purchase types will have one or multiple of the following values: 'NEW_PRODUCT', 'RENEWAL', TRIAL', 'UPGRADE' - limited to what is defined at product level.
pricingOptionGroups

Can be multiple and each of them will have the GroupCode and for each pricing options group:

pricingOptions

Can be multiple and will contain 'Name' and 'Value' as output, the only valid input is the option group code.

 

Response Example

array(1) {
  [0] =>
  class stdClass#7 (2) {
    public $ProductCode =>
    string(16) "6B3CB17DDA_COPY1"
    public $SkuPricingOptions =>
    array(1) {
      [0] =>
      class stdClass#8 (3) {
        public $Code =>
        string(10) "E684EC99B0"
        public $Details =>
        array(64) {
          [0] =>
          class stdClass#9 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#10 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#11 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [1] =>
          class stdClass#12 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#13 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#14 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [2] =>
          class stdClass#15 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#16 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#17 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [3] =>
          class stdClass#18 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#19 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#20 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [4] =>
          class stdClass#21 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#22 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#23 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [5] =>
          class stdClass#24 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#25 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#26 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [6] =>
          class stdClass#27 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#28 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#29 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [7] =>
          class stdClass#30 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#31 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#32 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [8] =>
          class stdClass#33 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#34 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#35 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [9] =>
          class stdClass#36 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#37 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#38 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [10] =>
          class stdClass#39 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#40 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#41 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [11] =>
          class stdClass#42 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#43 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#44 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [12] =>
          class stdClass#45 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#46 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#47 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [13] =>
          class stdClass#48 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#49 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#50 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [14] =>
          class stdClass#51 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#52 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#53 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [15] =>
          class stdClass#54 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "USD"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#55 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#56 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [16] =>
          class stdClass#57 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#58 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#59 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [17] =>
          class stdClass#60 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#61 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#62 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [18] =>
          class stdClass#63 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#64 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#65 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [19] =>
          class stdClass#66 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#67 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#68 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [20] =>
          class stdClass#69 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#70 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#71 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [21] =>
          class stdClass#72 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#73 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#74 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [22] =>
          class stdClass#75 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#76 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#77 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [23] =>
          class stdClass#78 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#79 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#80 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [24] =>
          class stdClass#81 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#82 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#83 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [25] =>
          class stdClass#84 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#85 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#86 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [26] =>
          class stdClass#87 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#88 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#89 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [27] =>
          class stdClass#90 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#91 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#92 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [28] =>
          class stdClass#93 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#94 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#95 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [29] =>
          class stdClass#96 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#97 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#98 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [30] =>
          class stdClass#99 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#100 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#101 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [31] =>
          class stdClass#102 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "EUR"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#103 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#104 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [32] =>
          class stdClass#105 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#106 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#107 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [33] =>
          class stdClass#108 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#109 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#110 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [34] =>
          class stdClass#111 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#112 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#113 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [35] =>
          class stdClass#114 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#115 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#116 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [36] =>
          class stdClass#117 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#118 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#119 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [37] =>
          class stdClass#120 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#121 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#122 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [38] =>
          class stdClass#123 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#124 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#125 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [39] =>
          class stdClass#126 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#127 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#128 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [40] =>
          class stdClass#129 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#130 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#131 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [41] =>
          class stdClass#132 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#133 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#134 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [42] =>
          class stdClass#135 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#136 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#137 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [43] =>
          class stdClass#138 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#139 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#140 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [44] =>
          class stdClass#141 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#142 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#143 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [45] =>
          class stdClass#144 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#145 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#146 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [46] =>
          class stdClass#147 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#148 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#149 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [47] =>
          class stdClass#150 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "GBP"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#151 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#152 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [48] =>
          class stdClass#153 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#154 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#155 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [49] =>
          class stdClass#156 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#157 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#158 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [50] =>
          class stdClass#159 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#160 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#161 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [51] =>
          class stdClass#162 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#163 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#164 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [52] =>
          class stdClass#165 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#166 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#167 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [53] =>
          class stdClass#168 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#169 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#170 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [54] =>
          class stdClass#171 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#172 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#173 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [55] =>
          class stdClass#174 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(1)
            public $ToQty =>
            int(3)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#175 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#176 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [56] =>
          class stdClass#177 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#178 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#179 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [57] =>
          class stdClass#180 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#181 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#182 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [58] =>
          class stdClass#183 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#184 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#185 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [59] =>
          class stdClass#186 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(11) "NEW_PRODUCT"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#187 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#188 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
          [60] =>
          class stdClass#189 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#190 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#191 (2) {
                    public $Name =>
                    string(13) "option name 1"
                    public $Value =>
                    string(13) "option_code_1"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrlXauuZOojh8cww=="
          }
          [61] =>
          class stdClass#192 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#193 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#194 (2) {
                    public $Name =>
                    string(13) "option name 2"
                    public $Value =>
                    string(13) "option_code_2"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrmXauuZOojjccxw=="
          }
          [62] =>
          class stdClass#195 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#196 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#197 (2) {
                    public $Name =>
                    string(13) "option name 3"
                    public $Value =>
                    string(13) "option_code_3"
                  }
                }
              }
            }
            public $Options =>
            string(76) "eJwBLADT/6G10uOW07exk6mNk7KvrpaSc4l1lbXToqi5sriTcbOXseWu3ZGrnXauuZOojk8cyw=="
          }
          [63] =>
          class stdClass#198 (7) {
            public $ProductSKU =>
            string(0) ""
            public $Currency =>
            string(3) "BGN"
            public $FromQty =>
            int(4)
            public $ToQty =>
            int(7)
            public $PurchaseType =>
            string(7) "RENEWAL"
            public $Groups =>
            array(1) {
              [0] =>
              class stdClass#199 (2) {
                public $GroupCode =>
                string(6) "GRUP_1"
                public $Options =>
                array(1) {
                  [0] =>
                  class stdClass#200 (2) {
                    public $Name =>
                    string(4) "NONE"
                    public $Value =>
                    string(4) "NONE"
                  }
                }
              }
            }
            public $Options =>
            string(0) ""
          }
        }
        public $Errors =>
        array(0) {
        }
      }
    }
  }
}

 

Cross-sell

Overview

The object below is returned directly or within a successful response from the following API requests:

            Retrieve a product’s cross-sell campaigns                                                        Retrieve cross-sell campaigns

Cross-sell object

Parameter Type/Description

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

 

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 of the product price.

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.

 

IPN code samples

Use the code samples below to verify the validity of the IPN trigger.

PHP

<?php
/* Instant Payment Notification */

/* Return HTTP 200 response for initial IPN endpoint setup */
if ($_SERVER['REQUEST_METHOD'] === 'GET'){
    http_response_code(200);
    return;
}

/*
 * possible values: sha256, sha3-256
 * sha3-256 only for php version > 7.1
 */
$usedHashAlgorithm = 'sha256';

/* pass to compute HASH. Retrieve your secret key by accessing https://secure.2checkout.com/cpanel/webhooks_api.php */
$secretKey = "AABBCCDDEEFF";

function serializeArray($array) {
    $ret_value = "";

    foreach ($array as $key => $val) {
        /* skip signature hashes from computed hash */
        if (in_array($key , ['HASH', 'SIGNATURE_SHA2_256', 'SIGNATURE_SHA3_256'], true)) {
            continue;
        }

        if (is_array($val)) {
            $ret_value .= serializeArray($val);
        } else {
            $ret_value .= strlen($val) . $val;
        }
    }

    return $ret_value;
}

$signature_sha2   = isset($_POST["SIGNATURE_SHA2_256"]) ? $_POST["SIGNATURE_SHA2_256"] : '';    /* sha256 HASH received */
$signature_sha3   = isset($_POST["SIGNATURE_SHA3_256"]) ? $_POST["SIGNATURE_SHA3_256"] : '';    /* sha3-256 HASH received */

$stringForHash = serializeArray($_POST);
$computedHash = hash_hmac($usedHashAlgorithm, $stringForHash, $secretKey);

$validHash = false;
switch ($usedHashAlgorithm) {
    case "sha256":
        if ($computedHash == $signature_sha2) {
            $validHash = true;
        }
        break;
    case "sha3-256":
        if ($computedHash == $signature_sha3) {
            $validHash = true;
        }
        break;
}


if ($validHash === false) {
    /* hash verification failed */
    
    http_response_code(400);
    mail("your_address@example.com","BAD IPN Signature", print_r($_POST, TRUE),"");
    return;
}

// hash is valid. We proceed with success response
$responseDate = date('YmdHis');

$arrayForResponseHash = [
    $_POST["IPN_PID"][0],
    $_POST["IPN_PNAME"][0],
    $_POST["IPN_DATE"],
    $responseDate
];
$stringForResponseHash = serializeArray($arrayForResponseHash);

$responseString = '';
switch ($usedHashAlgorithm) {
    case "sha256":
        $responseHash = hash_hmac('sha256', $stringForResponseHash, $secretKey);
        $responseString = '<sig algo="sha256" date="' . $responseDate . '">' . $responseHash . '</sig>';
        break;
    case "sha3-256":
        $responseHash = hash_hmac('sha3-256', $stringForResponseHash, $secretKey);
        $responseString = '<sig algo="sha3-256" date="' . $responseDate . '">' . $responseHash . '</sig>';
        break;
}

http_response_code(200);
echo $responseString;

Java

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.servlet.http.HttpServletRequest;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.*;

@RestController
@RequestMapping("/ipn")
public class IpnController {
    // retrieve your secret key by accessing https://secure.2checkout.com/cpanel/webhooks_api.php
    private String secretKey = "yoursecretkey";
    // sha256; for sha3-256, use HmacSHA3-256
    private String algorithm = "HmacSHA256";
    // sha256; for sha3-256, use SIGNATURE_SHA3_256
    private String signatureField = "SIGNATURE_SHA2_256";
    // sha256; for sha3-256, use sha3-256
    private String algoResponseString = "sha256";

    @RequestMapping(method = RequestMethod.POST)
    public String handleRequest(HttpServletRequest request) {

        Map<String, String[]> parameters = request.getParameterMap();

        String receivedRequestSignature = request.getParameter(signatureField);

        String calculatedRequestSignature = calculateRequestSignature(parameters);

        String responseDate = getResponseDate();

        String responseSignature = calculateResponseSignature(request, parameters, responseDate);

        if(calculatedRequestSignature.equals(receivedRequestSignature)) {
            String response = "Verified OK! <sig algo=\"" + algoResponseString + "\" date=\"" + responseDate + "\">" + responseSignature + "</sig>";
            handleIpn(parameters);
            return response;
        } else {
            // LOG OR EMAIL THIS OCCURRENCE
            return "Bad request!";
        }
    }

    private String calculateResponseSignature(HttpServletRequest request, Map<String, String[]> parameters, String responseDate) {
        String responseStringToSign = parameters.get("IPN_PID")[0].length() + parameters.get("IPN_PID")[0] +
                    parameters.get("IPN_PNAME")[0].length() + parameters.get("IPN_PNAME")[0] +
                    request.getParameter("IPN_DATE").length() + request.getParameter("IPN_DATE") +
                    responseDate.length() + responseDate;
        return hmacSha(responseStringToSign);
    }

    private String getResponseDate() {
        String pattern = "yyyyMMddHHmmss";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        return simpleDateFormat.format(new Date());
    }

    private String calculateRequestSignature(Map<String, String[]> parameters) {
        String requestStringToVerify = "";
        for (Map.Entry<String, String[]> entry : parameters.entrySet()) {
            if (List.of("HASH", "SIGNATURE_SHA2_256", "SIGNATURE_SHA3_256").contains(entry.getKey())) continue;
            // convert parameter values array to ArrayList to be able to use streams
            ArrayList<String> valueList = new ArrayList<String>(Arrays.asList(entry.getValue()));
            // append to request string each length and value
            requestStringToVerify = valueList
                    .stream()
                    .reduce(requestStringToVerify,
                            (partialResult, value)
                                    -> partialResult + (value == null ? 0 : value.getBytes().length + value));
        }
        return hmacSha(requestStringToVerify);
    }

    private void handleIpn(Map<String, String[]> parameters) {
        // INSERT YOUR HANDLING CODE HERE
    }

    private String hmacSha(String stringForHash) {
        SecretKeySpec key = new SecretKeySpec((secretKey).getBytes(), algorithm);
        try {
            Mac mac = Mac.getInstance(algorithm);
            mac.init(key);
            byte[] bytes = mac.doFinal(stringForHash.getBytes());
            return toHexString(bytes);
        } catch (NoSuchAlgorithmException | InvalidKeyException e) {
            e.printStackTrace();
            return null;
        }
    }

    private String toHexString(byte[] bytes) {
        Formatter form = new Formatter();
        String result;

        for (byte b : bytes) {
            form.format("%02x", b);
        }
        result = form.toString();
        form.close();
        return result;
    }
}

Perl

#!/usr/bin/perl
# Simple IPN implementation for 2Checkout
# PERL version
use strict;
use CGI;
use Digest::SHA qw(hmac_sha256_hex);

# modify your settings here

# pass to compute HASH. Retrieve your secret key by accessing https://secure.2checkout.com/cpanel/webhooks_api.php
my $myKey='AABBCCDDEEFF';

# / end modifications area

my $q = new CGI;
my @name = $q->param;
print "Content-type: text/html\n\n";
my $in_sha256='';
my $first_product = '';
my $first_pid = '';
# Main loop
foreach my $par (@name) {
  next if ($par=~/HASH|SIGNATURE_SHA2_256|SIGNATURE_SHA3_256/i);
      if ($q->param($par) ne '') { #parameter not empty
        my @myList = $q->param($par);
          if (scalar(@myList)) { #multi valued
            foreach my $el (@myList) {
              $in_sha256.=length($el).$el;
          if ($par eq "IPN_PNAME[]") { $first_product = $myList[0]; }
          if ($par eq "IPN_PID[]") { $first_pid = $myList[0]; }
            }
          } else { #single valued
            $in_sha256.=length($q->param($par)).$q->param($par);
          }
      } else { #empty parameter
        $in_sha256.='0';
      }
}

my $mySha = $q->param('SIGNATURE_SHA2_256');
my $shaVerify = hmac_sha256_hex($in_sha256, $myKey);
my $response='';
if ($mySha=~/^$shaVerify$/i) { # ok
    # The notification is genuine / verified
    # Write your own code here to insert the data into a database or email it in a specified format
    # The code below will confirm the request
  $response = length($first_pid).$first_pid.length($first_product).$first_product.length($q->param("IPN_DATE")).$q->param("IPN_DATE");
  my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
  my $now = (1900+$year).sprintf("%02d", $mon+1).sprintf("%02d", $mday).sprintf("%02d", $hour).sprintf("%02d", $min).sprintf("%02d", $sec);
  $response.=length($now).$now;
  my $shaResponse = hmac_sha256_hex($response, $myKey);
  print '<sig algo="sha256" date="' . $now . '">' . $shaResponse . '</sig>';
  print "\n";
} else { # not ok
  print '<EPAYMENT>Error. Cannot verify signature.</EPAYMENT>';
  print "\n";
}

C# 

using System;    
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;

namespace VerifoneIPNSample
{
    public class IpnSignatureHandler
    {
        public string calculateSignature(
            IEnumerable<KeyValuePair<string, string>> requestPayloadValues,
            string secretKey,
            string currentDate
            )
        {
            int size = 0;
            string hash = string.Empty;
            UTF8Encoding encoding = new UTF8Encoding();
            System.Text.StringBuilder PlainDataToHash = new System.Text.StringBuilder();
            var res = requestPayloadValues.GetEnumerator();

            while (res.MoveNext())
            {
                switch (res.Current.Key)
                {
                    case "IPN_PID[]":
                        size = res.Current.Value.Length; 
                                        
                        PlainDataToHash.Append(size);
                        PlainDataToHash.Append(res.Current.Value);
                        break; 
                    case "IPN_PNAME[]":
                        size = res.Current.Value.Length; 
                                        
                        PlainDataToHash.Append(size);
                        PlainDataToHash.Append(res.Current.Value);
                        break; 
                    case "IPN_DATE":
                        size = res.Current.Value.Length; 
                                        
                        PlainDataToHash.Append(size);
                        PlainDataToHash.Append(res.Current.Value);
                        break; 
                }
            }
            size = currentDate.Length;
            PlainDataToHash.Append(size);
            PlainDataToHash.Append(currentDate);
            
            Console.WriteLine(PlainDataToHash);

            string pass = secretKey;
            byte[] passBytes = encoding.GetBytes(pass);

            // sha256; for sha3-256, replace HMACSHA256 with HMACSHA3_256
            HMACSHA256 hmacSha = new HMACSHA256(passBytes);
            string HashData = PlainDataToHash.ToString();
            
            byte[] baseStringForHashBytes = encoding.GetBytes(HashData);
            byte[] hashBytes = hmacSha.ComputeHash(baseStringForHashBytes);
            
            hash = ByteToString(hashBytes);

            return hash;
        }

        private static string ByteToString(byte[] buff)
        {
            string sbinary = "";
            for (int i = 0; i < buff.Length; i++)
            {
                sbinary += buff[i].ToString("x2"); // hex format
            }
            return (sbinary);
        }

        public string generateTag(
            IEnumerable<KeyValuePair<string, string>> requestPayloadValues,
            string secretKey
            )
        {
            var now = DateTime.Now.ToString("yyyyMMddHHmmss");
            var responseHash = calculateSignature(requestPayloadValues, secretKey, now);

            // sha256; for sha3-256, replace algo=\"sha256\" with algo=\"sha3-256\"
             return $"<sig algo=\"sha256\" date=\"{now}\">{responseHash}</sig>";
        }
    }
}

C# - IPN Signature Handler Test Example  

using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace VerifoneIPNSample.Tests
{
    [TestClass()]
    public class IpnSignatureHandlerTests
    {
        [TestMethod()]
        public void TestCalculateSignature() {
            List<KeyValuePair<string, string>> requestPayloadValues = new List<KeyValuePair<string, string>>()
            {
                new KeyValuePair<string, string>("IPN_PID[]", "1"),
                new KeyValuePair<string, string>("IPN_PNAME[]", "Software program"),
                new KeyValuePair<string, string>("IPN_DATE", "20050303123434"),
            };

            string testedDate = "20050303123434";
            string secretKey = "test";
            
            IpnSignatureHandler ipnHandler = new IpnSignatureHandler();

            var responseHash = ipnHandler.calculateSignature(requestPayloadValues, secretKey, testedDate);
            
            Console.WriteLine(responseHash);

            // sha256; for sha3-256, compare with "2726fe88a5b2bf7907034053124964eb614b46b929acc804034f7071121a4efb"
            Assert.AreEqual(responseHash, "7efee0c4b7b129f9b96ab279366c1ded92578d947596fb639060d1796ac431b3");
        }
    }
}

Retrieve options

Overview

Use the getProductUpgradeOptions method to retrieve the possible upgrade options for a subscription.

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.

subscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

Response

Parameters Type/Description

Subscription upgrade

Array of objects

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';

try {
    $upgradeOptions = $client->getProductUpgradeOptions($sessionID, $subscriptionReference);
}
catch (SoapFault $e) {
    echo "upgradeOptions: " . $e->getMessage();
    exit;
}
var_dump("upgradeOptions", $upgradeOptions);

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