File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ def receive
3434 description << " (Repayment to #{ webhook [ :data ] [ :counterparty ] [ :name ] } )"
3535 end
3636
37+ # @todo remove the final fall back at some point. It will be a breaking change.
38+ ynab_account_id = params [ :ynab_account_id ] || ENV [ 'YNAB_MONZO_ACCOUNT_ID' ] || ENV [ 'YNAB_ACCOUNT_ID' ]
39+
3740 ynab_creator = YNAB ::TransactionCreator . new (
3841 id : "M#{ webhook [ :data ] [ :id ] } " ,
3942 date : Time . parse ( webhook [ :data ] [ :created ] ) . to_date ,
@@ -42,7 +45,7 @@ def receive
4245 description : description . strip ,
4346 cleared : !foreign_transaction ,
4447 flag : flag ,
45- account_id : ENV [ 'YNAB_MONZO_ACCOUNT_ID' ] || ENV [ 'YNAB_ACCOUNT_ID' ] # @todo remove the fall back at some point. It will be a breaking change
48+ account_id : ynab_account_id
4649 )
4750
4851 create = ynab_creator . create
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ def receive
4848 description : description . strip ,
4949 cleared : !foreign_transaction ,
5050 flag : flag ,
51- account_id : ENV [ 'YNAB_STARLING_ACCOUNT_ID' ]
51+ account_id : params [ :ynab_account_id ] || ENV [ 'YNAB_STARLING_ACCOUNT_ID' ]
5252 )
5353
5454 create = ynab_creator . create
You can’t perform that action at this time.
0 commit comments