Closed sjmtan closed 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:
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
@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)
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.