Files
MiraviaConnector/connector-miravia/classes/Services/Miravia/Order.php
Miravia Connector Bot 752600f337 Fix image upload structure for Miravia API compliance
🔧 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>
2025-07-21 11:34:59 +02:00

66 lines
2.4 KiB
PHP

<?php
namespace Sweeper\PlatformMiddleware\Services\Miravia;
use Sweeper\PlatformMiddleware\Services\Aliexpress\Base;
/**
* AliExpress - Miravia 订单相关接口
* Created by Sweeper PhpStorm.
* Author: Sweeper <wili.lixiang@gmail.com>
* DateTime: 2024/2/26 16:25
* @Package \Sweeper\PlatformMiddleware\Services\Miravia\Order
*/
class Order extends Base
{
/**
* Miravia订单列表查询
* User: Sweeper
* Time: 2023/7/7 10:58
* @doc https://open.aliexpress.com/doc/api.htm?spm=a2o9m.11193487.0.0.35096f3dtoF70t#/api?cid=21394&path=arise.order.list.query&methodType=GET/POST
* @param array $accountInfo
* @param array $params
* @return mixed
*/
public function getOrderList(array $accountInfo, array $params = [])
{
$response = static::executeRequest($accountInfo, 'arise.order.list.query', $params, 'param0', ['current_page', 'open_channel', 'channel_seller_id']);
return $response->arise_order_list_query_response->result ?? $response->result ?? $response;
}
/**
* Miravia订单详情查询
* User: Sweeper
* Time: 2023/7/7 10:58
* @doc https://open.aliexpress.com/doc/api.htm?spm=a2o9m.11193487.0.0.35096f3dtoF70t#/api?cid=21394&path=arise.order.detail.query&methodType=GET/POST
* @param array $accountInfo
* @param array $params
* @return mixed
*/
public function getOrderDetail(array $accountInfo, array $params = [])
{
$response = static::executeRequest($accountInfo, 'arise.order.detail.query', $params, 'param0', ['trade_order_id', 'open_channel', 'channel_seller_id']);
return $response->arise_order_detail_query_response->result ?? $response->result ?? $response;
}
/**
* Miravia订单设置备注
* User: Sweeper
* Time: 2023/7/7 10:58
* @doc https://open.aliexpress.com/doc/api.htm?spm=a2o9m.11193487.0.0.35096f3dtoF70t#/api?cid=21394&path=arise.order.memo.set&methodType=GET/POST
* @param array $accountInfo
* @param array $params
* @return mixed
*/
public function setMemo(array $accountInfo, array $params = [])
{
$response = static::executeRequest($accountInfo, 'arise.order.memo.set', $params, 'param0', ['trade_order_id', 'open_channel', 'channel_seller_id']);
return $response->arise_order_memo_set_response->result ?? $response->result ?? $response;
}
}