Skip to main content

Trustly

Overview

With Trustly, you can accept payments, issue payouts, and access valuable user insight data. Easy activation and multi-currency functionality give you the power to expand your business across borders with access to customers in Europe, Australia, Canada, and the US.

Availability

Only shoppers from these countries are able to purchase using Trustly:

  • Austria
  • Czech Republic
  • Denmark
  • Estonia
  • Finland
  • Germany
  • Latvia
  • Lithuania
  • Netherlands
  • Spain
  • Sweden
  • UK

Requirements

Make sure the billing country code is set to AT, BE, CZ, HR, DK, EE, FI, DE, LV, LT, NL, PL, SK, ES, SE, GB.

Supported currencies

  • CZK
  • DKK
  • EUR
  • NOK
  • PLN
  • GBP
  • SEK

Workflow

  1. Shoppers select Trustly as a payment option in the interface you provide to them.
  2. Create the order object. Use TRUSTLY as the type of the PaymentDetails object, and include ReturnURL.
  3. Use the placeOrder method to send the data to 2Checkout.
  4. Once you place the order, 2Checkout logs it into the system. At this point in time, the status of the order is PENDING.
  5. 2Checkout returns an Order object as the output of the placeOrder method. 
  6. Use the PaymentMethod object to create a redirect URL for the shoppers, concatenating the values of the Href and avng8apitoken parameters. Here's an example of the redirect URL: https://api.avangate.com/6.0/scripts...bc7fd72d008428
  7. After being redirected to Trustly, shoppers need to complete the steps of Trustly payment flow.
  8. After customers enter their payment data to Trustly, Trustly notifies 2Checkout if the payment is approved, and the status of the order becomes COMPLETE.
  9. Shoppers are redirected to the RedirectURL from the Order information object. In case the payment fails, shoppers are redirected to the CancelURL. 

Giropay

Overview

Online banking-based payment method tailored to users in Germany. Giropay supports online payments via secure online transfers directly between bank accounts. 

Availability

Available for 2Monetize accounts.

Workflow

  1. When placing the order, shoppers in Germany can select Giropay as a payment option.
  2. On the next page, customers can place their orders.
  3. Shoppers are required to hit the Click to finalize your payment button to complete the transaction. They'll receive access to the Moneybookers payment gateway, where they need to follow the instructions provided to process the transaction. Once they do, customers will be redirected back to the 2Checkout order page and they'll receive a receipt of the payment by email.

Refund an order

Overview

Refund a sale made in 2Checkout via the issueRefund API method. Depending on your business needs, you can refund only one sale item, the entire order amount, or a partial amount from the total order.

Requirements

The payment for the refundable order needs to be collected.

You cannot issue a refund for an amount higher than the total order amount.

Parameters

Parameters Type/Description
RefNo

String / Required

The order reference number of the sale for which the refund is issued. Example: '721924012'.

Amount

Double / Required

Refundable amount. Required as a supplementary check for partial refunds. Example: '26.00'.

Comment

String / Optional

Comments are displayed to customers in the refund confirmation they receive. Example: 'Let us know if you are satisfied with the refund process'. 

Reason

String / Required

In case you have custom refund reasons defined on your account, send one of the reasons. If not, send one of the platform defined reasons. Read more about 2Checkout refund reasons.

Example: 'Unwanted auto-renewal'.

Items

Array / Required only for partial refunds

In case you issue a partial refund, send the array with the information below.

  ProductCode 

String / Required

Send the product code belonging to the products to be refunded. The product code is available at product level, in the Information tab.

  Quantity

Integer / Required

Quantity to be refunded. Send only positive values.

  Amount

Double / Required

Total amount of the refunded line item, not the unit amount.

 

 

 

Tax exemption for US shoppers

Overview

In the US, sales tax is required for transactions in 45 states and it is imposed only on the end-consumers. There are various organizations and individuals that are exempt from sales tax for various reasons. Tax Exemption Certificates (TEC) are the way in which a business, organization or individual attests that it is a tax-exempt entity, or that it is purchasing an item with the intent to use it in a way that has been deemed exempt from tax.

In these cases, 2Checkout can refund the sales tax to the customer's payment account after the transaction is complete. The refund can be requested by the shopper within 90 days of the purchase by emailing a copy of his Tax Exemption Certificate together with the order details to pay@2checkout.com.

Once the initial order is flagged as tax-exempt in our system, all renewals linked to that order will also be tax-exempt as long as the certificate the shopper has provided is still valid at the moment the renewal order is placed.

Availability

Subscription support for US Sales Tax exemption is available by default to merchants using the reseller business model (2Monetize), as well as for those merchants using the PSP business model (2Sell, 2Subscribe) for which 2Checkout does the tax calculation.
This renewal behavior will be triggered for all transactions for which the initial tax exemption was processed after July 15th, 2020.

Convert a trial

Overview

Use the convertTrial method to convert a trial to a paid subscription. In the eventuality of a conversion failure, you can use convertTrial again for the same trial subscription only after you let 24 hours pass since the initial attempt. The Avangate system attempts to automatically convert trials before they expire to full subscriptions, unless you made an attempt that failed less than 24 hours before the scheduled expiration deadline.

In case the trial conversion fails due to a transaction issue, the Avangate system sends unfinished payment follow-up emails to customers, provided that you set up lead management for your account.

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 of the trial that you convert to a paid subscription. The unique identifier from the Avangate system:

  • Must belong to an active trial subscription with the recurring billing system (auto-renewal) enabled.
  • The initial order placed to access the trial subscription must be finalized (status Finished).

Note: This method does not work for cancelled and/or expired trial subscriptions.

 

Avangate charges customers using the payment data attached to the trial subscription. 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.

ExtendSubscriptionFromPaymentDate

Optional (boolean)

 

true = Set the moment of the conversion as the start date of the full subscription. 

Example: A 7 day trial purchased on October 29 for a monthly subscription converted on October 30 with $ExtendSubscriptionFromPaymentDate = true; features the following Billing cycle expiration: Nov 30, 2013 and Avangate scraps the initial trial expiration date November 5.

 

false = Set initial trial expiration deadline as the fhe full subscription start date. 

Example: A 10 day trial purchased on October 29 for a monthly subscription converted on October 30 with $ExtendSubscriptionFromPaymentDate = false; features the following Billing cycle expiration: December 9, with the first month period of the subscription added to the trial lifetime stretching until November 8.

 

Can be NULL. If not sent, the default value is false.

Response

Boolean

true or false depending on whether the changes were successful or not.

Request


<?php
 
 
function callRPC($Request, $hostUrl, $Debug = true) {
    $curl = curl_init($hostUrl);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($curl, CURLOPT_SSLVERSION, 0);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
    $RequestString = json_encode($Request);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $RequestString);
 
 
    if ($Debug) {
        $RequestString;
    }
    $ResponseString = curl_exec($curl);
    if ($Debug) {
        $ResponseString;
    }
 
    if (!empty($ResponseString)) {
        $Response = json_decode($ResponseString);
        if (isset($Response->result)) {
            return $Response->result;
        }
        if (!is_null($Response->error)) {
            var_dump($Request->method, $Response->error);
        }
    } else {
        return null;
    }
}
 
$host = 'https://api.avangate.com/rpc/3.0/';
 
$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
 
$string = strlen($merchantCode) . $merchantCode . strlen(gmdate('Y-m-d H:i:s')) . gmdate('Y-m-d H:i:s');
$hash = hash_hmac('md5', $string, $key);
 
$i = 1; // counter for api calls
// call login
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'login';
$jsonRpcRequest->params = array($merchantCode, gmdate('Y-m-d H:i:s'), $hash);
$jsonRpcRequest->id = $i++;
 
