OST for Order Management-related interfaces/classes (commercepayment) not being generated properly

Issue #1793 resolved
Raihan Navroze created an issue

To reprocude this, you need to create a scratch org with OrderManagement enabled https://resources.docs.salesforce.com/228/latest/en-us/sfdc/pdf/salesforce_order_management_implementation_guide.pdf

Relevant features in sfdx-project:

"features": ["OrderManagement","PersonAccounts"],

This should expose the relevant interfaces for ‘commercepayment’, which seems to be working, however they seem to be generated wrongly.

Example:

Here’s more information about the relevant classes/interfaces along with sample code to build a payment gateway adapter: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_commercepayments_sync_adapter_concept.htm

Note: Tried rebuilding OSTs (full and SObject) and invalidating caches but still receive these errors. The code deploys fine.

Comments (11)

  1. Scott Wells repo owner

    Thanks for filing. I'll take a look. There are some significant gaps in the system types returned by the Tooling REST API, and IC has a provision for filling those gaps (or correcting existing types that are incorrect). It's possible that these fall into one (or both) of those categories. If so, it should be pretty simple to address.

  2. Raihan Navroze reporter

    Thanks Scott. I added a link to the commerce payments doc with sample code to build a payment gateway to make things easier.

  3. Scott Wells repo owner

    Hi. I'm attaching a pre-release build that contains changes to render a more complete and accurate version of the CommercePayments namespace. These changes attempt to rationalize multiple sources of API information including the Tooling API response for this namespace, the Order Management product documentation, and the system API documentation for the namespace. Unfortunately there are some places where things aren't 100% clear, most notably the precise type inheritance relationships, so I'd like to ask that you install this build, regenerate your OST, and let me know if there are any places where legitimate code still looks like it has issues.

    To install the build download the attached archive--don't extract it, though--and then use Settings/Preferences>Plugins>Install plugin from disk (under the gear drop-down menu). Allow the IDE to restart, regenerate your project's OST, allow the project to close/reopen, and then see whether things look correct or not.

    If there are still places where legitimate code against types in this namespace is flagged in error, please provide concrete examples and I'll take care of them in advance of the actual release. Thanks!

  4. Raihan Navroze reporter

    Hi Scott,

    I just installed the attached zip. There are still some unexpected errors showing up. Since some of the class names contain sensitive information, I’ve emailed you on support@illuminatedcloud.com with screenshots.

  5. Scott Wells repo owner

    I'm attaching a new build with some additional logging and also based on the absolute latest official build just to be sure you're using the right one. Install it exactly as described previously, and after installation, please add the following to Help>Diagnostic Tools>Debug Log Settings:

    #com.illuminatedcloud.symtab.OfflineSymbolTable
    #com.illuminatedcloud.intellij.settings.project.OfflineSymbolTableGenerator
    #com.illuminatedcloud.symtab.SystemDeclarations
    

    Then please completely regenerate this project's OST and email ALL idea.log* files from Help>Show Log in Explorer/Finder/Files to me for review.

  6. Scott Wells repo owner

    Here's another build with a small but perhaps important change to how system declaration adjustments are found and applied plus some additional debug logging. Install it exactly as described previously, and after installation, please add the following to Help>Diagnostic Tools>Debug Log Settings:

    #com.illuminatedcloud.symtab.OfflineSymbolTable
    #com.illuminatedcloud.intellij.settings.project.OfflineSymbolTableGenerator
    #com.illuminatedcloud.symtab.SystemDeclarations
    #com.illuminatedcloud.symtab.SystemDeclarationAdjustment
    

    Note that the list above has changed, so please make sure to do this step again.

    Then please completely regenerate this project's OST and email ALL idea.log* files from Help>Show Log in Explorer/Finder/Files to me for review.

  7. Scott Wells repo owner

    Okay, (hopefully) one more build. Install this one the same way, then regenerate your OST again and let me know whether that does or does not resolve all of the issues with the CommercePayment namespace for you.

  8. Scott Wells repo owner

    That last build seemed to do the trick. These changes will be included in the next official build, currently tracking for this coming Thursday (Jan 28).

  9. Log in to comment