This issue is usually encountered when you are testing your website with the “Preview” option.
Please note that the correct URLs for PayPal payment buttons are added during the publishing process, so you will have to publish your website in order to test the PayPal functionality.