Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code attempts to write to undefined sysobj extension #86

Open
moorena opened this issue Dec 2, 2024 · 0 comments
Open

Code attempts to write to undefined sysobj extension #86

moorena opened this issue Dec 2, 2024 · 0 comments

Comments

@moorena
Copy link

moorena commented Dec 2, 2024

In this line of code:

order.custom.AffirmTransactionHistory = JSON.stringify(reponse.events);

is attempting to write to AffirmTransactionHistory which is not declared in the system object type extensions for Order:

<type-extension type-id="Order">
<custom-attribute-definitions>
<attribute-definition attribute-id="AffirmExternalId">
<display-name xml:lang="x-default">Affirm External Id</display-name>
<description xml:lang="x-default">Affirm Charge ID</description>
<type>string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>true</externally-managed-flag>
<min-length>0</min-length>
</attribute-definition>
<attribute-definition attribute-id="AffirmPaymentAction">
<display-name xml:lang="x-default">Affirm Payment Action</display-name>
<description xml:lang="x-default">Defines by what action order was placed</description>
<type>enum-of-string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>true</externally-managed-flag>
<value-definitions>
<value-definition>
<display xml:lang="x-default">AUTHORIZATION</display>
<value>AUTH</value>
</value-definition>
<value-definition>
<display xml:lang="x-default">AUTHORIZATION + CAPTURE</display>
<value>CAPTURE</value>
</value-definition>
</value-definitions>
</attribute-definition>
<attribute-definition attribute-id="AffirmStatus">
<display-name xml:lang="x-default">Affirm Status</display-name>
<description xml:lang="x-default">Affirm status of a order</description>
<type>enum-of-string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>true</externally-managed-flag>
<value-definitions>
<value-definition>
<display xml:lang="x-default">AUTHORIZED</display>
<value>AUTH</value>
</value-definition>
<value-definition>
<display xml:lang="x-default">CAPTURED</display>
<value>CAPTURE</value>
</value-definition>
<value-definition>
<display xml:lang="x-default">VOIDED</display>
<value>VOIDED</value>
</value-definition>
<value-definition>
<display xml:lang="x-default">REFUNDED</display>
<value>REFUNDED</value>
</value-definition>
<value-definition>
<display xml:lang="x-default">PARTIALLY CAPTURED</display>
<value>PARTIALLY_CAPTURED</value>
</value-definition>
</value-definitions>
</attribute-definition>
<attribute-definition attribute-id="AffirmToken">
<display-name xml:lang="x-default">Affirm Token</display-name>
<description xml:lang="x-default">Affirm Checkout token</description>
<type>string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>true</externally-managed-flag>
<min-length>0</min-length>
</attribute-definition>
<attribute-definition attribute-id="AffirmAuthAmount">
<display-name xml:lang="x-default">Affirm Authorization Amount</display-name>
<description xml:lang="x-default">Amount authorized at checkout</description>
<type>string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>true</externally-managed-flag>
<min-length>0</min-length>
</attribute-definition>
<attribute-definition attribute-id="AffirmCapturedAmount">
<display-name xml:lang="x-default">Affirm Captured Amount</display-name>
<description xml:lang="x-default">Amount captured via Affirm</description>
<type>string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>true</externally-managed-flag>
<min-length>0</min-length>
</attribute-definition>
<attribute-definition attribute-id="AffirmRefundedAmount">
<display-name xml:lang="x-default">Affirm Refunded Amount</display-name>
<description xml:lang="x-default">Amount refunded via Affirm</description>
<type>string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>true</externally-managed-flag>
<min-length>0</min-length>
</attribute-definition>
</custom-attribute-definitions>
<group-definitions>
<attribute-group group-id="Affirm">
<display-name xml:lang="x-default">Affirm</display-name>
<attribute attribute-id="AffirmExternalId"/>
<attribute attribute-id="AffirmPaymentAction"/>
<attribute attribute-id="AffirmToken"/>
<attribute attribute-id="AffirmStatus"/>
<attribute attribute-id="AffirmAuthAmount"/>
<attribute attribute-id="AffirmCapturedAmount"/>
<attribute attribute-id="AffirmRefundedAmount"/>
</attribute-group>
</group-definitions>
</type-extension>

Given no other code references AffirmTransactionHistory, the fix might be to remove the line. An alternative fix would be to add AffirmTransactionHistory to the Order system obj attributes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant