I have two scripts, one is a Prestashop DHL label creator, and the other one is our company's internal sales application. I'm trying to combine the two together so we can generate DHL label from the application without visiting the shop's admin panel. And now to the core of the problem. The Prestashop DHL module sends a POST with parameters looking like this:
Receiver:Address:HouseNumber: #value
and our internal sales app sends POST with parameters looking like this:
Receiver[Address][HouseNumber]: #value
This may be a stupid question, but what's the difference?
Here's the code that generates the POST in our app
function generateDHLLabel()
{
jQuery.post("prestashop_link", {
DhlShipmentId:'',
DhlOrderId :'',
DhlShipmentCreationDateTime:'',
ShipmentPreset:{ldelim}ShipmentPresetId : 1{rdelim},
ServiceType: 'AH',
DropOffType: 'REGULAR_PICKUP',
LabelType: 'BLP',
Content: 'content',
Comment :'',
Reference: 5508,
ShippingPaymentType: 'SHIPPER',
PaymentType: 'BANK_TRANSFER',
BillingAccountNumber :'',
CostsCenter :'',
ShipmentDate: '2019-05-09',
ShipmentStartHour: '09:00',
ShipmentEndHour: '19:00',
ParcelIdent :'',
Postnummer :'',
ParcelPostalCode :'',
Receiver:{ldelim}
Address:{ldelim}Name: 'Name+Surname',
Street: 'Street+1',
HouseNumber:'',
ApartmentNumber:'',
OriginalAddressString: 'Name+Surname,+Street+1,+00-000+City,+Country',
ParseAlert:'',
PostalCode: '00000',
City: 'CITY',
Country: 'PL'{rdelim},
Contact:{ldelim}Name: 'Name+Surname',
Phone: '000000000',
Email: 'mail@domain.com'{rdelim}{rdelim},
Package:{ldelim}Type: 'PACKAGE',
Weight: '4',
Width: '30',
Height: '30',
Length: '20',
Quantity: '1'{rdelim},
SpecialServices:{ldelim}S_UBEZP: '1',
UBEZP_Value: '123.49',
UBEZP_CurrencyUnitAlert :'',
S_COD: '1',
COD_Value: '123.49',
COD_CurrencyUnitAlert:'',
ROD_Instruction :'',
OriginalCurrencyUnit: 'PLN'{rdelim},
Neighbour:{ldelim}Name:'',
Street:'',
HouseNumber:'',
ApartmentNumber:'',
PostalCode:'',
City:'',
Phone:'',
Email:''{rdelim},
Action:'Send'
}, function(data) {
window.location.href = '{site_url()}app/packing/order-packing/{$this->uri->segment(4)}';
});
}