🔧 Bug Fixes: - Fixed product image structure to match Miravia API requirements - Updated MiraviaProduct.php getData() method to wrap images in {"Image": [...]} format - Updated MiraviaCombination.php getData() method to wrap SKU images properly - Resolved error "[4224] The Main image of the product is required" 📋 Changes: - Modified getData() methods to transform flat image arrays to nested structure - Product images: images[] → Images: {"Image": [...]} - SKU images: images[] → Images: {"Image": [...]} - Maintains backward compatibility for empty image arrays 🎯 Impact: - Product uploads will now pass Miravia's image validation - Both product-level and SKU-level images properly formatted - Complies with official Miravia API documentation structure 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: Sweeper
|
|
* Time: 2022/12/29 15:06
|
|
*/
|
|
|
|
namespace Sweeper\PlatformMiddleware\Services\Aliexpress\OpenApi;
|
|
|
|
use Sweeper\PlatformMiddleware\Sdk\AeSdk\IopClient;
|
|
use Sweeper\PlatformMiddleware\Sdk\AeSdk\IopRequest;
|
|
use Sweeper\PlatformMiddleware\Sdk\AeSdk\UrlConstants;
|
|
use Sweeper\PlatformMiddleware\Services\Aliexpress\Base;
|
|
|
|
class Decrypt extends Base
|
|
{
|
|
|
|
/**
|
|
* 买家订单物流详情解密
|
|
* Author: Sweeper <wili.lixiang@gmail.com>
|
|
* DateTime: 2024/3/19 14:46
|
|
* @doc https://open.aliexpress.com/doc/api.htm?spm=a2o9m.11193487.0.0.6dc86f3dwkNxPS#/api?cid=20905&path=aliexpress.trade.seller.order.decrypt&methodType=GET/POST
|
|
* @param array $accountInfo
|
|
* @param $orderId
|
|
* @param $oaid
|
|
* @return mixed
|
|
* @throws \Throwable
|
|
*/
|
|
public function decrypt(array $accountInfo, $orderId, $oaid)
|
|
{
|
|
$client = new IopClient(UrlConstants::API_GATEWAY_URL, $accountInfo['app_key'], $accountInfo['secret_key']);
|
|
$request = new IopRequest('aliexpress.trade.seller.order.decrypt');
|
|
$request->addApiParam('orderId', $orderId);
|
|
$request->addApiParam('oaid', $oaid);
|
|
$response = $client->execute($request, $accountInfo['access_token']);
|
|
|
|
return $response->aliexpress_trade_seller_order_decrypt_response ?? $response;
|
|
}
|
|
|
|
}
|