User Tools

Site Tools


en:api_solutions:api_page_good_with_payment_form

API-interface # 3: Product page with a form of payment

API-client interface to send XML-requests and receiving XML/JSON response from the API server product page (a detailed product description with all the properties) for further payment by the selected payment gateway.


XML-request (example)

Request URL
https://axefile.com/api/good_info/
Method POST
Body of request
<?xml version="1.0" encoding="UTF-8"?>
<request api_version="1.0">
    <merchant_data>
        <merchant>120</merchant>
        <signature>J6NDWTCOPZ2GLD3GGODXIYJESHBUGT13</signature>
    </merchant_data>
    <data>
        <good>169</good>
        <currency>usd</currency>
        <language>en</language>
        <format>xml</format>
    </data>
</request>

Request parameters

Name Status Description Data Type
merchantrequiredThe unique identifier of the seller (agent), received at registration (you can view My Office) (integer)
signaturerequiredThe signature request is calculated as follows (PHP):
$sign=sha1(md5($merchant.$shop_hash))

where
$merchant - the unique identifier of the seller (agent)
$shop_hash - secret key, which can be obtained here: https://axefile.com/en/partner/referal

(string)
goodrequiredУникальный идентификатор товара (integer)
currencyoptionalIn what currency to deduce the value of the goods. Available Currency: uah,usd,rub,eur. Default: usd (string)
languageoptionalIn what language to display the product name (ru - Russian, en - English). Default: en (string). The result will be displayed only if there have goods in the name of the requested language. For example, if you set the requested value of “ru”, and product name in Russian is not available, and the name in English is present, the result is absent and vice versa. (string)
formatoptionalThe format of the response to the request (xml/json). Default: xml (string)

XML response to the request (Example)

