有没有办法使非托管的paypal按钮安全?

I have made a PHP shopping cart and paypal button linked to the cart where you can make a purchase

For this reason I couldn't use an encrypted or hosted button, as I wanted to have a dynamic variable so I used the non-hosted button

I know this means users can change the price or make the payments go to their own Paypal,

But I want to know is there a way of encrypting the button myself or making it safe?

I have read conflicting things about using paypal IPN to help prevent this,

but my real question is, is there a way/service/API which can make my non-hosted button safe?

It 100% needs to take the total price variable from my cart and show it on paypal, I cannot set just one price amount

I have been searching for an answer for weeks, maybe it is because I am rather new to this or maybe I am searching for the wrong thing, but any help or point in the right direction would be great as right now I don't even know/understand if there is a way to make a non-hosted button safe

Thanks and hope my question isn't too stupid (not asking for code, asking if this is possible!)