You cannot use a "hosted_id" button that was created in the PayPal button factory. These buttons were recently introduced by PayPal and do not allow the use of the "custom" variable in them. We've contacted PayPal about this as have many other people and PayPal says they are working on a solution but they don't have an ETA on when this will be fixed. For now you must use an old style PayPal button which we have available here: