Skip to main content

Use iDEAL

Overview

Place an order with catalog products defined in your Control Panel and collect the payment using iDEAL.

Requirements

Shoppers in the Netherlands can purchase using iDEAL. The billing country and the order country code have to be NL.

Supported currencies

  • EUR

Accepted on other payment flows 

One-click (1-click) purchase for iDeal is available in API 6.0.

Workflow

  1. Use the getIdealIssuerBanks method for retrieving information on the 2Checkout list of banks that support iDEAL payments. More details about this method here.
  2. Shoppers select iDEAL as payment option in the interface you provide them, and select their bank from the list.
  3. Create the order object. Use IDEAL as the type of the PaymentDetails object, and include ReturnURL and CancelURL. The BankCode parameter should be added based on the bank selected by the customer, from the array obtained after calling method getIdealIssuerBanks.
  4. Use the placeOrder method to send the data to 2Checkout.
  5. Once you place the order, 2Checkout logs it into the system. At this point in time, the status of the order is PENDING.
  6. 2Checkout returns an Order object as the output of the placeOrder method. 
  7. 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.2checkout.com/4.0/scripts/ideal/authorize/?avng8apitoken=f56373d92ed6b153
    
  8. Customers are directed to the iDEAL payment page, where they have to confirm their payment details before finishing the ordering process.
  9. Shoppers are redirected to the RedirectURL from the Order information object. In case the payment fails, shoppers are redirected to the CancelURL. 

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.

To place an order with iDEAL, use IDEAL as the type of the PaymentDetails object and provide the following parameters as part of the PaymentMethod object:

  • ReturnURL - URL to which customers are redirected after a successful payment.
  • CancelURL - URL to which customers are redirected after a failed payment attempt.
  • BankCode - information retrieved based on the bank selected by the customer, from the array obtained after calling getIdealIssuerBanks method.

See code sample for more details. 

Response

Parameter Type/Description
Order information Object
  Object containing order information.

Request

<?php

require ('PATH_TO_AUTH');

$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = 'EUR';
$Order->Country = 'NL';
$Order->Language = 'en';
$Order->CustomerIP = '91.220.121.21';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->Affiliate = new stdClass();
$Order->Affiliate->AffiliateCode = 'Partner123'
$Order->Affiliate->AffiliateSource = 'MobilePlatform'
$Order->CustomerReference = NULL;

$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = 'my_subscription_1';
$Order->Items[0]->Quantity = 1;
$Order->Items[0]->PriceOptions = NULL;
$Order->Items[0]->SKU = NULL;
$Order->Items[0]->Price = NULL;
$Order->Items[0]->CrossSell = NULL;
$Order->Items[0]->Trial = false;
$Order->Items[0]->AdditionalFields = NULL;
$Order->Items[0]->SubscriptionStartDate = NULL; //If empty or null, subscriptions become active when purchase is made.
$Order->BillingDetails = new stdClass();
$Order->BillingDetails->FirstName = 'Test Cosmin API';
$Order->BillingDetails->LastName = 'Cosmin API';
$Order->BillingDetails->CountryCode = 'NL';
$Order->BillingDetails->State = 'California';
$Order->BillingDetails->City = 'LA';
$Order->BillingDetails->Address1 = 'Address example';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '90210';
$Order->BillingDetails->Email = 'cosmin.deftu@2checkout.com';
$Order->BillingDetails->Phone = NULL;
$Order->BillingDetails->Company = NULL;
$Order->DeliveryDetails = NULL;

$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'IDEAL';
$Order->PaymentDetails->Currency = 'EUR';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->CustomerIP = '91.220.121.21';
$Order->PaymentDetails->PaymentMethod->ReturnURL = 'http://yourreturnurl.com';
$Order->PaymentDetails->PaymentMethod->CancelURL= 'http://yourcancelurl.com';
$Order->PaymentDetails->PaymentMethod->BankCode='RABONL2U+RAB'; // value retrieved based on the bank selected by the customer, from the array obtained after calling method getIdealIssuerBanks.

try {
   $newOrder = $client->placeOrder($sessionID, $Order);
}
catch (SoapFault $e) {
    echo "newOrder: " . $e->getMessage();
    exit;
}

$idealredirect= $newOrder->PaymentDetails->PaymentMethod->Authorize->Href."/?avng8apitoken=".$newOrder->PaymentDetails->PaymentMethod->Authorize->Params->avng8apitoken;

header('Location:' . $idealredirect);
?>

Retrieve check payment details

Overview

Retrieve the check payment details that customers must use or have used to pay for an order.

Requirements

Parameters

Parameter Type/Description
sessionID Required (String)
  Session identifier string, output of the Login method. An exception is thrown if the values are incorrect.
refNo Required (String)
  Order reference number of an order that was marked with CHECK as payment method.

Response

Parameter Type/Description

CheckPaymentDetails

Object

 

Details below

 

Beneficiary

String

 

 

Payment beneficiary name. Can be NULL.

 

CheckPostalAddress

String

 

 

Beneficiary address. Can be NULL.

 

CheckAccountHolderName

String

 

 

Beneficiary account holder name. Can be NULL.

 

Country

String

 

 

Beneficiary country. Can be NULL.

 

Amount

Double

 

 

Total order costs. Can be NULL.

 

Currency

String

 

 

Order currency ISO code – ISO 4217. Can be NULL.

Request

<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner

$proformaNumber = 'YOUR_PROFORMA_NUMBER';

try {
    $Proforma= $client->setProforma ($sessionID, $proformaNumber);
} catch (SoapFault $e) {
    echo "ProformaOutput: " . $e->getMessage();
    exit;
}
var_dump ("ProformaOutput", $Proforma);


$paymentDetails = new stdClass();
$paymentDetails->Type = 'CHECK';
$paymentDetails->Curency = 'YOUR_CURRENCY';
$paymentDetails->CustomerIP = 'CUSTOMER_IP';

try {
    $PaymentDetailsSet= $client->setPaymentDetails($sessionID, $paymentDetails);
} catch (SoapFault $e) {
    Echo "Payment: " . $e->getMessage();
    exit;
}
var_dump ("Payment", $PaymentDetailsSet);

try {
    $ProformaPay= $client->payProforma($sessionID);
} catch (SoapFault $e) {
    Echo "ProformaPaid: " . $e->getMessage();
    exit;
}
var_dump ("ProformaPaid ", $ProformaPay);

$refNo = 'YOUR_ORDER_REFNO'

try {
    $client->getCheckPaymentDetails ($sessionID, $refNo);
} catch (SoapFault $e) {
    echo "Error: " . $e->getMessage();
}

Errors

Error Description

INVALID_PARTNER

No partner is set.

PAYMENT_PROFORMA

You have to set a partner invoice first.

PAYMENT_NOT_SUPPORTED

The current partner invoice is not set as payable through check.

Add a subscription plan/product

 

Use the addProduct method to create subscription plans/products for your Avangate account. 

Parameters

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.

Product

Required (object)

 

Use this object to configure your subscription plans/products.

 

You can set all Product parameters except AvangateID. The Avangate system sets the unique product ID. The AvangateID is not editable.

Mandatory parameters

 

ProductName
ProductCode
PricingConfigurations

Response

bool(true)

Request

<?php

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


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

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

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

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

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

$Product                 = new stdClass();
$Product->AvangateId     = null;
$Product->ProductCode    = 'API_Imported_1234567899';
$Product->ProductType    = 'REGULAR';
$Product->ProductName    = 'API_Subscription Imported New';
$Product->ProductVersion = '1.0';
$Product->GroupName      = 'General';

//Shipping classes

/* $Product->ShippingClass = new stdClass();
$Product->ShippingClass->Name = '2o9rlujkvg';
$Product->ShippingClass->Amount = 89.40;
$Product->ShippingClass->Currency = 'GBP';
$Product->ShippingClass->ApplyTo = 'ct29dr3fj4';
$Product->ShippingClass->Type = 'bii521vp6k'; */

