Skip to main content

Hyperlinks for order, customer and subscription details pages

Overview

Get access to information on specific orders, customers and subscriptions by easily building links to the Order, Customer and Subscription details pages in the Control Panel.

Availability

This feature is available to all 2Checkout accounts.

Requirements

The Control Panel user accounts accessing information on orders, customers and subscriptions require the following role privileges:

  • eStore order search
  • Customers
  • Subscription Management

To edit user roles, go to Account settings -> Manage user access and click View roles. Edit the user role accordingly and click Save role.

Link parameters

Two parameters are key to building specific links. Both parameters are case sensitive.

  • refno - used to build links to the Order details and Subscriptions details pages.
  • avangateid - used to build links to the Customer details pages.

Order details page

Orders have unique identifiers associated by default. Use these identifiers combined with the refno parameter to build Order details page links.

Example

A link to the Order details page of an order with the 1234567 reference number:

https://secure.2checkout.com/cpanel/order_info.php?refno=1234567

Note: Order reference identifiers are integer values.

Refund orders

Refund orders share the same 2Checkout identifier as the original order. When building links for Refund order details page, you need to add the order status to the URL, together with the refno parameter. You can add the order status via the status parameter (case sensitive).

Example

https://secure.2checkout.com/cpanel/order_info.php?refno=1234567&status=refund

Subscription details page

Subscriptions also have unique identifiers associated by default. Use these identifiers combined with the refno parameter to build Subscription details page links.

Example

A link to the Subscription details page of a subscription with the 0A001B23C5 reference number:

https://secure.2checkout.com/cpanel/license_info.php?refno=0A001B23C5

Customer details page link

Customer accounts have unique 2Checkout identifiers. Use these identifiers together with the avangateid parameter to build links for Customer details pages.

Note: Use the internal, system-generated Avangate customer reference, and not the External customer reference which you control.

Example

A link to the Customer details page of a customer with the id 102407513:

https://secure.2checkout.com/cpanel/customer_details.php?avangateid=102407513

Promotion

Overview

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

Create promotion                          Update promotion                            Retrieve a promotion                            Search promotions

Promotion object

Parameters Type/Description

CouponCodes

Array of strings

 

Array of coupon/voucher codes when Coupon / Voucher type is Multiple. Otherwise, empty array.

ChannelType

String

 

Possible values:

  • ECOMMERCE
  • CHANNEL_MANAGER
  • ALL

CouponType

String

 

Possible values:

  • SINGLE
  • MULTIPLE

DiscountType

String

 

Possible values:

  • FIXED
  • PERCENT

Type

String

 

REGULAR

Discount

Int

 

The value of the discount. Example, for a $30 USD discount 2Checkout returns the value 30 and for a 25% price cut, 2Checkout returns 25.

Products

Array

 

Array of product codes for the products impacted by the promotion.

Name

String

 

Promotion name.

Description

String

 

Promotion description.

StartDate

String

 

Starting date. The date when you set the promotion to start. Is NULL for promotions that start immediately after they're created.

EndDate

String

 

Ending date. The date when you set the promotion to end. Is NULL for promotions that you want active indefinitely.

MaximumOrdersNumber

Int

 

When the maximum number of orders is reached the promotion stops. Can be NULL if you want the promotion to apply to an unlimited number of orders.

MaximumQuantity

Int

 

Discount only applies to a specific number of product, smaller than the maximum quantity you defined. Can be NULL if you want the promotion to apply to an unlimited number units. Any extra quantity added to the cart will be sold at full price.

InstantDiscount

Boolean

 

Selecting the instant discount option will auto-apply the discount for ALL the selected products for all shoppers, without the need to enter the discount coupon.

Coupon

String

 

The promotion/voucher for which you are extracting the information.

DiscountLabel

String

 

Discounts can be set as a percentage from the product price or as a fixed amount in the chosen currency.

Enabled

Boolean

 

Can be TRUE if promotion is enabled, or FALSE if otherwise.

Currency

String

 

Currency code available for the default currency of FIXED promotions. Missing for PERCENT promotions.

Code

String

 

Unique, system-generated identifier 2Checkout associates with promotion campaigns.

PriceThreshold

Object

 

