【问题标题】:Amazon MWS ContentMD5DoesNotMatch亚马逊 MWS ContentMD5DoesNotMatch
【发布时间】:2016-11-01 20:27:51
【问题描述】:
<?php
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope>
    <Header>
        <DocumentVersion>1.01</DocumentVersion>
        <MerchantIdentifier>**SELLER ID**</MerchantIdentifier>
    </Header>
    <MessageType>Price</MessageType>
    <Message>
        <MessageID>1</MessageID>
        <Price>
            <SKU>2500le</SKU>
            <StandardPrice currency="GBP">110.58</StandardPrice>
        </Price>
    </Message>
</AmazonEnvelope>';

echo "<strong>Just MD5 </strong>".md5($xml)."</br>";
echo "<strong>Just MD5 BE64 </strong>".base64_encode(($xml))."</br>";
echo "<strong>Trimmed MD5 </strong>".md5(trim($xml))."</br>";
echo "<strong>Trimmed MD5 BE64 </strong>".base64_encode(md5(trim($xml)))."</br>";
echo "<strong>Just MD5 True </strong>".md5($xml, true)."</br>";
echo "<strong>Just MD5 True BE64 </strong>".base64_encode(md5($xml, true))."</br>";
echo "<strong>Just MD5 True Trimmed </strong>".md5(trim($xml), true)."</br>";
echo "<strong>Just MD5 True Trimmed BE64 </strong>".base64_encode(md5(trim($xml), true))."</br>";
?>

我正在尝试让我的内容 MD5 与亚马逊暂存器上的内容 MD5 匹配。

草稿本上完全相同的 XML 的 MD5 是:514f53797911925b337c4461c30ca003 基数为 64 的 MD5 为:UU9TeXkRklszfERhwwygAw==

我似乎根本无法匹配。

首先,任何人都可以看到我哪里出错了,有没有人有一些工作代码来做一个 CURL 帖子,以 _POST_PRODUCT_PRICING_DATA_ 的提要类型向亚马逊 MWS 提交提要?

我什么都试过了..

【问题讨论】:

    标签: php curl md5


    【解决方案1】:

    不知道你是否还在寻找这个问题的答案。

    但是,这是我的答案; 当您对 xml 进行 MD5 编码时,您必须使用第二个参数返回 MD5 的原始值;

    示例:

    $var = md5($xml,true)
    

    【讨论】:

      猜你喜欢
      • 2011-11-13
      • 2012-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-24
      • 2015-03-21
      相关资源
      最近更新 更多