summaryrefslogtreecommitdiff
path: root/indra/newview/llmarketplacefunctions.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-05-07 14:51:36 -0700
committerMerov Linden <merov@lindenlab.com>2014-05-07 14:51:36 -0700
commitbd0d62c339d197ec2fa50cc642a864071677dc3a (patch)
tree2e75bee19139b70c5712752fcf639ab3808cfe03 /indra/newview/llmarketplacefunctions.cpp
parente916b47f12ba0e84ee6b1faed687b920e49633f8 (diff)
DD-22 : WIP : Partial implementation of PUT associate_listing
Diffstat (limited to 'indra/newview/llmarketplacefunctions.cpp')
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 15c1630a2a..701d341753 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -301,6 +301,29 @@ public:
}
}
};
+
+class LLSLMAssociateListingsResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLSLMAssociateListingsResponder);
+public:
+
+ LLSLMAssociateListingsResponder() {}
+
+ virtual void completed(U32 status, const std::string& reason, const LLSD& content) { }
+
+ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+ {
+ if (isGoodStatus(status))
+ {
+ LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_MERCHANT);
+ }
+ else
+ {
+ log_SLM_error("Get merchant", status, reason, content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
// SLM Responders End
///////////////////////////////////////////////////////////////////////////////
@@ -902,6 +925,23 @@ void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id
}
// PUT /associate_inventory/:listing_folder_id/:version_folder_id/:listing_id
+void LLMarketplaceData::associateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id)
+{
+ LLSD headers = LLSD::emptyMap();
+ headers["Accept"] = "application/json";
+ headers["Content-Type"] = "application/json";
+
+ LLSD data = LLSD::emptyMap();
+
+ // Send request
+ std::string url = getSLMConnectURL("/associate_inventory/")
+ + folder_id.asString() + "/"
+ + version_id.asString() + "/"
+ + llformat("%d",listing_id);
+
+ llinfos << "Merov : associate listing : " << url << llendl;
+ LLHTTPClient::put(url, data, new LLSLMAssociateListingsResponder(), headers);
+}
std::string LLMarketplaceData::getSLMConnectURL(const std::string& route)
{