Skip to main content
knowledgecenter.2checkout.com

Use WebMoney

Overview

WebMoney is an online money transfer service and an online payment system, which supports instant secure online transactions. WebMoney's popularity has been growing constantly mostly in the CIS (Commonwealth of Independent States) area, Russia, and Asia (Malaysia, Indonesia).

Supported currencies

WebMoney supports transactions in USD.

Workflow

  1. Shoppers select WebMoney as a payment option in the checkout interface you provide to them.
  2. Create the order object. Use “WEBMONEY” as the type of the PaymentDetails object.
  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. Using the provided URL, make a request using the provided method (usually a POST request) and add the parameters (located in the Params object) as key-value pairs to the body of the request. 

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.

See code sample for more details. 

Request Example

<?php
// Api Name & Method
$apiName = ' '.'placeOrderwithWebMoney';
// include(dirname(__DIR__) . '/../Config.php');
include('Config.php');

// Grab Config Values
$config = new ConfigScripts();
$apiVersion = '6.0';
// $host = 'http://api.sandbox' . $config->SandboxNr . '.avangate.local/soap/' . $apiVersion . "/";
$host = 'http://api.wwwtest2.dev.corp.2co.com:8081/soap/'. $apiVersion . "/";


$client = $config->soapClient($host);
$sessionID = $config->soapLogin($host);


print_r("session: ". $sessionID . "\n");
print_r($host);


  print "\n\n**********************";
  print "\nAPI:".$apiName;
  print "\nAPI Version:"."$apiVersion";
  print "\nProtocol: SOAP";
  print "\n\n**********************\n";


$productCode = 'ghiocel_tangible';
$productQuantity = 1;
$defaultCountry = "tw";
$Currency = "CNY";

$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = $Currency ;
$Order->Country = $defaultCountry;
$Order->Language = 'EN';
$Order->CustomerIP = '10.5.22.197';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->AffiliateId = NULL;
$Order->CustomerReference = NULL;
$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = $productCode;
$Order->Items[0]->Quantity = $productQuantity;
$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 = 'John';
$Order->BillingDetails->LastName = 'Doe';
$Order->BillingDetails->CountryCode = $defaultCountry;
$Order->BillingDetails->State = 'Espírito Santo';
$Order->BillingDetails->City = 'City';
$Order->BillingDetails->Address1 = '-';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '1111111';
$Order->BillingDetails->Email = 'brazil1@2checkout.com';
$Order->BillingDetails->Phone = '123432323212';
$Order->BillingDetails->Company = 'blank';
$Order->DeliveryDetails = new stdClass();
$Order->DeliveryDetails->FirstName = 'John';
$Order->DeliveryDetails->LastName = 'Doe';
$Order->DeliveryDetails->CountryCode = 'NZ';
$Order->DeliveryDetails->State = 'Espírito Santo';
$Order->DeliveryDetails->City = 'City';
$Order->DeliveryDetails->Address1 = '-';
$Order->DeliveryDetails->Address2 = NULL;
$Order->DeliveryDetails->Zip = '1111111';
$Order->DeliveryDetails->Email = 'brazil1@2checkout.com';
$Order->DeliveryDetails->Phone = '123432323212';
$Order->DeliveryDetails->Company = NULL;
$Order->PaymentDetails = new stdClass ();

$Order->PaymentDetails->Type = 'WEBMONEY';
$Order->PaymentDetails->Currency = $Currency ;
// $Order->PaymentDetails->Currency = 'CAD';
$Order->PaymentDetails->HadPayPalToken = false;
$Order->PaymentDetails->CustomerIP = '10.5.22.197';

$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->Promotions = NULL;
$Order->AdditionalFields = NULL;
$Order->LocalTime = NULL;
$Order->GiftDetails = NULL;
// $CartObj->PaymentDetails->PaymentMethod->CardNumberTime = 1;
/**/

if ($Order->PaymentDetails->Type == 'PREVIOUS_ORDER') {
    $Order->ExternalReference ='orderbyref_exteranalref' . $Order->PaymentDetails->PaymentMethod->RefNo;
} else if ($Order->PaymentDetails->Type == 'PAYPAL') {
    $Order->ExternalReference ='orderbyref_exteranalref_PAYPAL';
}
/**/ // end building $CartObj

try {
    $order = $client->placeOrder($sessionID, $Order);
    var_dump(json_encode($order, JSON_PRETTY_PRINT));

} catch (SoapFault $e) {
    echo  $e->getMessage();
}
// var_dump(json_encode($order, JSON_PRETTY_PRINT));

Response Example

Parameter Type/Description

Order information

Object

  Object containing order information.
  • Was this article helpful?