I want to send automated payments using the PayPal APIs. As far as I know, currently there are only 2 ways to do it:
- Using the Payouts Endpoints of the modern REST APIs
- Using the Adaptative Payments from the "classic" APIs
The preferred option would be option 1, because there is already an official SDK available for Python, sadly this feature seems to be only available on the United States, the documentation states:
Merchants in the United States can register to use Payouts in the Live environment as outlined in the following steps. Other merchants should contact their Account Manager or customer service to enable Payouts.
So it seems there are some extra steps to enable Payouts, but they are very opaque about it and don't give so much information, it's unclear to me whether it's really available or not. (I have already contacted their tech support to get assistance, I'm waiting for their reply, I'm just asking this here as a backup plan).
If I want to use the Adaptative Payments on Python, more specifically on Django I have 3 options:
- Implement a small Java wrapper around the official SDK and call it through Python using JPype
- Implement a small Java wrapper and call it through the command line, or run it as a service and call it internally from the server.
- Implement the required subset of the PayPal SDK in Python myself.
Option 3 is the most complicated, but probably the most efficient, however since it will not be officially supported, maintaining it can become problematic. Option 2 seems so easy to implement, but since the memory overhead of the JVM will be there anyway maybe it's better to interface it through JPype, which is the main point of this question.
Question details here:
Sorry for the large introduction, it ended up much larger than expected, now going to the point.
If I start the JVM in Django with JPype. Will this mean that each request (there will be a thread for each request, that's how web servers work) will start it's own JVM? Is it a good approach?