<?xml version="1.0" encoding="UTF-8"?>
<response api_version="1.0">
  <good>
    <id>1222</id>
    <title>Russian release CMS Discuz X3.1 20140301 from TEAM Chinascript.ru</title>
    <description>&lt;p&gt;Discuz! X3.1 - Relatively new integrated engine powered by Comsenz (developer Discuz !, UCenter, UCHome, ECShop, ECMall, ...). The main purpose of the engine - the simplification of the integration of different services on one site. In fact it is a new technology, a software solution made in PHP and MySQL to create a high-performance and multi-functional resource with elements of social network. Roughly speaking - a symbiosis of a social network and forum in one. I would like to inform you that for non-commercial use of this forum is completely free!With this release, developers have released version, which differs radically from the previous lines: X1, X1.5, X2, X2.0, X2.5, X3!The latest versions of webmasters are faced with a very large volume of spam, hacking, and stealing accounts, mainly due to non-compliance with basic requirements by the webmasters and, in this regard, the developers were forced to release an updated version of Discuz X3.1, which completely solve these problems and other urgent and important issues.Version Discuz! X3.1 is different from previous versions of the logical completeness and perfection.While working with previous versions we have researched and developed a special concept for the continuity and improvement of Discuz! X3.1 based on &amp;quot;classic&amp;quot; bases, as a result, there was an updated version of the multiplayer engine Discuz! X3.1.As written by the developers, Discuz! X3.1 - a symbiosis (centralized management of three purged: Discuz! 7.2, Uchome 2.0, Supesite). &lt;/p&gt;&lt;p&gt;As a result, you get a forum, user\'s sites, the main site - portal (programmable via Viso Editor), ranking all partitions and users (Hall of Fame), the user community, with the organization of the subdomain (as well as the sites users), various services, applications and basic plugins.In the version of Discuz! X3.1 possible to enable or disable the main modules: forum portal article, my world, Hall of Fame, question and answer (* FAQ), etc.In Discuz! X3.1 we implemented cloud technologies, improved and fixed known safety issues optmimizirovali core, thus reducing the burden on hosting more than before.The cloud technologies have been introduced:&lt;/p&gt;&lt;p&gt;The security code (CAPTCHA). CAPTCHA This robust and impenetrable for robots and spammers.Cloud control over IP. Creating black and white lists of IP addresses. On our server, we are the base of spammers (blacklist of IP addresses).Control of suspicious behavior User Accounts.Helper optimization and security.The mechanism of reports and notifications.The mechanism that allows you to keep your site up to the mark in the aspects of internal and external security.The mechanisms of the safety assessment to help and suggest the webmaster using notifications.You will be pleasantly surprised by the innovations that have appeared in the version of Discuz! X3.1, so be prepared for surprises!First: to add new modules to the core structure.Second, enhanced engine protection.Third: users and administrators become much more comfortable and convenient to operate, and to while away the time chatting online, made on Discuz.The basic architecture is based on the MVC (PLO). The engine works on PHP + MySQL and includes the following services:- Portal- Blogs- Albums- Communities (groups, circles)- Forum- Custom application- Search- Built-in local currency- Balance of users- Currency exchange points- Purchase / sale of products / electronic products- Purchase special props - equipment to enable specific functions on the site- Ability to integrate with other services that use UCenter API- Reviews- Subscriptions- CollectionsPersonally, my impression, Discuz! X3.1 - this engine, deserves special attention.I want to mention an important detail: that due to the correct engine architecture built on Smarty and correctly assembled core Discuz! X3.1 provides a minimum load on the server. Qualitatively, built with the support of optimization: Redis, APC, wincache, memcache, eAccelerator, Xcache.The abundant use AJAX, the templates are practically no characters, all rendered in Lang files.Although Lang files and can be translated into any language, but the simultaneous use of multiple languages is not provided as a class. In DiscuzX a lot of language files (I counted 128 pieces), plus the need to transfer more and JavaScript files, they not too little ...&lt;/p&gt;</description>
    <info_more>&lt;p&gt;When evading found bugs in this thread: http://chinascript.ru/forum-346-1.htmlWe hope for your help in testing, and translation and localization Discuz! X.We are constantly working to improve the localization of Discuz! X, please do not remove copyright developers and translators, respect our work!Tool updates and description of the update we have placed in the release. Read the instructions for installing and updating folder READ !!! .You are able to, besboleznenno update and upgrade to the latest version from any version of Discuz! X - read how to update Discuz.Successful prosperity for your projects!Sincerely, Your Team Chinascript.ru&lt;/p&gt;</info_more>
    <price>0.15</price>
    <currency>usd</currency>
    <type>0</type>
    <unique>0</unique>
    <good_num>1</good_num>
    <size_file>15434840</size_file>
    <mime>zip</mime>
    <hash_md5>da77efae02883c240c12f177f5a5f212</hash_md5>
    <sales>81</sales>
    <user_id>169</user_id>
    <agent>10</agent>
    <gift>5</gift>
    <return>0</return>
    <moneyback>30</moneyback>
    <id_category>409</id_category>
    <date_create>1442066442</date_create>
    <cnt_reviews_negative>0</cnt_reviews_negative>
    <cnt_reviews_positive>0</cnt_reviews_positive>
  </good>
  <seller>
    <id>169</id>
    <username>John Wallker</username>
    <shop>Banshee</shop>
    <cnt_reviews_negative>0</cnt_reviews_negative>
    <cnt_reviews_positive>0</cnt_reviews_positive>
  </seller>
  <images cnt="1">
    <img pic="0" type="original">http://axefile.com/uploads/users/169/images/goods/1222/3a56c77ab854503e3eafa79f6cf1fba5.jpg</img>
    <img pic="0" type="middle">http://axefile.com/uploads/users/169/images/goods/1222/middle/3a56c77ab854503e3eafa79f6cf1fba5.jpg</img>
    <img pic="0" type="thumb">http://axefile.com/uploads/users/169/images/goods/1222/thumb/3a56c77ab854503e3eafa79f6cf1fba5.jpg</img>
  </images>
  <gateways cnt="11">
    <gateway id="0">
      <id>1</id>
      <title>Webmoney (WMR)</title>
      <description>WebMoney (WMR) - an electronic payment system in the currency of the Russian ruble.</description>
      <percent>0.80</percent>
      <price>10.05</price>
      <price_with_percent>10.13</price_with_percent>
      <currency>rub</currency>
    </gateway>
    <gateway id="1">
      <id>3</id>
      <title>Webmoney (WMZ)</title>
      <description>WebMoney (WMZ) - an electronic payment system in the currency of US dollars.</description>
      <percent>0.80</percent>
      <price>0.15</price>
      <price_with_percent>0.15</price_with_percent>
      <currency>usd</currency>
    </gateway>
    <gateway id="2">
      <id>4</id>
      <title>Webmoney (WME)</title>
      <description>WebMoney (WME) - an electronic payment system in the euro currency.</description>
      <percent>0.80</percent>
      <price>0.14</price>
      <price_with_percent>0.14</price_with_percent>
      <currency>eur</currency>
    </gateway>
    <gateway id="3">
      <id>2</id>
      <title>Webmoney (WMU)</title>
      <description>WebMoney (WMU) - an electronic payment system in the Ukrainian hryvnia currency.</description>
      <percent>0.80</percent>
      <price>3.54</price>
      <price_with_percent>3.57</price_with_percent>
      <currency>uah</currency>
    </gateway>
    <gateway id="4">
      <id>7</id>
      <title>Yandex.Money (purse)</title>
      <description>Yandex.Money (purse) - a convenient and secure payment system for making online payments and any other transactions with electronic money.</description>
      <percent>0.50</percent>
      <price>10.05</price>
      <price_with_percent>10.10</price_with_percent>
      <currency>rub</currency>
    </gateway>
    <gateway id="5">
      <id>8</id>
      <title>Yandex.Money (card)</title>
      <description>Yandex.Money (VISA / MasterCard - Russian ruble) - a convenient and secure payment system for making online payments and any other transactions with electronic money.</description>
      <percent>3.00</percent>
      <price>10.05</price>
      <price_with_percent>10.35</price_with_percent>
      <currency>rub</currency>
    </gateway>
    <gateway id="6">
      <id>11</id>
      <title>Liqpay (VISA/MasterCard)</title>
      <description>Liqpay (VISA / MasterCard - American Dollar) - Internet payment system was developed by experts of the center of e-business Privat, as an alternative to Western Union and PayPal. LiqPay - open payment system that allows you to transfer money via mobile phone, Internet and payment cards around the world, including the people of Russia and Ukraine.</description>
      <percent>3.00</percent>
      <price>0.15</price>
      <price_with_percent>0.15</price_with_percent>
      <currency>usd</currency>
    </gateway>
    <gateway id="7">
      <id>10</id>
      <title>Liqpay (VISA/MasterCard)</title>
      <description>Liqpay (VISA / MasterCard - Russian ruble) - Internet payment system was developed by experts of the center of e-business Privat, as an alternative to Western Union and PayPal. LiqPay - open payment system that allows you to transfer money via mobile phone, Internet and payment cards around the world, including the people of Russia and Ukraine.</description>
      <percent>3.00</percent>
      <price>10.05</price>
      <price_with_percent>10.35</price_with_percent>
      <currency>rub</currency>
    </gateway>
    <gateway id="8">
      <id>9</id>
      <title>Liqpay (VISA/MasterCard)</title>
      <description>Liqpay (VISA / MasterCard - Ukrainian hryvnia) - Internet payment system was developed by experts of the center of e-business Privat, as an alternative to Western Union and PayPal. LiqPay - open payment system that allows you to transfer money via mobile phone, Internet and payment cards around the world, including the people of Russia and Ukraine.</description>
      <percent>3.00</percent>
      <price>3.54</price>
      <price_with_percent>3.65</price_with_percent>
      <currency>uah</currency>
    </gateway>
    <gateway id="9">
      <id>12</id>
      <title>Liqpay (VISA/MasterCard)</title>
      <description>Liqpay (VISA / MasterCard - European Euro) - Internet payment system was developed by experts of the center of e-business Privat, as an alternative to Western Union and PayPal. LiqPay - open payment system that allows you to transfer money via mobile phone, Internet and payment cards around the world, including the people of Russia and Ukraine.</description>
      <percent>3.00</percent>
      <price>0.14</price>
      <price_with_percent>0.14</price_with_percent>
      <currency>eur</currency>
    </gateway>
    <gateway id="10">
      <id>13</id>
      <title>Z-Payment</title>
      <description>Z-Payment - electronic payment system, integrating the different types of payment, such as payment by SMS, bank transfers, payments by card and others.</description>
      <percent>0.00</percent>
      <price>10.05</price>
      <price_with_percent>10.05</price_with_percent>
      <currency>rub</currency>
    </gateway>
  </gateways>
  <status status_descr="Successful sending a response from the API-server">success</status>
