Neu Json Response

Mikael

Neues Mitglied
27. November 2020
1
0
Hi,
i am working on connectr for one customer, whouse JTL in combination with an individual shop.
I should fond out how to connect to the Wawi from the shop to manage the data an so on.
I have no access to Wawi and so on i build without testing a response object of CustomOrder. I am not sure if i did it by the right way. The response looks to me strange. Here is a part of it:

{ "customerId": { "endpoint": "1234", "host": 0, "public": [ "1234", 0 ], "properties": [ "endpoint", "host" ] }, "id": { "endpoint": "", "host": 0, "public": [ "", 0 ], "properties": [ "endpoint", "host" ] }, "billingAddress": { "customerId": { "endpoint": "1234", "host": 0, "public": [ "1234", 0 ], "properties": [ "endpoint", "host" ] }, "id": { "endpoint": "123", "host": 0, "public": [ "123", 0 ], "properties": [ "endpoint", "host" ] }, "city": "Berlin", "company": "XYZ", "countryIso": "DE", "deliveryInstruction": "", "eMail": "test@example.com", "extraAddressLine": "", "fax": "", "firstName": "John", "lastName": "Boe", "mobile": "+49176555555", "phone": "", "salutation": "Mr.", "state": "Berlin", "street": "Kantstrasse", "title": "", "vatNumber": "1232131646", "zipCode": "10267", "modelType": ..................

As you see, i use setters of objects to set dummy data.
Host is empty as there is actually no mapping.

My Code looks like this:

$identity = new Identity();
$order = new CustomerOrder();
$customer = $this->getCustomer(); //Another function build the customer object with Identity Object
$order->setCustomerId($customer->getId());
$order->setId($identity->setEndpoint([$paramIndex]['orderId']));
$billingAddress = $this->getBillingAddress($customer);//Another function build the customer object with Identity Object
$order->setBillingAddress($billingAddress);
$order->setCarrierName('DHL');
$order->setCreationDate(new \DateTime($this->params[$paramIndex]['creationDate']));
$order->setCurrencyIso('EUR');
......

Is it the right way, i am forwarding on building the json response. To me look the json response strong as it contains for eaxh property too many data. i accepted to get something like
:
("customerId":"1234".........)

Thanks for answers

Regards