@@ -350,6 +350,8 @@ def _account_add_description(account):
350350 account ['description' ] = "Crypto"
351351 elif account ['unifiedAccountType' ] == 'SELF_DIRECTED_RRIF' :
352352 account ['description' ] = f"RRIF: self-directed - { account ['currency' ]} "
353+ elif account ['unifiedAccountType' ] == 'CREDIT_CARD' :
354+ account ['description' ] = "Credit card"
353355 # TODO: Add other types as needed
354356
355357 def get_account_balances (self , account_id ):
@@ -551,6 +553,23 @@ def _activity_add_description(self, act):
551553 type_ = act ['type' ].capitalize ()
552554 act ['description' ] = f"{ type_ } "
553555
556+ elif act ['type' ] == 'CREDIT_CARD' and act ['subType' ] == 'PURCHASE' :
557+ merchant = act ['spendMerchant' ]
558+ status = '(Pending) ' if act ['status' ] == 'authorized' else '' # Posted purchase transactions have status = settled
559+ act ['description' ] = f"{ status } Credit card purchase: { merchant } "
560+
561+ elif act ['type' ] == 'CREDIT_CARD' and act ['subType' ] == 'HOLD' :
562+ merchant = act ['spendMerchant' ]
563+ status = '(Pending) ' if act ['status' ] == 'authorized' else '' # Posted return transactions have subType = REFUND and status = settled
564+ act ['description' ] = f"{ status } Credit card refund: { merchant } "
565+
566+ elif act ['type' ] == 'CREDIT_CARD' and act ['subType' ] == 'REFUND' :
567+ merchant = act ['spendMerchant' ]
568+ act ['description' ] = f"Credit card refund: { merchant } "
569+
570+ elif act ['type' ] == 'CREDIT_CARD' and act ['subType' ] == 'PAYMENT' :
571+ act ['description' ] = "Credit card payment"
572+
554573 # TODO: Add other types as needed
555574
556575 def security_id_to_symbol (self , security_id : str ) -> str :
0 commit comments