Closed ZieClaw closed 5 years ago
Mmm what is exactly your problem? You see this <email[object Object]>this.email in the payload? Can you somehow create a plunkr where I can check?
Yes the [object Object] tags are in the operation.xml payload. They are present for all the objects in the customerData object, so from email to customer_activated.
It only happens with nested objects. I'll try and make a plunkr, when I have the time for it.
Here is the generated XML:
@ZieClaw I had some further tests using the latest version.
json body:
const body: any = {
CustomerSelectionByElements: {
SelectionByCategoryCode: {
InclusionExclusionCode: 'I',
IntervalBoundaryTypeCode: categoryCode ? 1 : 3,
LowerBoundaryCategoryCode: categoryCode || 1,
UpperBoundaryCategoryCode: categoryCode ? '' : 2
},
},
ProcessingConditions: {
QueryHitsMaximumNumberValue: maxResults || 10,
QueryHitsUnlimitedIndicator: false
}
};
and the generated xml:
<n2:CustomerByElementsQuery_sync xmlns:n2="http://sap.com/xi/SAPGlobal20/Global">
<CustomerSelectionByElements>
<SelectionByCategoryCode>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryCategoryCode>2</LowerBoundaryCategoryCode>
<UpperBoundaryCategoryCode></UpperBoundaryCategoryCode>
</SelectionByCategoryCode>
</CustomerSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>5</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
</n2:CustomerByElementsQuery_sync>
If I've understood well your problem, it seems to be solved now.
Please let me know.
You can download version 0.5.0-beta.2 from npm.
Cheers!
@lula I will try this new version once I get back from my holiday next month and let you know if this fixes the issue for me. From your example though I say it should be fixed.
@ZieClaw thanks and enjoy your holidays!!! 🏖
I use this variable as my body, as you can see it has a nested object as Magento requires it to be passed this way. And the result was good except for the fact that in customerData the data lines all had [object Object] added to them, like this <email[object Object]>this.email and this is not valid XML. let body = { 'sessionId' : this.apiKey, 'customerData': { email: this.email, firstname: this.voornaam, lastname: this.achternaam, middlename: this.tussenvoegsel, password: this.wachtwoord, dob: this.geboortedatum, gender: this.geslacht, send_new_account_email: 1, customer_activated: 0, }};
I have already fixed it by string replacing the [object Object] parts but this is not proper behavior of course.