Limits discount use only when total order value (taxes included) exceeds the threshold you configure.

 

Amount

 Decimal

 

 

The minimum threshold you defined for the default currency.

 

Currency

String

 

 

Currency code available for the default currency of custom threshold settings.

Renew a subscription

Overview

Renew a subscription in the Avangate system on-demand, controlling the number of days, price and currency of the extension. Use the renewSubscription method renew a subscription.

Parameters

Parameters

Type/Description

sessionID

Required (string)

 

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

SubscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

 

Avangate charges customers using the payment data attached to subscriptions. In the case of credit/debit cards, if customers update their payment information in myAccount or if you update these details on behalf of your subscribers, the Avangate system uses the latest card info provided to charge subscription renewals.

Days

Optional (int)

 

The number of days the Avangate system extends the lifetime of the subscription.

Price

Optional (double)

 

The price that Avangate charges the customer for the renewal. This is the Net price.

Currency

Optional  (string)

 

The currency associated to the renewal price - ISO 4217 code.

Response

Boolean

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

Request


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

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

Retrieve PayPal redirect URL

Overview

Use the getPayPalExpressCheckoutRedirectURL method to retrieve the RedirectURL by sending an Order object with PAYPAL_EXPRESS payment method.

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.

Order

Required (Object)

 

Object designed to collect all data necessary for an order, including billing, product/subscription plan and payment details.

 

Use PAYPAL_EXPRESS as the payment method.

Response

PayPalExpressCheckoutRedirectURL

String

Request


<?php
//Use the following 2 scripts:
//The place_order_api_soap_paypal_express.php
// And the place_order_api_soap_paypal_express_response that you can find below

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

function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
$merchantCode = "MERCHANT_CODE";// your account's merchant code available in the 'System settings' area of the cPanel: https://secure.2checkout.com/cpanel/account_settings.php
$key = "SECRET_KEY";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.2checkout.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);
try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}
catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}
$NewOrder = new stdClass();
$NewOrder->Language = 'fr';
//$NewOrder->LocalTime = date('Y-m-d G:i:s');
$NewOrder->CustomerReference = 'APITEST';//uniqid('TESTCUSTOMER:');
$Product = new stdClass();
$Product->Code = 'my_subscription_1';
$Product->Quantity = 1;
$NewOrder->Items[] = $Product;
$NewOrder->Currency = 'EUR';
$Payment = new stdClass();
$Payment->Type = 'PAYPAL_EXPRESS';
$Payment->Currency = 'EUR';
$Payment->CustomerIP = '91.220.121.21';
$PayPalExpress = new stdClass();
$PayPalExpress->Email='customer@email.com';
$PayPalExpress->ReturnURL = 'http://' . $_SERVER['HTTP_HOST'] . '/api/place_order_api_soap_paypal_express_response.php';
$PayPalExpress->CancelURL = 'http://' . $_SERVER['HTTP_HOST'] . '/api/place_order_api_soap_paypal_express_response.php' . '?cancel=true';
$Payment->PaymentMethod = $PayPalExpress;    
$NewOrder->PaymentDetails = $Payment;
// Call the method for retrieving Express Checkout redirect URL
$redirectUrl = $client->getPayPalExpressCheckoutRedirectURL($sessionID,$NewOrder);
header('Location:' . $redirectUrl);
die();

// This is the start of the second script place_order_api_soap_paypal_express_response.php

<?php
var_dump($_REQUEST);
if (isset($_GET['billingDetails'])) {
    $billingDetails = base64_decode($_GET['billingDetails']);
    parse_str($billingDetails, $billingDetailsArray);
}
if (isset($_GET['deliveryDetails'])) {
    $deliveryDetails = base64_decode($_GET['deliveryDetails']);
    parse_str($deliveryDetails, $deliveryDetailsArray);
}
if (isset($_GET['token'])) {
    $token = $_GET['token'];
}
if (!empty($_GET['cancel']) && $_GET['cancel'] == true) {
  echo 'canceled';
  die();
} else {
  echo 'success!';
}
/*************************************************************/
$host   = "https://api.2checkout.com";
$client = new SoapClient($host . "/soap/3.0/?wsdl", array(
    'location' => $host . "/soap/3.0/",
    "stream_context" => stream_context_create(array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    ))
));

