首页 > 解决方案 > 我无法打开解密的 Amazon Selling Partner Feed 文档

问题描述

当我尝试读取文件时,我看到了这张图片。这是正常的吗?

在此处输入图像描述

我的代码

 public function openTheFeedDocument() {

        $data = json_decode($this->getFeedDocument());

        $url = $data->payload->url;
        $iv  = base64_decode($data->payload->encryptionDetails->initializationVector);
        $key = base64_decode($data->payload->encryptionDetails->key);

        $decryptedData = openssl_decrypt(file_get_contents($url), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);

        $raw_document =  mb_convert_encoding($decryptedData, 'UTF-8', 'ASCII, JIS, UTF-8, SJIS');

        echo $raw_document;
    }

标签: phpamazonselling-partner-api

解决方案


推荐阅读