$sessionID = callRPC($jsonRpcRequest, $host);
 
var_dump($sessionID);
$SubscriptionReference = 'BF44555C6C';
$ExtendSubscriptionFromPaymentDate = true; //false can also be used if you want the subscription start date to be the moment when the trial was set to initially expire.

$jsonRpcRequest = array (
'method' => 'convertTrial',
'params' => array($sessionID, $SubscriptionReference, $ExtendSubscriptionFromPaymentDate),
'id' => $i++,
'jsonrpc' => '2.0');

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

Channel Manager Tax Exemption

Overview

In the US there are various organizations and individuals that are exempt from taxes for various reasons. This exemption sometimes also covers sales tax for purchased goods, depending on a number of factors. Tax Exemption certificates are the way in which a business or organization attests that it is a tax-exempt entity, or that you are purchasing an item with the intent to use it in a way that has been deemed exempt from tax.

Sales tax is required for transactions in 45 US States and it is imposed only on the end-consumers. If you are a Channel Manager Partner who is purchasing products for resale to end-consumers, you must provide 2Checkout with the following information:

  • Valid Reseller Tax Exemption Certificate for your business location State, or
  • Valid Multi-State Reseller Tax Exemption Certificate for all jurisdictions where you’re registered

By providing 2Checkout with a Reseller Tax Exemption Certificate, you agree that:

  1. You are purchasing products for resale to end-consumers
  2. You will collect and remit sales tax on taxable sales made to your customers who are taxable end-consumers.

Once your Reseller Tax Exemption Certificate has been submitted and reviewed by 2Checkout, we will not charge US State sales tax on transactions with you. On products you purchase from us for resale, you must still collect and remit the US State sales tax on your transactions with your end-consumers in accordance with the State law of the purchaser.

Availability

The feature is available for merchants that use the reseller business model (2Monetize package) and the 2Checkout Channel Manager solution with active partners who have submitted their Reseller Tax Exemption Certificate.

For merchants in the EU and other jurisdictions not imposing VAT on VAT-registered purchasers, VAT will not be applied to your purchase if a valid VAT ID is used by the partner in their account. The tax exemption certificate described above is valid only for US transactions.

How to activate the Channel Manager Tax Exemption

You can find information regarding Reseller Tax Exemption Certificates along with proper forms on your State Department of Revenue website. In most US states, you can simply download the form for completion and signature. In some States, these Exemption Certificates are only issued by the State Department of Revenue at your request.

You can submit a request for activating the tax exemption option by sending an email to pay@2checkout.com. The application will be processed by the Financial Operations department that will request in turn a Reseller Tax Exemption Certificate. After the certificate is validated, your account will be marked as exempt from the US sales tax. 

Orders placed by partners that are marked as tax-exempt will not be charged the US State sales tax (in the Channel Manager portal), as shown in the image below.

channel manager.png
 

Place orders on behalf of customers

Overview

The 2Checkout platform enables you to place new orders on behalf of your existing customers.

  • Streamline new purchases for your existing customer base though a frictionless ordering process.
  • Leverage payment data customers already shared with you to simplify the new acquisition process.

You can use either:

  • Existing payment details to charge customers
  • New payment details

Availability

Please contact 2Checkout directly to start using this functionality. 

Requirements

PCI Data Security Standards (PCI DSS) compliance is strongly recommended for this feature. Please contact 2Checkout directly to enable the feature.

User privileges

To provide users of your account with access to this functionality, head over to Account settingsManage user access, click to edit a role, and in the Orders & Reports area, check the Place orders on behalf of customer option.

Supported payment methods

When using existing payment details, you will only be able to place new orders on behalf of your customers provided that they shared their credit card or debit card data when making the initial, or a previous purchase through the 2Checkout system.

How to 

Navigate to Customers, under Orders & customers, and run a search to identify the customer on whose behalf you wish to place a new order, and edit the customer entity. The Place new order button is located in the area immediately below the Customer insight and Customer billing details sections.