</response>

JSON response to the request (Example)

//The answer comes to JSON format, but we have to render its conclusions in the form of a data array (PHP):
print_r(json_decode($json_data, TRUE);)
Array
(
    [good] => Array
        (
            [id] => 1222
            [title] => Russian release CMS Discuz X3.1 20140301 from TEAM Chinascript.ru
            [description] => Discuz! X3.1 - Relatively new integrated engine powered by Comsenz (developer Discuz !, UCenter, UCHome, ECShop, ECMall, ...).
            [info_more] => When evading found bugs in this thread: http://chinascript.ru/forum-346-1.html...
            [price] => 0.15
            [currency] => usd
            [type] => 0
            [unique] => 0
            [good_num] => 1
            [size_file] => 15434840
            [mime] => zip
            [hash_md5] => da77efae02883c240c12f177f5a5f212
            [sales] => 81
            [user_id] => 169
            [agent] => 10
            [gift] => 5
            [return] => 0
            [moneyback] => 30
            [id_category] => 409
            [date_create] => 1442066442
            [cnt_reviews_negative] => 0
            [cnt_reviews_positive] => 0
        )
 
    [seller] => Array
        (
            [id] => 169
            [username] => John Wallker
            [shop] => Banshee
            [cnt_reviews_negative] => 0
            [cnt_reviews_positive] => 0
        )
 
    [images] => Array
        (
            [orig] => Array
                (
                    [0] => http://axefile.com/uploads/users/169/images/goods/1222/3a56c77ab854503e3eafa79f6cf1fba5.jpg
                )
 
            [middle] => Array
                (
                    [0] => http://axefile.com/uploads/users/169/images/goods/1222/middle/3a56c77ab854503e3eafa79f6cf1fba5.jpg
                )
 
            [thumb] => Array
                (
                    [0] => http://axefile.com/uploads/users/169/images/goods/1222/thumb/3a56c77ab854503e3eafa79f6cf1fba5.jpg
                )
 
        )
 
    [gateways] => Array
        (
            [0] => Array
                (
                    [id] => 1
                    [title] => Webmoney (WMR)
                    [description] => WebMoney (WMR) - an electronic payment system in the currency of the Russian ruble.
                    [percent] => 0.80
                    [price] => 10.05
                    [price_with_percent] => 10.13
                    [currency] => rub
                )
 
            [1] => Array
                (
                    [id] => 3
                    [title] => Webmoney (WMZ)
                    [description] => WebMoney (WMZ) - an electronic payment system in the currency of US dollars.
                    [percent] => 0.80
                    [price] => 0.15
                    [price_with_percent] => 0.15
                    [currency] => usd
                )
 
            [2] => Array
                (
                    [id] => 4
                    [title] => Webmoney (WME)
                    [description] => WebMoney (WME) - an electronic payment system in the euro currency.
                    [percent] => 0.80
                    [price] => 0.14
                    [price_with_percent] => 0.14
                    [currency] => eur
                )
 
            [3] => Array
                (
                    [id] => 2
                    [title] => Webmoney (WMU)
                    [description] => WebMoney (WMU) - an electronic payment system in the Ukrainian hryvnia currency.
                    [percent] => 0.80
                    [price] => 3.54
                    [price_with_percent] => 3.57
                    [currency] => uah
                )
 
            [4] => Array
                (
                    [id] => 7
                    [title] => Yandex.Money (purse)
                    [description] => Yandex.Money (purse) - a convenient and secure payment system for making online payments and any other transactions with electronic money.
                    [percent] => 0.50
                    [price] => 10.05
                    [price_with_percent] => 10.10
                    [currency] => rub
                )
 
            [5] => Array
                (
                    [id] => 8
                    [title] => Yandex.Money (card)
                    [description] => Yandex.Money (VISA / MasterCard - Russian ruble) - a convenient and secure payment system for making online payments and any other transactions with electronic money.
                    [percent] => 3.00
                    [price] => 10.05
                    [price_with_percent] => 10.35
                    [currency] => rub
                )
 
            [6] => Array
                (
                    [id] => 11
                    [title] => Liqpay (VISA/MasterCard)
                    [description] => Liqpay (VISA / MasterCard - American Dollar) - Internet payment system was developed by experts of the center of e-business Privat, as an alternative to Western Union and PayPal. LiqPay - open payment system that allows you to transfer money via mobile phone, Internet and payment cards around the world, including the people of Russia and Ukraine.
                    [percent] => 3.00
                    [price] => 0.15
                    [price_with_percent] => 0.15
                    [currency] => usd
                )
 
            [7] => Array
                (
                    [id] => 10
                    [title] => Liqpay (VISA/MasterCard)
                    [description] => Liqpay (VISA / MasterCard - Russian ruble) - Internet payment system was developed by experts of the center of e-business Privat, as an alternative to Western Union and PayPal. LiqPay - open payment system that allows you to transfer money via mobile phone, Internet and payment cards around the world, including the people of Russia and Ukraine.
                    [percent] => 3.00
                    [price] => 10.05
                    [price_with_percent] => 10.35
                    [currency] => rub
                )
 
            [8] => Array
                (
                    [id] => 9
                    [title] => Liqpay (VISA/MasterCard)
                    [description] => Liqpay (VISA / MasterCard - Ukrainian hryvnia) - Internet payment system was developed by experts of the center of e-business Privat, as an alternative to Western Union and PayPal. LiqPay - open payment system that allows you to transfer money via mobile phone, Internet and payment cards around the world, including the people of Russia and Ukraine.
                    [percent] => 3.00
                    [price] => 3.54
                    [price_with_percent] => 3.65
                    [currency] => uah
                )
 
            [9] => Array
                (
                    [id] => 12
                    [title] => Liqpay (VISA/MasterCard)
                    [description] => Liqpay (VISA / MasterCard - European Euro) - Internet payment system was developed by experts of the center of e-business Privat, as an alternative to Western Union and PayPal. LiqPay - open payment system that allows you to transfer money via mobile phone, Internet and payment cards around the world, including the people of Russia and Ukraine.
                    [percent] => 3.00
                    [price] => 0.14
                    [price_with_percent] => 0.14
                    [currency] => eur
                )
 
            [10] => Array
                (
                    [id] => 13
                    [title] => Z-Payment
                    [description] => Z-Payment - electronic payment system, integrating the different types of payment, such as payment by SMS, bank transfers, payments by card and others.
                    [percent] => 0.00
                    [price] => 10.05
                    [price_with_percent] => 10.05
                    [currency] => rub
                )
 
        )
 
    [status] => success
    [status_descr] => Successful sending a response from the API-server
)

