Can I test paypal api's from localhost

前端 未结 7 843
难免孤独
难免孤独 2020-12-25 13:07

UPDATE 1:

According to this tutorial on Using PayPal\'s Instant Payment Notification with PHP, PayPal cannot access locally hosted websites unless c

7条回答
  •  一向
    一向 (楼主)
    2020-12-25 13:43

    One simple solution is described in the official developers page of PayPal:

    developer.paypal.com - Local IPN Testing

    The trick consists on writing a small HTML file with this content:

    To get the real results you need to copy all of the IPN variables which PayPal sends. These real variables can be found into the PayPal account, under IPN History:

    IPNs History

    You need to click on the relative Message ID and then copy the "IPN Message" content (it will be something like mc_gross=27.00&invoice=Test-1&protection_eligibility=Ineligible&...) which must be converted into HTML hidden input fields. For example:

    
    
    
    
    ....

    After setting up all of these variables and changing the action URL, you can open the file with a browser and then submit this form.

提交回复
热议问题