$Product->GiftOption                 = false;
$Product->ShortDescription           = 'Placeat cumque necessitatibus est minus praesentium ut non quibusdam. Molestias provident tempore eligendi mollitia quia.';
$Product->LongDescription            = 'Corrupti inventore vitae nesciunt ab. Nemo cum non maiores. Non repudiandae est iste voluptatibus.';
$Product->SystemRequirements         = null;
$Product->ProductCategory            = null;
$Product->Platforms                  = array();
$Product->Platforms[0]               = new stdClass();
$Product->Platforms[0]->PlatformName = null;
$Product->Platforms[0]->Category     = null;
$Product->Platforms[1]               = new stdClass();
$Product->Platforms[1]->PlatformName = null;
$Product->Platforms[1]->Category     = null;
$Product->ProductImages              = array();
$Product->ProductImages[0]           = new stdClass();
$Product->ProductImages[0]->URL      = null;
$Product->ProductImages[0]->Default  = false;
$Product->ProductImages[1]           = new stdClass();
$Product->ProductImages[1]->URL      = null;
$Product->ProductImages[1]->Default  = true;
$Product->TrialUrl                   = null;
$Product->TrialDescription           = null;
$Product->Enabled                    = True;

//Product additional fields

/* $Product->AdditionalFields = array();
$Product->AdditionalFields[0] = new stdClass();
$Product->AdditionalFields[0]->Label = 'i44wak1dzp';
$Product->AdditionalFields[0]->Code = 'ITYAK0OEWJ';
$Product->AdditionalFields[0]->Enabled = false;
$Product->AdditionalFields[0]->Required = false;
$Product->AdditionalFields[0]->URLParameter = 'id1ktigl6d';
$Product->AdditionalFields[1] = new stdClass();
$Product->AdditionalFields[1]->Label = 'aig699lmo1';
$Product->AdditionalFields[1]->Code = 'V28TP07PQN';
$Product->AdditionalFields[1]->Enabled = false;
$Product->AdditionalFields[1]->Required = true;
$Product->AdditionalFields[1]->URLParameter = '8to9p6y54j'; */

//Product localization

/* $Product->Translations = array();
$Product->Translations[0] = new stdClass();
$Product->Translations[0]->Name = 'zsg7wtg4e5';
$Product->Translations[0]->Description = 'Voluptate iure ut quam omnis impedit. Deserunt facere id dolores doloribus quis. Minima nostrum ut possimus incidunt vel est sint. Odit tempora omnis iste nesciunt commodi accusantium placeat.';
$Product->Translations[0]->Language = 'pt';
$Product->Translations[0]->LongDescription = 'Pariatur molestiae sit dignissimos modi. Aut modi libero numquam repudiandae. Doloribus explicabo delectus fugiat amet. Excepturi quo consequatur sint adipisci.';
$Product->Translations[0]->SystemRequirements = 'c16tvyg88c';
$Product->Translations[0]->TrialUrl = 'UNCAUGHT TYPE: anyURI';
$Product->Translations[0]->TrialDescription = 'Voluptas rem sit ut voluptas molestias quidem ut. Maiores facilis tempora voluptates. Consequuntur illum recusandae hic magni iste.';
$Product->Translations[1] = new stdClass();
$Product->Translations[1]->Name = 'cv2sx15aby';
$Product->Translations[1]->Description = 'Ut distinctio asperiores et a placeat voluptatem et. Et eveniet temporibus aut vel. Nemo occaecati praesentium dolor fugiat rerum assumenda expedita.';
$Product->Translations[1]->Language = 'fr';
$Product->Translations[1]->LongDescription = 'Et ut nostrum molestiae voluptates soluta. Molestiae cum in ut qui. Voluptatem voluptates vero odit quia corporis. In impedit eligendi sed expedita nihil temporibus nobis.';
$Product->Translations[1]->SystemRequirements = 'cfv2amk25j';
$Product->Translations[1]->TrialUrl = 'UNCAUGHT TYPE: anyURI';
$Product->Translations[1]->TrialDescription = 'Voluptatem ut possimus consequatur iste. Recusandae id quia sed quibusdam aut debitis. Cupiditate harum architecto quod quia.'; */


