skip to Main Content

I am using Flask and try to get paypal work in production, I don’t have a public domain, it work well in sandbox account.

will paypal work without a public domain(localhost) in production, or a way to test in production?

it no, is there other ways to receive payment?

payment = paypalrestsdk.Payment({
"intent": "sale",
"payer": {
    "payment_method": "paypal"},
"redirect_urls": {
    "return_url": "http://localhost:3000/payment/execute",
    "cancel_url": "http://localhost:3000/"},
"transactions": [{
    "item_list": {
        "items": [{
            "name": "item",
            "sku": "item",
            "price": "5.00",
            "currency": "USD",
            "quantity": 1}]},
    "amount": {
        "total": "5.00",
        "currency": "USD"},
    "description": "This is the payment transaction description."}]})

2

Answers


  1. The documentation from PayPal will require you to have an internet connection to use their Sandbox for testing against. You can see here that the sample calls require both cancel and return URL’s which will require your system to have a public address on the internet (otherwise PayPal will not be able to route the response).

    If you wish to run tests inside your network without making a call to PayPal’s sandbox then you will have to set up your own system that will mimic the responses from PayPal. However, given that PayPal runs their own sandbox this seems like a maintenance headache you don’t want.

    Login or Signup to reply.
  2. To process a PayPal payment you need a public internet connection, but not necessarily any public website.

    A PayPal integration does not necessarily have to use any API, even — for example, here is an integration that accepts a payment via a simple URL, with an email address of the recipient: https://www.paypal.com/webscr?cmd=_xclick&[email protected]&item_name=THIS_IS_A_TEST&amount=100&currency_code=USD

    Of course, it appears you are using the restsdk , so if that is your desire then that sdk would need to run on some server, and it could potentially be some private/localhost/intranet server.

    However, the utility of an API-based integration on a private server is extremely limited. How are you going to accept payments from real customers? With the exception of the specific “PayPal Here” app, PayPal should never be used in a “kiosk” mode, it is designed to be accessed by customers from their own devices. This almost always involves eventual deployment to production on a public website

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search