Response parameters (XML/JSON)

Name Description Data Type
good Product Attributes
good/idGood ID(integer)
good/titleProduct Name. It may be displayed in one of the languages ( ru - Russian, en - English ) that was specified in the query language .(string)
good/descriptionA detailed description of the goods. It may be displayed in one of the languages ( ru - Russian, en - English ) that was specified in the query language .(text)
good/info_moreAdditional Information. It may be displayed in one of the languages ( ru - Russian, en - English ) that was specified in the query language . (text)
good/priceSkonvertiruemaya value of the goods in the currency, which has been specified in the request (parameter “currency”)(decimal(12,2))
good/currencyThe currency, which has been specified in the request (parameter “currency”). Possible values​​:uah,usd,rub,eur(string)
good/typeProduct Type: 0 - archive file, 1 - arbitrary text, 2 - arbitrary code on a single line, 3 - 16-digit code (integer)
good/uniqueThe uniqueness of the product (single sale). 0 - sold unlimited number of times, 1 - is only sold once (integer)
good/good_numThe number of units available for sale. For product types type == 0 (File) и type == 1 (Arbitrary text) value is 1. For product types type == 2 (Arbitrary code) и type == 3 (Code 16-digit) value is always 1 or more. (integer)
good/size_fileSize of file in bytes. If the parameter is displayed type == 0 (File), the remaining values ​​is displayed: 0 (integer)
good/mimeMIME-type goods (more.... Displayed only when the parameters of the goods type == 0 (архивный файл), the remaining values ​​output: null (string)
good/hash_md5The calculation of the checksum file algorithm MD5. Displayed only when the parameters of the goods type == 0 (архивный файл), the remaining values ​​output: null (string)
good/salesThe number of sales of goods (integer)
good/user_idSeller ID (integer)
good/agentPartner remuneration to the agent for the sale of this product, expressed as a percentage (%). (integer)
good/giftBonus buyer a percentage (%) of the value of goods for the positive feedback on this product (integer)
good/returnThe number of product returns (integer)
good/moneybackNumber of days period to return the funds paid by the buyer (Moneyback) (integer)
good/id_categoryCategory ID for the goods (integer)
good/date_createDate Product format *unix time stamp (integer)
good/cnt_reviews_negativeNegative feedbacks Product (integer)
good/cnt_reviews_positivePositive feedbacks Product (integer)
seller Properties Seller
seller/idSeller ID (integer)
seller/usernameFirst Name and Last Name of The Seller (string)
seller/shopName of shop (string)
seller/cnt_reviews_negativeThe number of negative feedbacks (all) Seller (integer)
seller/cnt_reviews_positiveThe amount of positive feedbacks (all) seller (integer)
images Product images
images/img (XML)The path to the product image to the original size.
Where XML-attribute @pic - to which the picture relates (serial number of pictures),
XML-attribute @type - image size: orig (original) / middle (254x254px) / thumb (85x85px)
(string)
images/orig/[0-9] (JSON)Path to Item picture with original size. (string)
images/middle/[0-9] (JSON)The path to the image to the size of the goods 254x254px. (string)
images/thumb/[0-9] (JSON)The path to the image to the size of the goods 85x85px. (string)
gateways Payment systems available to Dunn goods and the seller. (XML) - it has an attribute cnt - the number of payment gateways
gateways (XML)/gateway/Contains XML-Attribute with the serial number of the payment system
gateways (JSON)/gateway/[0-9]The sequence number of the payment system
gateways/gateway/id ID payment system (integer)
gateways/gateway/title The name of the payment system. It may be displayed in one of the languages ( ru - Russian, en - English ) that was specified in the query language . (string)
gateways/gateway/description Brief description of the payment system. It may be displayed in one of the languages ( ru - Russian, en - English ) that was specified in the query language . (string)
gateways/gateway/percent Commission payment system (%) (decimal(12,1))
gateways/gateway/price Cost of goods without payment of commissions (decimal(12,2))
gateways/gateway/price_with_percent Cost of goods with the commission payment system (decimal(12,2))
gateways/gateway/currency The name of the currency. Possible values​​: uah,usd,rub,eur (integer)
status (XML)The status of the response from the API server: success - successfully completed, error - error. For a more complete understanding of the tag is transferred XML-Attribute @status_descr - status description (string)
status (JSON)The status of the response from the API server: success - successfully completed, error - error. (string)
status_descr (JSON)Description of the status of the response from the API server. (string)

Data for payment form

The example of the implementation of the payment form (PHP)


Action https://axefile.com/en/pay/go - where “en” - the language to display the final form of payment (ru - Russian, en - English)
Method POST

Form fields

Name Status Description Detail
merchantrequiredThe unique ID of the merchant (ID of the seller/partner)(integer)
signaturerequiredThe signature request (string{64})
good_idrequiredUnique ID of the product (integer)
pricerequiredCost of goods without commission payment systems(decimal(12,2))
quantityrequiredQuantity of goods. For the type of goods type=0 и type=1: 1 (тип поля “hidden”) and for the product types type=2 и type=3: от 1 и более (тип поля “text”) (integer)
currrequiredThe currency, which has been specified in the request. Possible currency: uah,usd,rub,eur. Default: usd (string)
select_gateway_idrequiredThe selected buyer payment system to pay for the goods(integer)
email_payerrequiredBuyer Email(string)

To obtain and use API-solutions you need to log in using the login form for partners / sellers to get seretny key. If you are not registered as a partner, you can do it right now: go to the registration.

en/api_solutions/api_page_good_with_payment_form.txt · Last modified: 2016/03/08 10:23 by root