function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
$merchantCode = "AVLRNG";// your account's merchant code available in the 'System settings' area of the cPanel: https://secure.2checkout.com/cpanel/account_settings.php
$key = "1sGC*[c_T0)J9(k+]6Kw";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.2checkout.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);
try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}
catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}
$NewOrder = new stdClass();
$NewOrder->Language = 'fr';
$NewOrder->CustomerReference = 'APITEST';//uniqid('TESTCUSTOMER:');
$Product = new stdClass();
$Product->Code = 'my_subscription_1';
$Product->Quantity = 1;
$NewOrder->Items[] = $Product;
$Billing = new stdClass();
$Billing->Country = empty($billingDetailsArray['Country']) ? '' : $billingDetailsArray['Country'];
$Billing->City = empty($billingDetailsArray['City']) ? '' : $billingDetailsArray['City'];
$Billing->State = empty($billingDetailsArray['State']) ? '' : $billingDetailsArray['State'];
$Billing->PostalCode = empty($billingDetailsArray['PostalCode']) ? '' : $billingDetailsArray['PostalCode'];
$Billing->Email = empty($billingDetailsArray['Email']) ? '' : $billingDetailsArray['Email'];
$Billing->FirstName = empty($billingDetailsArray['FirstName']) ? '' : $billingDetailsArray['FirstName'];
$Billing->LastName = empty($billingDetailsArray['LastName']) ? '' : $billingDetailsArray['LastName'];
$Billing->Address = empty($billingDetailsArray['Address']) ? '' : $billingDetailsArray['Address'];
$NewOrder->BillingDetails = $Billing;
$Delivery = new stdClass();
$Delivery->Country = empty($deliveryDetailsArray['Country']) ? '' : $deliveryDetailsArray['Country'];
$Delivery->City = empty($deliveryDetailsArray['City']) ? '' : $deliveryDetailsArray['City'];
$Delivery->State = empty($deliveryDetailsArray['State']) ? '' : $deliveryDetailsArray['State'];
$Delivery->FirstName = empty($deliveryDetailsArray['FirstName']) ? '' : $deliveryDetailsArray['FirstName'];
$Delivery->LastName = empty($deliveryDetailsArray['LastName']) ? '' : $deliveryDetailsArray['LastName'];
$Delivery->Address = empty($deliveryDetailsArray['Address']) ? '' : $deliveryDetailsArray['Address'];
$Delivery->PostalCode = empty($deliveryDetailsArray['PostalCode']) ? '' : $deliveryDetailsArray['PostalCode'];
$NewOrder->DeliveryDetails = $Delivery;
$Payment = new stdClass();
$Payment->Type = 'PAYPAL_EXPRESS';
$Payment->Currency = 'EUR'; // for sku
$Payment->CustomerIP = '91.220.121.21';
$PayPal = new stdClass();
$PayPal->Email='customer@email.com';
$PayPal->Token = $token;
$PayPal->ReturnURL = 'http://' . $_SERVER['HTTP_HOST'] . '/api/place_order_api_soap_paypal_express_response.php1';
$PayPal->CancelURL = 'http://' . $_SERVER['HTTP_HOST'] . '/api/place_order_api_soap_paypal_express_response.php1' . '?cancel=true';
$Payment->PaymentMethod = $PayPal;
$NewOrder->PaymentDetails = $Payment;
$OrderField = new stdClass();
$OrderField->Code = 'ED5310';
$OrderField->Value = 'Value1';

// Call the method for placing the order
$APIOrderFullInfo = $client->placeOrder($sessionID, $NewOrder);
var_dump($APIOrderFullInfo);

Remove products from a promotion

Overview

Parameters

Response

Request

<?php 

class Client
{
    protected static $merchantCode;
    protected static $loginDate;
    protected static $hash;
    protected static $baseUrl;
    protected static $callCount = 0;
    protected static $sessionId = '';

    protected static $client;

    public static function setCredentials($code, $key)
    {
        static::$merchantCode = $code;
        static::$loginDate = gmdate('Y-m-d H:i:s');
        static::$hash = hash_hmac('md5', strlen($code) . $code . strlen(static::$loginDate) . static::$loginDate, $key);
        static::$sessionId = static::login();
    }

