How to use Paypal Sandbox webcams for local setup?

I play in Paypal REST (php) environment and I like to play with sandbox webcams. Can I use paypal sandbox webcams with local configuration? http://localhost/test

- invalid url

any suggestions?

+5
source share
2 answers

no, it doesn’t work that way because localhost is not a valid PayPal webpook address. however, you can try it with the request, requestbin . remember using https instead of http when setting up your webhook url.

+6
source

As @zeyu says, you cannot do this directly. Another service you can use to achieve this is https://ngrok.com/ . Hope this is helpful to someone!

It will give you a link something like this: http://75z929f4.ngrok.io , which I set to the APP_HOST development ENV variable.

And popped into the webhook as such:

  def generate_url values = { business: ENV["PAYPAL_ACCOUNT"], cmd: '_xclick', return: ENV["APP_HOST"] + @return_path, custom: @user.id, upload: 1, invoice: Time.now, currency_code: 'GBP', amount: @price, no_shipping: 1, item_name: self.purchase_name, item_number: @product_id, quantity: 1, notify_url: ENV["APP_HOST"] + @notify_path, on0: ('Coupon Code' if @coupon_code.present?), os0: @coupon_code } "#{ENV["PAYPAL_URL"]}/cgi-bin/websr?" + values.to_query end 

Final note, you need to update APP_HOST every time you restart ngrok, since you will get a new identifier from them. This will bind everything so you can send this request to localhost and successfully return the response.

+2
source

Source: https://habr.com/ru/post/1211703/


All Articles