From official documentation (https://stripe.com/docs/upgrades#2019-03-14)
"The application_fee parameter on invoice API methods and the application_fee field on the invoice object have both been renamed to application_fee_amount."
In this case setApplicationFee method does not work correct and you will always get error, that parameter does not exists