    public static function setBaseUrl($url)
    {
        static::$baseUrl = $url;
    }

    public static function login()
    {
        $client = static::getClient();
        return $client->login(static::$merchantCode, static::$loginDate, static::$hash);
    }

    public static function __callStatic($name, $arguments = array())
    {
        $client = static::getClient();

        array_unshift($arguments, static::$sessionId);
        $response = call_user_func_array(array($client, $name), $arguments);

        return $response;
    }

    protected static function getClient()
    {
        $opts = array(
            'http'=> ['user_agent' => 'PHPSoapClient'],
            'ssl' => [
                'verify_peer' => false,
                'verify_peer_name' => false,
            ],
        );

        if (null === static::$client) {
            static::$client = new \SoapClient(static::$baseUrl . '?wsdl', [
                'location' => static::$baseUrl,
                'cache_wsdl' => WSDL_CACHE_NONE,
                'stream_context' => stream_context_create($opts),
            ]);
        }

        return static::$client;
    }
}

Client::setBaseUrl('https://api.avangate.com/soap/3.1/');
Client::setCredentials('YOUR_MERCHANT_CODE', 'YOUR_SECRET_KEY');
Client::login();

// Define first product to remove from proomotion
$products1 = new stdClass;
$products1->Code = 'YOUR_PRODUCT_CODE';
$products1->PricingConfigurationCode = 'YOUR_PRICING_CONFIGURATION_CODE';
$products1->PricingOptionCodes = ['code1','code2','code3'];

// Define second product to remove from promotion
$products2 = new stdClass;
$products2->Code = 'YOUR_PRODUCT_CODE2';
$products2->PricingConfigurationCode = 'YOUR_PRICING_CONFIGURATION_CODE2';

$promotionProducts = [$products1, products2]; // array of product objects to be removed from the promotion

// Retrieve promotion details
$promotionCode = 'YOUR_PROMOTION_CODE'; // code of the promotion that you want to remove products from
$response = Client::deletePromotionProducts ($promotionCode,$promotionProducts);
var_dump($response);

Copy payment info

Overview

Copy card-on-file data available in the 2Checkout system from a source subscription to an imported target subscription. 2Checkout uses the existing payment information to charge customers as a part of the recurring billing (renewal) process.

Use the copyPaymentInfo method.

Requirements

The imported target subscription and the source subscription must belong to the same customer. The 2Checkout system checks to make sure that the 2Checkout Customer Reference (internal identifier) coincides for the customer accounts associated to the target and source subscriptions.

Availability

Please contact 2Checkout directly if you wish to take advantage of this feature.

How does this method work?

  1. Customer A purchases Subscription A using a VISA credit card and you import Subscription B for the same customer with no data or with an AMEX card.
  2. When 2Checkout renews Subscription A, it charges Customer A using the VISA, while using the AMEX (if the data was provided) for Subscription B charges.
  3. When you copy the payment data from Subscription A to Subscription B, the 2Checkout system uses the VISA credit card to renew both subscriptions according with their respective recurring billing cycles. 2Checkout charges customers during the recurring billing process for the imported target subscription using the payment method they used to purchase the source 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.

TargetSubscriptionReference

Required (string)

 

The 2Checkout Subscription Reference of the imported target subscription, to which 2Checkout copies the payment on file data associated with the source subscription.

SubscriptionReference

Required (string)

 

The 2Checkout Subscription Reference of the source subscription whose attached payment on file data 2Checkout copies to the target subscription.

Response

Boolean

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

Request


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

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

 

Volume Discounts for Backup Media

Overview

   As of May 2024, 2Checkout no longer supports providing backup CD, DVD or USB drive delivery. Please ensure such products are disabled from your product catalogue.

Offer volume discounts to shoppers purchasing large quantities of products and associated backup media. This feature works in tandem with the functionality enabling you to offer Multiple Backup Media units in the same shopping cart for products with CDs/DVDs/USB drives created as a static discs (ISO image). 

Availability

All 2Checkout vendors currently offering backup CDs/DVDs/USBs to their shoppers.

Requirements