Use existing payment details

  1. Select an existing credit card that will be used to charge the customer.
  2. Select the product you're purchasing on behalf of the customer.
  3. The dropdown menu features both the product name and the product code, and enables you to search using either.
  4. Choose the billing currency.
  5. Optional: Enter a valid coupon code to provide a discount. Note: the code must be associated with an already defined promotion.
  6. Click Add to cart.
  7. On the product page, you can change the pricing options, quantity, currency, etc.
  8. Hit the Buy now button.
  9. You will be directed to a shopping cart that features the Billing and Delivery address, as well as the prefilled Payment information. Since an existing credit card is being charged, these details are not editable. The discount is also displayed in the cart.
  10. Click on Place order to finish the purchase.
  11.  A new order will be placed, available via the Orders search area.

Use new payment details

  1. Select the New payment information option.
  2. Select the product you're purchasing on behalf of the customer.
  3. Choose the billing currency.
  4. Optional: Enter a valid coupon code to provide a discount. Note: the code must be associated with an already defined promotion.
  5. Click Add to cart.
  6. On the product page, you can change the pricing options, quantity, currency, etc.
  7. Hit the Buy now button.
  8. You will be directed to a shopping cart that features the Billing information prefilled. You can edit these details of you so require. The discount is also displayed in the cart.
  9. Select a Payment Option from the drop down menu.
  10. Enter the new payment details required to charge the customer and hit Place order.
  11. A new order will be placed, available via the Orders search area.
  12. In this scenario you will be able to use any payment method supported by the 2Checkout platform, as long as the customers share the necessary data with you.

Shopping cart

The shopping cart you  use to place orders features the default design, and not the look and feel of any custom templates used by your customers during the process of placing orders.

2Checkout customer references

2Checkout generates customer references by default for all sold subscriptions, and uses them when ordering a new product on behalf of existing customers. The system-issued ID used is visible as the AV_CUSTOMERID parameter in the Buy Link. Use of the 2Checkout customer reference aggregates subscriptions created as a result of the new acquisition process under the account of the customer on whose behalf you're placing the new order.

Promotions

Overview

Use the Promotion object to create/update and update information on discounts/promotions you set up for your account.

Parameters

Parameters Type/Description

Promotion

Object

 

Name

String  / Required

 

 

Promotion name

 

Description

String  / Optional

 

 

Promotion description

 

StartDate

String  / Optional

 

 

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

Format: Y-m-d

 

EndDate

String  / Optional

 

 

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

Format: Y-m-d

 

MaximumOrdersNumber

Integer / Optional

 

 

2Checkout stops offering the discount when the promotion reaches the maximum number of orders. Can be NULL if you want the promotion to apply to an unlimited number of orders.

 

MaximumQuantity

Integer / Optional

 

 

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

 

InstantDiscount

Boolean / Optional

 

 

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

Object / Required

 

Type

String  

 

 

  • SINGLE = one coupon code-shared by all shoppers
  • MULTIPLE = array of unique coupon codes, each designed for individual use

 

Code/Codes

Array of strings 

 

 

Varies according to type. Send:

  • Code = 'single_code'; when Type = 'SINGLE';
  • Codes = ['code1', 'code2']; when Type = 'MULTIPLE';

Enabled

Bolean / Optional

 

Possible values:

  • TRUE - promotion is active.
  • FALSE - promotion is inactive

ChannelType

String / Required

 

Possible values:

  • ECOMMERCE
  • CHANNEL_MANAGER
  • ALL

Type

String / Required

 

Possible values:

  • REGULAR
  • GLOBAL
  • SPECIAL_PRICE (use in combination with PriceMatrix and DefaultCurrency)
DefaultCurrency String
  Required for SPECIAL_PRICE promotions, represents the default currency of the promotion.
