Merchant want to fetch order information from Hygglig.
Input
Name |
Type |
Description |
mid |
string |
Merchant’s key |
ordernr |
string |
This is Order number which Hygglig checkout return back at the time of order registration. |
mac |
string |
A mac or checksum generated from input parameters using merchant’s private key. |
Response
Name |
Description |
Checkout Order |
Order information in form of requested content-Type i.e xml, text or json object. |
Success |
True if no error, false if there is error. |
Error |
In case of an error this field contains the error description. |
Get checkout order information example code
$url = 'https://www.hygglig.com/Manage/api/CheckoutOrder/GetOrderInfo?mId=';
$url .= $merchantKey . '&ordernr=' . $orderNr . '&mac=';
$url .= sha1($orderNr . $secret);
//Store result
$result = json_decode(file_get_contents($url),true);
Response from example code
//Result example
-------------------------------------
array(3) {
["CheckoutOrder"]=>
array(19) {
["CheckoutOrderId"]=> string(36) "fb9dcbee-e505-485f-b5b2-c5b3814739a2"
["CheckoutOrderNr"]=> int(1100012345)
["MerchantId"]=> string(36) "00000000-0000-0000-0000-000000000000"
["Currency"]=> string(3) "SEK"
["MerchantOrderReference"]=> string(4) "1234"
["MerchantOrderDate"]=> string(22) "2015-12-11T09:55:36.19"
["CreatedTimestamp"]=> string(23) "2015-12-11T09:55:43.983"
["Timeout"]=> NULL
["AutoActivate"]=> bool(false)
["BuyerIP"]=> bool(false)
["MerchantIp"]=> NULL
["CheckoutOrderArticles"]=> array(2) {
[0]=> array(11) {
["CheckoutOrderArticleId"]=> string(36) "99283005-44a6-4763-9b07-6bbd4bc1d524"
["CheckoutOrderId"]=> string(36) "00000000-0000-0000-0000-000000000000"
["ArticleName"]=> string(21) "T5 Magic Red Aluminum"
["ArticleNumber"]=> int(8)
["Description"]=> string(149) "Amazing Jojo in Red Aluminum"
["Price"]=> float(11.16)
["Quantity"]=> float(1)
["VatValue"]=> float(0.25)
["CreatedTimestamp"]=> string(23) "2015-12-11T09:55:43.983"
["CancelledTimestamp"]=> NULL
["TotalPrice"]=> float(13.95)
}
[1]=> array(11) {
["CheckoutOrderArticleId"]=> string(36) "544c49d9-24b8-475b-9212-a9b9597844d9"
["CheckoutOrderId"]=> string(36) "00000000-0000-0000-0000-000000000000"
["ArticleName"]=> string(8) "SHIPPING"
["ArticleNumber"]=> int(999)
["Description"]=> string(22) "International Delivery"
["Price"]=> float(100)
["Quantity"]=> float(1)
["VatValue"]=> float(0.25)
["CreatedTimestamp"]=> string(23) "2015-12-11T09:55:43.983"
["CancelledTimestamp"]=> NULL
["TotalPrice"]=> float(125)
}
}
["Customer"]=> array(13) {
["PersonalInfoId"]=> string(36) "00000000-0000-0000-0000-000000000000"
["FirstName"]=> string(10) "Marginalen"
["LastName"]=> string(6) "Credit"
["Address"]=> string(17) "Valhallavägen 66"
["PostalCode"]=> string(5) "10000"
["City"]=> string(9) "Stockholm"
["Country"]=> NULL
["MobileNumber"]=> string(12) "+46700102030"
["PhoneNumber"]=> NULL
["Email"]=> string(22) "testcredit@hygglig.com"
["CreatedTimestamp"]=> string(19) "0001-01-01T00:00:00"
["CustomerEmailURLRequest"]=> NULL
["CustomerEmailURLRequestTimestamp"]=> NULL
}
["Letters"]=> array(0) {
}
["TotalActivatePrice"]=> float(138.95)
["TotalPrice"]=> float(138.95)
["TotalPriceWithoutVAT"]=> float(111.16)
["TotalActivePriceWithoutVAT"]=> float(111.16)
["Checksum"]=> NULL
}
["Success"]=> bool(true)
["Error"]=> NULL
}