I'm trying to implement a module very similar to the one in the Webhooks section:
//Cloud Script var url = "https://api.yoursite.com/playfab_call/request_token"; var method = "post"; var contentBody = "grant_type=client_credentials"; var contentType = "application/x-www-form-urlencoded"; var headers = {}; Headers["client_id"] = clientId; Headers["client_secret"] = clientSecret; var tokenResponse = http.request(url,method,contentBody,contentType,headers);
Here is my code:
var BOACOMPRA_URL = "https://ws.sandbox.pagseguro.uol.com.br/v2/checkout"; handlers.StartPurchaseBO = function (args) { var itemRef = args.Items[0]; var item = GetCatalogItem("Coin Packs", itemRef.ItemId); var method = "post"; var contentType = "application/x-www-form-urlencoded; charset=ISO-8859-1"; var headers = {}; var contentBody = {}; contentBody["token"] = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; contentBody["currency"] = 'BRL'; contentBody["itemId1"] = item.ItemId; contentBody["itemDescription1"] = 'TEST'; contentBody["itemAmount1"] = item.VirtualCurrencyPrices.RM; var tokenResponse = http.request(BOACOMPRA_URL, method, contentBody, contentType, headers); return tokenResponse; }
But it seems that playfab http.request doesn't support these arguments as you see in the log:
Error: The best overloaded method match for 'PlayFab.LogicServer.Source.PlayFabAPI.http_request(string, string, string, string, string, bool)' has some invalid arguments\n at Error (native)\n at handlers.StartPurchaseBO (2A7D-main.js:633:31)
How can I solve this issue?
Thanks,