To connect to Magento SOAP web services, load the WSDL into your SOAP client from this URL: https://www.mygiftcard.it/api/v2_soap?wsdl=1 (Click here to see complete WSDL)
Genaral faults | ||
---|---|---|
Code | Message | |
0 | Unknown Error | |
1 | Internal Error. Please see log for details | |
2 | Access denied | |
3 | Invalid api path | |
4 | Resource path is not callable |
login((string) apiUser, (string) apiKey)
Every call to Magento web-servicces need an authentication obtained calling login method with these parametsrs:
If authentication was successful a session is started for next API calls. Site administrator will provide credentials needed.
|
||||||||||||
|
epipoliCheckPin((string) sessionId, (string) pin)
If correct, returns an array containing the list of fields of the beneficiary's form.
|
|||||||||||||||
|
|||||||||||||||
|
epipoliRegisterData((string) sessionId, (string) pin, (array) data)
Receives the array of data and tries to register them.
|
|||||||||||||||
|
|||||||||||||||
|
epipoliBlockPin((string) sessionId, (string) pin, (integer) serial_number)
Checks the pin and tries to block it. At least one of two parameters serial number or pin code is required.
|
|||||||||||||||
|
|||||||||||||||
|
epipoliEcommOrderPinActivation((string) sessionId, (string) pin, [(string) card_code1], [(string) card_code2])
Searches the pin in the orders table and activates it.
|
||||||||||||||||||
|
||||||||||||||||||
|
Type | Name | Description |
---|---|---|
epipoliCheckPinFieldsEntity | fields | array containing all saveable data |
associativeArray | pin_info | array containing all details of the PIN that must be activated |
associativeArray | card_info | array containing all the details of the card that must be activated |
string | card_ean | EAN of the card |
string | sold_at | Date sold |
Type | Name | Description |
---|---|---|
string | name | Field name |
boolean | required | If the field is required or not |
associativeArray | values | Value labels pairs that field can assume (tipically for select inputs) |
Type | Name | Description |
---|---|---|
string | key | Key of the array |
string | value | Value of the array |
$client = new SoapClient('http://fabdev.mygiftcard.it/index.php/api/v2_soap?wsdl=1');
$sessionId = $client->login('apiUser', 'apiKey'); //authentication
$pin = "123456";
$checkpinResult = $client->epipoliCheckPin($sessionId, $pin);
$data = array(
array("key" => "value_of_key1", "value" => "value_of_value1"),
array("key" => "value_of_key2", "value" => "value_of_value3")
);
$registerDataResult = $client->epipoliRegisterData($sessionId, $pin, $data);
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:epipoliCheckPinResponse>
<result xsi:type="ns1:epipoliCheckPinResponseEntity">
<fields SOAP-ENC:arrayType="ns1:epipoliCheckPinFieldsEntity[6]" xsi:type="ns1:epipoliCheckPinFieldsEntityArray">
<item xsi:type="ns1:epipoliCheckPinFieldsEntity">
<name xsi:type="xsd:string">email</name>
<required xsi:type="xsd:boolean">true</required>
</item>
<item xsi:type="ns1:epipoliCheckPinFieldsEntity">
<name xsi:type="xsd:string">privacy</name>
<required xsi:type="xsd:boolean">true</required>
</item>
<item xsi:type="ns1:epipoliCheckPinFieldsEntity">
<name xsi:type="xsd:string">privacy2</name>
<required xsi:type="xsd:boolean">false</required>
</item>
<item xsi:type="ns1:epipoliCheckPinFieldsEntity">
<name xsi:type="xsd:string">codice_carta</name>
<required xsi:type="xsd:boolean">true</required>
</item>
<item xsi:type="ns1:epipoliCheckPinFieldsEntity">
<name xsi:type="xsd:string">select</name>
<required xsi:type="xsd:boolean">false</required>
<values SOAP-ENC:arrayType="ns1:associativeEntity[3]" xsi:type="ns1:associativeArray">
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">val1</key>
<value xsi:type="xsd:string">label1</value>
</item>
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">val2</key>
<value xsi:type="xsd:string">label2</value>
</item>
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">val3</key>
<value xsi:type="xsd:string">label3</value>
</item>
</values>
</item>
<item xsi:type="ns1:epipoliCheckPinFieldsEntity">
<name xsi:type="xsd:string">agreement</name>
<required xsi:type="xsd:boolean">true</required>
</item>
</fields>
<pin_info SOAP-ENC:arrayType="ns1:associativeEntity[2]" xsi:type="ns1:associativeArray">
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">serial_number</key>
<value xsi:type="xsd:string">1234567890</value>
</item>
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">lotto</key>
<value xsi:type="xsd:string">83</value>
</item>
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">prezzo_vendita</key>
<value xsi:type="xsd:string">9.99</value>
</item>
</pin_info>
<card_info SOAP-ENC:arrayType="ns1:associativeEntity[2]" xsi:type="ns1:associativeArray">
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">taglio</key>
<value xsi:type="xsd:string">10.00</value>
</item>
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">name</key>
<value xsi:type="xsd:string">Carta Prepagata MasterCard 200€</value>
</item>
</card_info>
<card_ean xsi:type="xsd:string">1234567890</card_ean>
<sold_at xsi:type="xsd:string">2015-03-16 10:04:10</sold_at>
</result>
</ns1:epipoliCheckPinResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento">
<soapenv:Header/>
<soapenv:Body>
<urn:epipoliRegisterData soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sessionId xsi:type="xsd:string">4687acc870ed855840dec99b0dd2fe2a</sessionId>
<pin xsi:type="xsd:string">1234567890</pin>
<data xsi:type="urn:associativeArray" soapenc:arrayType="xsd:associativeEntity[]">
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">email</key>
<value xsi:type="xsd:string">test@test.com</value>
</item>
<item xsi:type="ns1:associativeEntity">
<key xsi:type="xsd:string">privacy</key>
<value xsi:type="xsd:string">1</value>
</item>
</data>
</urn:epipoliRegisterData>
</soapenv:Body>
</soapenv:Envelope>