PriceMatrix Array of objects (only for SPECIAL_PRICE type of promotion)/Required
  Only for this type of promotion; is generated by getPriceMatrix and is used to set promotion special prices.

ProductCode

String
  Code of the product that is used by promotion.

PricingConfigurationCode

String
  Code of pricing configuration used by the promotion, must be related to the product.

OptionHash

String
  Unique identifier of one combination of price configuration options.

Options

Array of objects/Optional
  Describes price configuration options identified by OptionHash.

GroupName

String

OptionText

String

Prices

Array of objects/Required
  Promotion prices by currency; price for default currency is required.

Value

Int/Required
  Decimal

Currency

String
  ISO code

Discount

Object/Required

 

Type

String 

 

 

Discount type:

  • PERCENT, use in combination with Value
  • FIXED, use in combination with Values and DefaultCurrency

 

Value / Values

Array of objects

 

 

  • Value = Int, determines the discount percentage from 0 to 100
  • Values = Array of Value objects

 

 

Value

Object 

 

 

       Currency

String 

 

 

 

 

ISO currency code

 

 

       Amount

Integer 

 

 

 

 

Discount amount in the corresponding currency.

 

DefaultCurrency

String 

 

 

ISO code

Products

Object/ Optional

 

Code

Integer/ Optional

 

 

Unique product code that you control.

 

PricingConfigurationCode

String / Optional

 

 

Unique system generated pricing configuration code.

 

PricingOptionCodes

Array of strings / Optional

 

 

Array of pricing option codes controlled by you.

PriceThreshold

Object / Optional

 

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

 

Amount

Decimal / Optional

 

 

The minimum threshold you defined for the default currency.

 

Currency

String / Optional

 

 

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

Translations

Array of objects / Optional

 

PromotionTranslation

Object / Optional

 

 

Name

String / Optional

 

 

 

Localized name corresponding to translated language.

Name: Le product

Language: FR

 

 

Language

String / Optional

 

 

 

Language for localization.

Sources

StringArray / Optional

 

Array of strings defining the sale source through the SRC parameter.

PublishToAffiliatesNetwork

Integer / Optional

 

1 - make promotion available in the Affiliates Network

0 - keep promotion unavailable for the Affiliates Network

ApplyRecurring

String / Required

 

Choose whether to apply the discount to renewal orders. Possible values:

  • NONE
  • ALL
  • CUSTOM

RecurringChargesNumber

Integer / Optional

 

If ApplyRecurring is set to CUSTOM, you can offer discounts for a number of recurring billing charges beyond the initial purchase.

 

 

Test payment methods

Overview

You can place test orders using card-based payment methods.

Use the test payment information below, in conjunction with:

  • Any billing currency
  • Any card expiration date
  • Any CVV code
   Unless you prepare your system to handle incoming test orders, your dynamic key generator might deliver real keys/codes for test orders. Click here to learn more about the fulfillment process of test orders.

Types of orders

  • New acquisitions
  • Manual renewals
  • Automatic renewals (test card numbers required during initial purchase)
  • Upgrades

Test cards

Card type Card number
VISA 4111111111111111
MasterCard 5555555555554444
AMEX 378282246310005
Discover 6011111111111117
JCB 3566111111111113

Use the indicated cardholder name during your test orders to experience the corresponding use case:

Use case Cardholder name

Successful authorization for the initial transaction and all recurring charges. 

John Doe

Successful authorization for the initial transaction and manual renewal transactions but recurring charges fail to authorize with the Insufficient Funds error message.

Mike Doe

Successful authorization for the initial transaction and manual renewal transactions but recurring charges fail to authorize with the Stolen Card error message.

Jenny Doe

Insufficient funds

Mona Doe

Try again later

Mark Doe

Stolen card

Red Doe

Authentication failed

Joy Doe

Expired card

Angela Doe

Invalid card number

Adrian Doe

Invalid CVV (Security code)

Jack Doe

 

 

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