title: Shopping Cart API for any payment gateway? (PayPal at least required)
body: <p>I'm trying to find a java based API that wraps up the details of processing a credit card transaction or purchase via PayPal at a minimum, and other gateways as a plus in an IPN fashion (ie no products required, just an invoice amount)</p>
  
  <p>As a bit of a simplification, I think I should be able to do something like the following pseudocode:</p>
  
  <pre><code>shoppingApi.postTransaction("paypal", amount, currency, invoiceId, purchaseDescription)
  </code></pre>
  
  <p>and later on during a scheduled task or on notification from an IPN url:</p>
  
  <pre><code>completedPayments = shoppingApi.getUnprocessedCompletedPayments();
  for (Payment payment: completedPayments)
  {
    // my code to process a successful payment.
  }
  </code></pre>
  
  <p>and then I'd process the purchases. </p>
  
  <p>I know there's tons of shopping carts out there that do this, but from what I've seen, they all want you to put your products in their system, which doesn't work for me. My products are in a 3rd party system, and I just want to process a payment. That's all.</p>
  
  <p>And no cart I know of exposes a simple API like the one I'm suggesting above. I don't care what payment type my users use, I just want to know if they completed it. I know that Shopify.com has a REST api that does something like this, but it's not IPN like (it wants your products in it's system).</p>
  
  <p>Thanks in advance for any suggestions!</p>
  
  <p><strong>EDIT:</strong> I know of course that there'd be other statuses that I'd need to look at, like "pending", etc, but that'd simply be another simple API call, like shoppingApi.getPendingPayments(). If the API did the above 2 calls, I'd be pretty happy ;-)</p>
  
  <p><strong>EDIT 2:</strong> I'd prefer opensource, but am totally open to commercial if it's a flat fee, can be trialed to some extent, and is reasonably mature/respectable </p>
  
  <p><strong>EDIT 3 - MAJOR NOTE:</strong> I feel confident that such a library should exist. Whether or not it does is another question. So to be clear, I'd really like to see "yes, use this library" answers, not "NO", this can't be done, as I'm %99.999 sure it can be done ;-) Thanks in advance!</p>