$Product->PricingConfigurations                                     = array();
$Product->PricingConfigurations[0]                                  = new stdClass();
$Product->PricingConfigurations[0]->Default                         = false;
$Product->PricingConfigurations[0]->Code                            = null;
$Product->PricingConfigurations[0]->Name                            = 'API Pricing Configuration Test';
$Product->PricingConfigurations[0]->BillingCountries                = array();
$Product->PricingConfigurations[0]->PricingSchema                   = 'DYNAMIC';
$Product->PricingConfigurations[0]->PriceType                       = 'NET';
$Product->PricingConfigurations[0]->DefaultCurrency                 = 'USD';
$Product->PricingConfigurations[0]->Prices                          = new stdClass();
$Product->PricingConfigurations[0]->Prices->Regular                 = array();
$Product->PricingConfigurations[0]->Prices->Regular[0]              = new stdClass();
$Product->PricingConfigurations[0]->Prices->Regular[0]->Amount      = 100;
$Product->PricingConfigurations[0]->Prices->Regular[0]->Currency    = 'USD';
$Product->PricingConfigurations[0]->Prices->Regular[0]->MinQuantity = 1;
$Product->PricingConfigurations[0]->Prices->Regular[0]->MaxQuantity = 10;
$Product->PricingConfigurations[0]->Prices->Regular[0]->OptionCodes = array();
$Product->PricingConfigurations[0]->Prices->Regular[1]              = new stdClass();
$Product->PricingConfigurations[0]->Prices->Regular[1]->Amount      = 200;
$Product->PricingConfigurations[0]->Prices->Regular[1]->Currency    = 'USD';
$Product->PricingConfigurations[0]->Prices->Regular[1]->MinQuantity = 11;
$Product->PricingConfigurations[0]->Prices->Regular[1]->MaxQuantity = 100;
$Product->PricingConfigurations[0]->Prices->Regular[1]->OptionCodes = array();
$Product->PricingConfigurations[0]->Prices->Renewal                 = array();
$Product->PricingConfigurations[0]->Prices->Renewal[0]              = new stdClass();
$Product->PricingConfigurations[0]->Prices->Renewal[0]->Amount      = 50;
$Product->PricingConfigurations[0]->Prices->Renewal[0]->Currency    = 'USD';
$Product->PricingConfigurations[0]->Prices->Renewal[0]->MinQuantity = 1;
$Product->PricingConfigurations[0]->Prices->Renewal[0]->MaxQuantity = 10;
$Product->PricingConfigurations[0]->Prices->Renewal[0]->OptionCodes = array();
$Product->PricingConfigurations[0]->Prices->Renewal[1]              = new stdClass();
$Product->PricingConfigurations[0]->Prices->Renewal[1]->Amount      = 60;
$Product->PricingConfigurations[0]->Prices->Renewal[1]->Currency    = 'USD';
$Product->PricingConfigurations[0]->Prices->Renewal[1]->MinQuantity = 11;
$Product->PricingConfigurations[0]->Prices->Renewal[1]->MaxQuantity = 100;
$Product->PricingConfigurations[0]->Prices->Renewal[1]->OptionCodes = array();
$Product->PricingConfigurations[0]->PriceOptions                    = array();

/* $Product->BundleProducts = array();
$Product->BundleProducts[0] = new stdClass();
$Product->BundleProducts[0]->ProductCode = '540Q45PQBN';
$Product->BundleProducts[0]->ProductId = 48439;
$Product->BundleProducts[1] = new stdClass();
$Product->BundleProducts[1]->ProductCode = 'PA3JDB5SZ2';
$Product->BundleProducts[1]->ProductId = 46439;
*/
$Product->Fulfillment = 'NO_DELIVERY';
$Product->Prices      = array();

$Product->GeneratesSubscription                            = True;
$Product->SubscriptionInformation                          = new stdClass();
$Product->SubscriptionInformation->DeprecatedProducts      = array();
$Product->SubscriptionInformation->BundleRenewalManagement = null;
$Product->SubscriptionInformation->BillingCycle            = 1;
$Product->SubscriptionInformation->BillingCycleUnits       = 'M';
$Product->SubscriptionInformation->IsOneTimeFee            = false;

