openmindlab / sfcc-dts

High quality Salesforce Commerce Cloud (sfcc) type definitions
MIT License
21 stars 1 forks source link

Change LineItemCtnr.getPaymentInstruments to return OrderPaymentInstruments #4

Closed sjmtan closed 4 years ago

sjmtan commented 4 years ago

There's a bit of ambiguity in the Salesforce docs, but I think the method actually returns OrderPaymentInstruments - especially since when you create a PaymentInstrument on a Basket, it returns an OrderPaymentInstrument.

Screen Shot 2020-09-10 at 3 41 04 PM
fgiust commented 4 years ago

Hi @shannontan-bolt, LineItemCtnr.getPaymentInstruments() is already returning a collection of OrderPaymentInstrument in sfcc-dts types. This is a screenshot of the method call as seen by vscode:

sfcc-dts-4

We are already enriching all the generics types from official salesforce documentation. FYI you can see this mapping file in sources where we manually added all the missing types to all the methods returning a generic type: https://github.com/openmindlab/sfcc-dts/blob/master/api/generics.properties

sjmtan commented 4 years ago

@fgiust Yeah, I know it returns dw.order.PaymentInstrument, but I think in the context of LineItemCtnr, I think getPaymentInstruments actually returns dw.order.OrderPaymentInstrument, which is a subclass of PaymentInstrument. The important but subtle difference is that OrderPaymentInstrument subclass contains info related to payment for that order (getPaymentTransaction exists on OrderPaymentInstrument but not on PaymentInstrument)