I don't really know if this is possible, but here's what I have
PaymentEntity
is a class
type CardPaymentEntity = SetRequired<PaymentEntity, 'processor'>;
static fromPayment(payment: CardPaymentEntity, opt: FromPayment): PaymentAuthorizationEntity {
return new PaymentAuthorizationEntity(
payment.amount,
payment.currency,
payment, // compile error here, because CardPaymentEntity is not a PaymentEntity class
Argument of type '{ readonly status: PaymentStatus; readonly amount: number; readonly currency: Currency; readonly orderId: string; readonly methodType: PaymentMethodType; ... 8 more ...; readonly processor: Processor | null; }' is not assignable to parameter of type 'PaymentEntity'.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too