$Product->SubscriptionInformation->ContractPeriod                       = new stdClass();
$Product->SubscriptionInformation->ContractPeriod->Period               = -1;
$Product->SubscriptionInformation->ContractPeriod->PeriodUnits          = 'days';
$Product->SubscriptionInformation->ContractPeriod->IsUnlimited          = TRUE;
$Product->SubscriptionInformation->ContractPeriod->Action               = 'RESTART';
$Product->SubscriptionInformation->ContractPeriod->EmailsDuringContract = 'altenwerth.elise@gmail.com';

//$Product->SubscriptionInformation->UsageBilling = 77;

$Product->SubscriptionInformation->GracePeriod              = new stdClass();
$Product->SubscriptionInformation->GracePeriod->Type        = 'GLOBAL';
$Product->SubscriptionInformation->GracePeriod->Period      = 14;
$Product->SubscriptionInformation->GracePeriod->PeriodUnits = 'D';
$Product->SubscriptionInformation->GracePeriod->IsUnlimited = false;

$Product->SubscriptionInformation->RenewalEmails                                               = new stdClass();
$Product->SubscriptionInformation->RenewalEmails->Type                                         = 'CUSTOM';
$Product->SubscriptionInformation->RenewalEmails->Settings                                     = new stdClass();
$Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal                      = new stdClass();
$Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->Before30Days        = true;
$Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->Before15Days        = true;
$Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->Before7Days         = true;
$Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->Before1Day          = false;
$Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->OnExpirationDate    = true;
$Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->After5Days          = false;
$Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->After15Days         = false;
$Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal                   = new stdClass();
$Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->Before30Days     = true;
$Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->Before15Days     = false;
$Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->Before7Days      = false;
$Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->Before1Day       = false;
$Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->OnExpirationDate = true;
$Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->After5Days       = false;
$Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->After15Days      = true;

$Product->FulfillmentInformation                                = new stdClass();
$Product->FulfillmentInformation->IsStartAfterFulfillment       = false;
$Product->FulfillmentInformation->IsElectronicCode              = false;
$Product->FulfillmentInformation->IsDownloadLink                = false;
$Product->FulfillmentInformation->IsBackupMedia                 = false;
$Product->FulfillmentInformation->IsDownloadInsuranceService    = false;
$Product->FulfillmentInformation->IsInstantDeliveryThankYouPage = false;
$Product->FulfillmentInformation->IsDisplayInPartnersCPanel     = false;

/* $Product->FulfillmentInformation->CodeList = new stdClass();
$Product->FulfillmentInformation->CodeList->Code = '5C6F821DA1';
$Product->FulfillmentInformation->CodeList->Name = 'General delivery';
$Product->FulfillmentInformation->CodeList->Type = 'STATIC';  */

//$Product->FulfillmentInformation->BackupMedia = new stdClass();

//$Product->FulfillmentInformation->ProductFile = new stdClass();

/* $Product->FulfillmentInformation->AdditionalInformationByEmail = 'arlene03@hotmail.com';
$Product->FulfillmentInformation->AdditionalInformationEmailTranslations = array();
$Product->FulfillmentInformation->AdditionalInformationEmailTranslations[0] = new stdClass();
$Product->FulfillmentInformation->AdditionalInformationEmailTranslations[0]->Name = 'kbaa1aj7po';
$Product->FulfillmentInformation->AdditionalInformationEmailTranslations[0]->Description = 'Velit delectus sed amet sunt. Sunt deserunt quos recusandae consequuntur est. Velit aut optio error eius rerum. Nihil ipsam possimus ipsum dolores consequatur adipisci.';
$Product->FulfillmentInformation->AdditionalInformationEmailTranslations[0]->Language = 'fr';
$Product->FulfillmentInformation->AdditionalInformationEmailTranslations[1] = new stdClass();
$Product->FulfillmentInformation->AdditionalInformationEmailTranslations[1]->Name = 'l4ocvz9wwa';
$Product->FulfillmentInformation->AdditionalInformationEmailTranslations[1]->Description = 'Esse voluptatem delectus officiis eos quas asperiores. Quas non hic reiciendis enim. Consequatur similique recusandae laboriosam et autem.';
$Product->FulfillmentInformation->AdditionalInformationEmailTranslations[1]->Language = 'pt';
$Product->FulfillmentInformation->AdditionalThankYouPage = 'rvlhvkmxkp';
$Product->FulfillmentInformation->AdditionalThankYouPageTranslations = array();
$Product->FulfillmentInformation->AdditionalThankYouPageTranslations[0] = new stdClass();
$Product->FulfillmentInformation->AdditionalThankYouPageTranslations[0]->Name = 'rl981w4nua';
$Product->FulfillmentInformation->AdditionalThankYouPageTranslations[0]->Description = 'Qui explicabo molestiae dolorem consequuntur. Ullam maiores temporibus vitae. Totam eos et consequatur. Est sit minima animi nam ut aut.';
$Product->FulfillmentInformation->AdditionalThankYouPageTranslations[0]->Language = 'en';
$Product->FulfillmentInformation->AdditionalThankYouPageTranslations[1] = new stdClass();
$Product->FulfillmentInformation->AdditionalThankYouPageTranslations[1]->Name = 'qye8hlwz3e';
$Product->FulfillmentInformation->AdditionalThankYouPageTranslations[1]->Description = 'Id est rerum deserunt non et quia magnam. Minus aut nostrum dicta est officiis quia. Commodi nobis sit porro accusamus rerum quis. Fugit et asperiores eum.';
$Product->FulfillmentInformation->AdditionalThankYouPageTranslations[1]->Language = 'fr';
*/


