![]() * Gets the query parameters as a String sorted in natural-byte order. = $this->getParameterString($parameters) Protected function calculateStringToSign(array $parameters) $this->calculateSignature($this->calculateStringToSign($this->parameters)) = $this->getParameterString($this->parameters). this part should change and depend on the method/parameter. $this->parameters = Constant::get('SignatureVersion') $this->parameters = Constant::get('SignatureMethod') $this->parameters = Constant::get('SellerId') $this->parameters = Constant::get('MarketplaceId.Id.1') ![]() $this->parameters = Constant::get('AWSAccessKeyId') $this->secretKey = Constant::get('SECRET_KEY') You'll just need to modify it slightly to fit your system. Here is some sample code that should give you a good place to start. $signature = urlencode(base64_encode($signature)) $signature = hash_hmac("sha256", $sign, $CHIAVE_SEGRETA, true) The Method I used to create the signature was find on stackoverflow and is the following: $sign = 'GET'. $CHIAVE_ACCESSO&Action=ListOrders&MarketplaceId=APJ6JRA9NG5V4&SellerId=$SELLER_ID&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=T19%3A13%3A01.000Z&Version=&Signature=Q9Xnr9JhtkzeLUAsCFKPln8SS34FkCQRmELE2WiIhPo%3D&CreatedAfter=T23%3A00%3A00Z What I would like to do is to make the request via PHP and elaborate the result.īut If I fist try to put the request on my browser like The results that shows the scratchpad are right. X-amazon-user-agent: AmazonJavascriptScratchpad/1.0 (Language=Javascript)Īnd the string to Sign (in the second box) is POSTĪWSAccessKeyId=$CHIAVE_ACCESSO&Action=ListOrders&CreatedAfter=T23%3A00%3A00Z&MarketplaceId.Id.1=APJ6JRA9NG5V4&SellerId=$SELLER_ID&Signat ureMethod=HmacSHA256&SignatureVersion=2&Timestamp=T18%3A58%3A52Z&Version= &MarketplaceId.Id.1=APJ6JRA9NG5V4 HTTP/1.1 The HTTP POST is POST /Orders/?AWSAccessKeyId=$CHIAVE_ACCESSO I'm trying to get the list of orders through the MWS Scratchpad. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |