Passing price variable to PayPal with custom button

前端 未结 8 1073
长情又很酷
长情又很酷 2020-12-07 21:26

I have a form and a custom PayPal button, but how do I pass the value/price variable to PayPal?

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 21:27

    The previous code did not work for me. After much headache I finally figured out you have to go into PayPal and on step 2 of creating the button code make sure you click the unhosted button, and then copy the unencrypted button code, which will give you something like this (I blanked out my business value for security):

    
        
        
        
        
        
        
        
        
        
        
        
        
        
    
    

    This code creates a button where the user can input the amount, which by default starts at 16.99, but you could just as easily replace that with a PHP variable.

提交回复
热议问题