try {
    $NewSubscriptionPlan = $client->addProduct($sessionID, $ProdbyCode);
}

catch (SoapFault $e) {
    echo "AddedProductInfo: " . $e->getMessage();
    exit;
}
var_dump("AddedProductInfo", $NewSubscriptionPlan);
?>

Add additional fields

Overview

Use the addAdditionalField method to create new additional fields 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.

AdditionalField

Object

 

Additional field object.

Response

bool(true)

Request

<?php

require ('PATH_TO_AUTH');

$AdditionalField                             = new stdClass();
$AdditionalField->Label                      = 'Do you agree with the new newsletter policy 2015?';
$AdditionalField->Type                       = 'LISTBOX';
$AdditionalField->Code                       = 'NewsletterPolicy1234576';
$AdditionalField->ApplyTo                    = 'ORDER';
$AdditionalField->Values                     = array();
$AdditionalField->Values[0]                  = 'YES';
$AdditionalField->Values[1]                  = 'NO';
$AdditionalField->ValidationRule             = null;
$AdditionalField->Translations               = array();
$AdditionalField->Translations[0]            = new stdClass();
$AdditionalField->Translations[0]->Label     = "Êtes-vous d'accord avec la politique de la newsletter?";
$AdditionalField->Translations[0]->Values    = array();
$AdditionalField->Translations[0]->Values[0] = 'Oui';
$AdditionalField->Translations[0]->Values[1] = 'Non';
$AdditionalField->Translations[0]->Language  = 'fr';
$AdditionalField->Translations[1]            = new stdClass();
$AdditionalField->Translations[1]->Label     = 'Haben Sie mit dem Newsletter Politik zu?';
$AdditionalField->Translations[1]->Values    = array();
$AdditionalField->Translations[1]->Values[0] = 'Ja';
$AdditionalField->Translations[1]->Values[1] = 'Nein';
$AdditionalField->Translations[1]->Language  = 'de';

try {
    $NewAdditionalField = $client->addAdditionalField($sessionID, $AdditionalField);
}

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

var_dump("NewAdditionalField", $NewAdditionalField);


?>

 

Subscription history

Overview

Retrieve information about a subscription. Subscriptions can be retrieved starting with 5 minutes after their orders are generated in the 2Checkout system.

Parameters

Parameters Type/Description

ReferenceNo

String

 

Unique, system-generated order reference number.

Type

String

 

Purchase type:

  • SALE
  • RENEWAL
  • UPGRADE

SubscriptionReference

String

 

Unique, system-generated subscription reference.

StartDate

String

 

Subscription start date(YYYY-MM-DD) - StartDate is mandatory when importing subscription data. If you changed the time zone for the Avangate API by editing system settings under Account settings, then the StartDate you provide must be in accordance with your custom configuration.

ExpirationDate

String

 

Subscription expiration date(YYYY-MM-DD) - ExpirationDate is mandatory when importing subscription data. If you changed the time zone for the Avangate API by editing system settings under Account settings, then the ExpirationDate you provide must be in accordance with your custom configuration.

Lifetime

Boolean

 

Possible values:

  • True – the subscription is evergreen

False – the subscription has a recurring billing cycle less than or equal to three years.

SKU

String

 

Stock keeping unit you defined.

DeliveryInfo

Object

 

Object with information about the delivery made to the customer - structure described below

PartnerCode

String

 

Possible values:

  • Empty = ecommerce order
  • Partner Code

 

1099-K Form Requirements

Overview

The United States Government has enacted a law (Internal Revenue Code Section 6050W) which requires payment processors to send an IRS the 1099-K form annually, to all US sellers starting with 2011.

The 1099-K form, Payment Card and Third Party Network Transactions is an IRS information return used to report certain payment transactions to improve voluntary tax compliance.

Read the instructions below on how to update your 2Checkout account to meet these requirements. 

 

Recommended resources

Availability

Form 1099-K applies to all US sellers.

2Checkout requirements

2Checkout will ask affected Sellers/Merchants to confirm and/or update their 2Checkout account by providing a tax ID number and the appropriate corresponding contact information.

Your tax ID number is one of these:

• Your Social Security Number (SSN)

• Your Employer Identification Number (EIN)

• Your Individual Tax Identification Number (ITIN)

Please use the guidelines below to determine which tax ID number to provide.

  • Business Entities with an EIN

Provide your company EIN and company name.

  • Sole Proprietors with an EIN

Provide your company EIN and your own name.

  • Individual Sellers and Sole Proprietors without an EIN

Provide your SSN or ITIN and your own name.

2Checkout will also need affected Sellers/Merchants to confirm that their account name matches the tax ID number provided and to confirm their physical address so that if Form 1099-K is issued, we can report your information accurately to the IRS.

Updating the 2Checkout account

Follow these steps to update your 2Checkout account in order to meet the fiscal compliance requirements.

1. Log in to your Merchant Control Panel account.

2. Click the Settings tab.

form1099Kcpanel.png

3. In the Account Settings page, click on the Edit Details tab, under Account Information.

form1099Kcpanel1.png

4. On the Account Information page, edit the necessary details, and confirm your account information is correct.

5. Click Update at the bottom of the page to save your new settings.

6. Confirm that the Company Name listed is correct. If your company is incorporated, make sure that the company name listed on your 2Checkout Account is exactly as it is listed on your incorporation documents. If your Company name is incorrect on this page, send an email to supportplus@2checkout.com for assistance in updating this field.

7. Confirm that the Business Office E-mail, Mailing Address, and Physical Address listed on the account are correct. Update if necessary. If the physical address listed on this page is incorrect, send an email to supportplus@2checkout.com for assistance in updating this field.

FAQs

1. How do I receive my 1099-K form?

The platform will automatically generate the PDF for the 1099-K form for all merchants. You will receive an email notification that the file was generated and you will be able to download the file from your Merchant Control Panel, under Account information → Edit account information.

Every year 2Checkout will generate a file for the IRS that will contain all your payments from the previous year.

2. What if I don’t provide my Tax ID number?

If 2Checkout is unable to verify your information because it is incorrect or incomplete, your account will be put in a Restricted status, so you will not be able to receive payouts. The restriction will end once you provide your tax ID number and corresponding contact information, and your information is verified by the IRS matching system.

If you need additional information about this law you can read more details on the IRS website.

Extract invoices

Overview

Use the getInvoices method to extract shopper invoices from the Avangate system based on unique order references. The method returns the binary code for invoices in the PDF file format, Base64 encoded (Base64 is used to represent binary data in the ASCII string format).

getInvoices works for COMPLETE orders for which an invoice was already issued. For refunded orders, getInvoices provides two shopper invoices, one for the original order and the second for the refund, reflecting the repayment made.

In the case of cross-selling orders which contain products from different merchants, getInvoice enables you to re-send only the invoices for your own offerings.

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.

RefNo

Required (string)

 

Unique, system generated reference for orders.

Request

Response

InvoicesData

Array of objects

 

 

Details below.

 

Sale

String

 

 

Base64 encoded PDF file containing an invoice for a Complete order.

 

