src/Order.php
public function ship($purchaseOrderId, $order)
    {
        if(!is_numeric($purchaseOrderId)){
            throw new \Exception("purchaseOrderId must be numeric",1448480750);
        }

        $schema = [
            '/orderShipment' => [
                'namespace' => 'ns3',
                'childNamespace' => 'ns3',
            ],
            '/orderShipment/orderLines' => [
                'sendItemsAs' => 'orderLine',
            ],
            '/orderShipment/orderLines/orderLine/orderLineStatuses' => [
                'sendItemsAs' => 'orderLineStatus',
            ],
            '@namespaces' => [
                'ns3' => 'http://walmart.com/mp/v3/orders'
            ],
        ];

        $a2x = new A2X($order, $schema);
        $xml = $a2x->asXml();

        return $this->shipOrder([
            'purchaseOrderId' => $purchaseOrderId,
            'order' => $xml,
        ]);
    }
public function ship($purchaseOrderId, $order)
    {
        if(!is_numeric($purchaseOrderId)){
            throw new \Exception("purchaseOrderId must be numeric",1448480750);
        }

        $schema = [
            '/orderShipment' => [
                'namespace' => 'ns3',
                'childNamespace' => 'ns3',
            ],
            '/orderShipment/orderLines' => [
                'sendItemsAs' => 'orderLine',
            ],
            '/orderShipment/orderLines/orderLine/orderLineStatuses' => [
                'sendItemsAs' => 'orderLineStatus',
            ],
            '@namespaces' => [
                'ns3' => 'http://walmart.com/mp/v3/orders'
            ],
        ];

        $a2x = new A2X($order, $schema);
        $xml = $a2x->asXml();

        return $this->shipOrder([
            'purchaseOrderId' => $purchaseOrderId,
            'order' => $xml,
        ]);
    }
public function ship ( $ purchaseOrderId , $ order ) { if ( ! is_numeric ( $ purchaseOrderId ) ) { throw new \ Exception ( "purchaseOrderId must be numeric" , 1448480750 ) ; } $ schema = [ '/orderShipment' => [ 'namespace' => 'ns3' , 'childNamespace' => 'ns3' , ] , '/orderShipment/orderLines' => [ 'sendItemsAs' => 'orderLine' , ] , '/orderShipment/orderLines/orderLine/orderLineStatuses' => [ 'sendItemsAs' => 'orderLineStatus' , ] , '@namespaces' => [ 'ns3' => 'http://walmart.com/mp/v3/orders' ] , ] ; $ a2x = new A2X ( $ order , $ schema ) ; $ xml = $ a2x -> asXml ( ) ; return $ this -> shipOrder ( [ 'purchaseOrderId' => $ purchaseOrderId , 'order' => $ xml , ] ) ; }
Ship an order
@param string $purchaseOrderId
@param array $order
@return array
@throws \Exception
Ship an order