Backup media volume discounts work in conjunction with static (ISO images) CDs, DVDs and USB drives.

Use cases

Let's assume that you're offering Backup DVD A for Product A and Backup DVD B for Product B.

Product A is sold at $99.99 without volume discounts. However, you can still set up volume discounts for Backup DVD A.

Backup DVD A Quantity interval Discounted price per unit
1-20 $25
21-50 $20
51-100 $15
101-maximum $10

A customer buying 120 units of Product A will be charged $11,998.8, plus $1,200 for 120 Backup DVD A copies, instead of the full $3,000 at $25/unit.

Product B and Backup DVD B both have volume discounts defined.

Product B Quantity interval Discounted price per unit
1-30 $199.99
31-70 $159.99
71-100 $129.99
101-maximum $99.99

 

Backup DVD B Quantity interval Discounted price per unit
1-30 $25
31-70 $20
71-100 $15
101-maximum $10

In this case, a customer buying 101 copies of Product B will pay $10,098.99 plus $1010 for the 101 Backup DVD B units.

Set up backup media volume discounts

  1. Navigate to Fulfillment, under Setup.
  2. Select the Backup Media tab.
  3. Click the Product Name link to configure volume discounts each backup CD/DVD/USB drive.
  4. Start defining pricing intervals and the associated discounted prices in the Backup media volume discounts area. To add another interval,  make sure that the previously saved interval is not up to maximum (maximum number of units = 99999). The 2Checkout system automatically enters the last interval of the backup media volume discount configuration from the top quantity defined to maximum, while also copying the discounted price.
  5. Localize volume discounts. You can configure volume discounts for each currency active for your account. It's mandatory that you set the price for the default currency. Shoppers pay the costs configured for the default currency converted into currencies with no volume discount defined.
  6. Click Save to have the backup media volume discount come into effect. Click Restore to default to scrap any custom backup media volume discounts you introduced (any configured pricing options will be lost).

Aggregate backup media volume discounts

Offer discounted prices for bulk quantities of backup CDs/DVDs/USB drives with matching volume pricing configurations in scenarios in which shoppers add multiple products to the same cart. Essentially, provided that they share the same configuration, 2Checkout sums up the quantities of backup CDs/DVDs/USB drives shoppers add to cart, increasing the value of the incentive.

Enable/Disable aggregation of backup media volume discounts

To enable or disable aggregation of backup media volume discounts, make your way to Ordering options under Setup and check or uncheck the Aggregate backup media volume discounts option. Then scroll down and click the Save modifications button.

Requirements

The volume discount pricing configurations of backup media items configured for different products must match for aggregation of the number of backup CDs/DVDs/USB drives to take place.

For this example, let's consider Backup DVD A for Product A and Backup DVD B for Product B as mentioned above, and Product C and Backup DVD C.

Product C Quantity interval Discounted price per unit
1-30 $60
31-70 $50
71-100 $40
101-maximum $30

 

Backup DVD C Quantity interval Discounted price per unit
1-30 $25
31-70 $20
71-100 $15
101-maximum $10

As you can see, the quantity intervals and the prices of Backup DVD B and Backup DVD C match.

Let's assume that a customer places the following order:

Product A quantity Backup DVD A quantity Product B quantity Backup DVD B quantity Product C quantity Backup DVD C quantity
101 101 55 55 60 60
Total costs
$10,098.99 $1,010 $8,799.45 See below $3,000 See below
Backup media volume discount pricing configurations forBackup DVD B and Backup DVD do not match that of Backup DVD A in terms of intervals defined, so the number of Backup DVD A copies is not aggregated with that of Backup DVD B and Backup DVD.

Since backup media volume discount pricing configurations for Backup DVD B and Backup DVD C match, the 2Checkout system will add their respective quantities, and calculate the price for the total number of units, namely $115 * 10 = $1,150.

 

Generate instant subscriptions

Overview

You (merchant) can opt to create a subscription immediately after the order is placed, without having to wait for authorization. The benefit is that you can improve your customers’ experience by allowing them to use the subscription right away after placing the order.

Availability

Available for 2Checkout merchants using the subscription model (2Subscribe) or the reseller model (2Monetize).

To get this feature activated for your account, contact Merchant Support.

