@@ -20,18 +20,20 @@ class TransactionsToFireflySender
2020 * @param int $firefly_account_id
2121 */
2222 public function __construct (array $ transactions , string $ firefly_url , string $ firefly_access_token ,
23- int $ firefly_account_id ,
23+ string | array | null $ firefly_cert , int $ firefly_account_id ,
2424 string $ regex_match , string $ regex_replace )
2525 {
2626 $ this ->transactions = $ transactions ;
2727 $ this ->firefly_url = $ firefly_url ;
2828 $ this ->firefly_access_token = $ firefly_access_token ;
29+ $ this ->firefly_cert = $ firefly_cert ;
2930 $ this ->firefly_account_id = $ firefly_account_id ;
3031 $ this ->regex_match = $ regex_match ;
3132 $ this ->regex_replace = $ regex_replace ;
3233
3334 $ firefly_accounts_request = new GetAccountsRequest ($ this ->firefly_url , $ this ->firefly_access_token );
3435 $ firefly_accounts_request ->setType (GetAccountsRequest::ASSET );
36+ $ firefly_accounts_request ->setCert ($ this ->firefly_cert );
3537 $ this ->firefly_accounts = $ firefly_accounts_request ->get ();
3638 }
3739
@@ -128,6 +130,7 @@ public function send_transactions()
128130 foreach ($ this ->transactions as $ transaction ) {
129131 $ request = new PostTransactionRequest ($ this ->firefly_url , $ this ->firefly_access_token );
130132
133+ $ request ->setCert ($ this ->firefly_cert );
131134 $ request ->setBody (
132135 self ::transform_transaction_to_firefly_request_body ($ transaction , $ this ->firefly_account_id , $ this ->firefly_accounts , $ this ->regex_match , $ this ->regex_replace )
133136 );
@@ -150,6 +153,7 @@ public function send_transactions()
150153 private $ transactions ;
151154 private $ firefly_url ;
152155 private $ firefly_access_token ;
156+ private $ firefly_cert ;
153157 private $ firefly_account_id ;
154158 private $ firefly_accounts ;
155159 private $ regex_match ;
0 commit comments