Cancellation

String

 

 

Base64 encoded PDF file containing a cancellation invoice.

 

Refunds

Array of string

 

 

Base64 encoded PDF files containing invoices for Refunds.


<?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);
$Reference = '43997639';

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

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

 

SimpleProduct Object Structure

Parameters

Parameter Type/Descriptio
ProductId Int
  Unique Avangate Product ID.
ProductCode String
  Unique Product Code.
ProductName String
  Product Name
ProductType String
  Possible values: REGULAR or BUNDLE
ProductVersion String
  Product version. Can be NULL.
ProductImage String
  URLs to the product image uploaded into the Avangate platform. Can be NULL.
Price Double
  Product price calculated using the configuration of pricing options from the pricing list.
Currency String
  The ISO code of the currency set for the partner - ISO 4217.
PriceType String
  Possible values NET or GROSS.

 

Retrieve wire transfer details

Overview

Retrieve the wire payment details that partners need to use to pay for partner invoices.

Requirements

Next, use setProforma to identify a specific partner invoice.

Parameters

Parameter Type/Description
sessionID Required (String)
  Session identifier string, output of the Login method. An exception is thrown if the values are incorrect.
refNo Required (String)
  Order reference number of an order that was marked with WIRE as payment method.

Response

Parameters Type/Description

WirePaymentDetails

Object

 

Details below

 

Amount

Double

 

 

The total costs incurred by the partner for a partner invoice invoice.

 

Currency

String

 

 

Order currency ISO code - ISO 4217.

 

PaymentReference

String

 

 

Transaction identifier.

 

RoutingNumber

String

 

 

Identification number assigned to financial institutions.

 

BankAccounts

Array of objects

 

 

Array of BankAccountDetails objects with the structure detailed below. Can be NULL.

 

 

Beneficiary

String

 

 

 

Payment beneficiary name. Can be NULL.

 

 

BankName

String

 

 

 

Beneficiary bank name. Can be NULL.

 

 

BankCountry

String

 

 

 

Beneficiary bank country. Can be NULL.

 

 

BankCity

String

 

 

 

Beneficiary bank city. Can be NULL.

 

 

BankAddress

String

 

 

 

Beneficiary bank address. Can be NULL.

 

 

BankAccount

String

 

 

 

Beneficiary bank account number. Can be NULL.

 

 

BankAccountIban

String

 

 

 

Beneficiary IBAN. Can be NULL.

 

 

BankAccountSwiftCode

String

 

 

 

Beneficiary SWIFT code. Can be NULL.

 

 

Currency

String

 

 

 

Bank account currency ISO code – ISO 4217. Can be NULL.

Request

<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner

$proformaNumber = 'YOUR_PROFORMA_NUMBER';

try {
    $Proforma= $client->setProforma ($sessionID, $proformaNumber);
} catch (SoapFault $e) {
    echo "ProformaOutput: " . $e->getMessage();
    exit;
}
var_dump ("ProformaOutput", $Proforma);


$paymentDetails = new stdClass();
$paymentDetails->Type = 'WIRE';
$paymentDetails->Curency = 'YOUR_CURRENCY';
$paymentDetails->CustomerIP = 'CUSTOMER_IP';

try {
    $PaymentDetailsSet= $client->setPaymentDetails($sessionID, $paymentDetails);
} catch (SoapFault $e) {
    Echo "Payment: " . $e->getMessage();
    exit;
}
var_dump ("Payment", $PaymentDetailsSet);

try {
    $ProformaPay= $client->payProforma($sessionID);
} catch (SoapFault $e) {
    Echo "ProformaPaid: " . $e->getMessage();
    exit;
}
var_dump ("ProformaPaid ", $ProformaPay);

$refNo = 'YOUR_ORDER_REFNO'

try {
    $client->getWirePaymentDetails ($sessionID, $refNo);
} catch (SoapFault $e) {
    echo "Error: " . $e->getMessage();
}

 

Errors

Error Description

INVALID_PARTNER

No partner is set.

PAYMENT_PROFORMA

You have to set a partner invoice first.

PAYMENT_NOT_SUPPORTED

The current partner invoice is not set as payable through wire.

 

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