Requirements

Before you can apply this functionality to your products (it is only enabled at the product level), make sure these requirements are met:

1. The product fulfillment type is NOT “Fulfillment made by you”.

To change this setting follow these steps:

  • Log in to your Merchant Control Panel account.
  • Navigate to Setup → Products.
  • Click on a product from your catalog.

Create subscriptions instantly_1.png

  • On the Edit Product Information page, click on the Fulfillment tab.

Create subscriptions instantly_2.png

 

  • On the Product fulfillment page, select the Fulfillment type. Make sure “Fulfillment made by you” is NOT selected.

Create subscriptions instantly_3.png

2. The product has the Generate subscription option set to Yes in the Renewal tab.

Create subscription instantly_7.png

Create a subscription immediately after an order is placed

Follow the steps below to create a subscription immediately after an order is placed:

  1. Log in to your Merchant Control Panel account.
  2. Navigate to Setup → Products.
  3. Select the product for which you want to enable this option and click on the Edit button, as shown in this image.

Create subscriptions instantly_1.png

4. On the Edit Product Information page, click on the Renewal tab.

5. Under Create subscription select the option Immediately after order is placed. To disable the feature, select the After order is approved and fulfillment is made option.

Create subscription instantly_8.png

Workflow

Create subscription instantly_6.png

When the order is placed and the subscription is created, the subscription start date will be set 2 months from the moment of purchase. Once the order is approved, the start date will be reset to the current date.

Once the subscription is pending activation, then:

  • The subscription cannot be paused
  • The subscription cannot be upgraded
  • The subscription cannot be renewed
  • The subscription cannot be aligned
  • The renewal type CAN be changed

The subscription will be disabled if:

  • The order status is REVERSED
  • The subscription has been in pending activation status for more than 1 month and the order has not been completed

A License Change Notification (LCN) is sent as soon as it is created, activated, or disabled.

Retrieve installments

Overview

Use the getInstallments method to retrieve information about the number of installments available for a specific selection of products/services.

Supported payment methods

Credit/Debit cards: local Visa and MasterCard cards in Brazil and Turkey.​

Request Parameters

Parameters Type/Description

sessionID

String / Required

 

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.

Order

Object / Required

 

An object designed to collect all data necessary for an order, including billing, product/subscription plan, and payment details.

Response Parameters

Parameters Type/Description

InstallmentsOption

Array of objects

 

Details below.

 

Number

Int

 

 

The number of installments.

 

Amount

Double

 

 

Standalone installment value. (Total order value/Number of installments)

 

Currency

String

 

 

Order currency.

Request Example


<?php
declare(strict_types=1);

class Configuration
{
    public const MERCHANT_CODE = '';
    public const MERCHANT_KEY = '';
    public const URL = 'http://api.avangate.local/soap/6.0';
    public const ACTION = 'getInstallments';
    public const ADDITIONAL_OPTIONS = null;
    //array or JSON
    public const PAYLOAD = <<<JSON
{
    "Amount" : 500,
    "Country": "BR",
    "Currency": "BRL",
    "FiscalCode" :"345.675.677-7",
    "EesToken": ["c49702ea-b0c5-4d39-9f5b-ba43ccf26785"]
}
JSON;
}

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

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

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

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

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

$client = new Client();
$result = $client->call();
var_dump($result);

Orders with installments

Overview

Avangate supports local Brazilian Visa, MasterCard and AMEX credit / debit cards limited to national purchases in the local currency BRL (Brazilian Real)

Requirements

  1. Installments are available only for:
    • Brazilian customers
    • Local Visa, MasterCard or AMEX cards
    • Non-recurring transactions
  2. Minimum installment threshold is 5 BRL. Maximum number of installments is 6.
  3. Mandatory information for payments also includes shopper phone number and  Fiscal Code (CPF/CNPJ).

Do local BR cards with / without installments require an addendum to my contract?

Yes. Please contact Avangate for activation.

How does it work?

  1. Create the Order object.
  2. Validate the number of installments available based on total order value. 
  3. Place the order specifying the number of installments. 

Funds collection for installment payments

Avangate pays you in full, regardless of the number of installments (this is covered directly by the banks). 

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