17

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)

As a bit of a simplification, I think I should be able to do something like the following pseudocode:

shoppingApi.postTransaction("paypal", amount, currency, invoiceId, purchaseDescription)

and later on during a scheduled task or on notification from an IPN url:

completedPayments = shoppingApi.getUnprocessedCompletedPayments();
for (Payment payment: completedPayments)
{
  // my code to process a successful payment.
}

and then I'd process the purchases.

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.

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).

Thanks in advance for any suggestions!

EDIT: 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 ;-)

EDIT 2: 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

EDIT 3 - MAJOR NOTE: 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!

Brad Parks
  • 66,836
  • 64
  • 257
  • 336
  • 1
    You are kidding right? java api with trial version never! Cause you could just de-compile it easily! – GingerHead May 08 '12 at 16:20
  • when you buy commercial software you're not just buying it as is, you're buying commercial support to an extent, and if it's as I suggested and is reasonably mature/respectable, then it'd have a roadmap and a future... – Brad Parks May 09 '12 at 02:02
  • I would say the license is a thing and the support another. open-source softwares are only support purchasable, on the other-hand the commercial ones have them purchasable the both: the license and the support. – GingerHead May 09 '12 at 05:50
  • for what it's worth, I can think of 2 techniques that would allow you to trial java libraries, those being obfuscation, and only supplying partial functionality in your trial (ie major features left out, so they're not even in the trial itself at all). – Brad Parks May 17 '12 at 17:55
  • Obfuscation in java is done in two ways commercially and with open-source:in open source we have yguard and proguard, whose sources are open to everyone and could be De-obfuscated easily because of being open-source code. The commercial ones are very expensive and can not obfuscate web kind of apis. So no point in being a trial version or closing some functionality. All java web code are open as they can be. – GingerHead May 18 '12 at 12:54
  • @GingerHead: Deobfuscate this: `a b? c d f?`. FYI, it was `Deobfuscated easily? Are you kidding?`. And the single letters are what you get after obfuscation. – maaartinus Apr 22 '14 at 21:46
  • @maaartinus Your thoughtful comments have dramatically enlarged the scope of my ignorance. – GingerHead Apr 23 '14 at 07:13

6 Answers6

1

I would say it's better to write your own api, because anything related to payment and purchase processes will cost you money to get. You need the following for your app to accomplish:

  1. You need a server that will communicate with PayPal (or DataTrans or any other payment systems)
  2. You need a database to capture all the payments transferred:

    • That have been settled
    • That have been payed but the settlement is not received yet
    • That still need to be payed
    • Installments done, finished, or yet to be done
  3. The server needs to be any web app (spring with hibernate etc) that has some security (acegi, spring)

  4. Every-time a user logs in and starts purchasing online you need to do a call to PayPal and get the response in a callback to the browser of the user
  5. Every time you have a settlement you save the needed data in the DB like user-id purchase-method owner card-number invoice-id PayPal -token

I hope this helps

GingerHead
  • 8,130
  • 15
  • 59
  • 93
  • 2
    Thanks for the suggestion, but I still think this could be wrapped up... I have an existing Spring MVC based webapp and server, and don't mind this API "owning" lots of this process.... all I'd need is the IPN receiving url to be able to process the status, then I store it somewhere.... as you suggest, a db or something like that. But the process of me figuring out what "paid" really means, and all the other statuses that could come back, I'd like the API to manage. – Brad Parks May 04 '12 at 13:06
  • I have done this in a project and created the *API* and the project from scratch (OK, it took a lot of time), I don't think you can find an *API*, at the end of the day, you need to either code it, or buy it. – GingerHead May 04 '12 at 13:30
  • 1
    actually do you know of a commercial API that's a one time cost for wrapping this up? abstracting the gateway and making the API dead simple? I'd prefer a library very much over a SaaS approach, as it's an easier sell to our clients... – Brad Parks May 04 '12 at 17:27
  • No I don't know of an API, but I'm telling you that it's simple, and you better do it yourself. Or you need to hire a developer if you don't have one. – GingerHead May 07 '12 at 13:16
  • Sorry I never clarified my down vote before this. The reason I gave a down vote is because I'm sure it *can* be done, and your answer basically says it can't be done... For example, this answer (http://stackoverflow.com/a/10609191/26510) points to a Ruby based solution that does everything I want, but it's in Ruby. It's probably what I'll end up using anyway, but it's proof that it can be done and can be managed at a higher level than just PayPal. – Brad Parks May 17 '12 at 17:51
  • First of all, this is not Java. Where you insist that the API must be in Java in your question! (even the tag). So my tellings that you can't find an API was in java platform. (so the downvote is not necessary here ) – GingerHead May 18 '12 at 08:27
  • I think "insist" isn't the right word here, but I completely agree that I suggested, and would've preferred to see a Java solution. But given that there isn't one, the ActiveMerchant Ruby solution with the possible use of JRuby is the best answer to me, so I've marked it as such. We'll let the users of StackOverflow upvote what they think is the best answer ;-) – Brad Parks May 18 '12 at 12:26
  • OK, then when that's fixed and agreed upon, the logic says that my down-vote must be removed no? (so please to remove it? Thanks) – GingerHead May 18 '12 at 12:47
1

You can not get an API for payment gateway integration. You will have to write your own development for the processing with various payment gateways. For that you have to understand that which payment gateway gets which parameters and its requesting URL for requesting for the paymentgateway. You can get this information by varius payment gateway websites.

This url may helpful to you

For HDFC : http://www.hdfcbank.com/sme/sme-details?id=guzh6m0i

For Paypal : https://merchant.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=merchant/payment_gateway

Secure Pay : http://www.securepay.com.au/

techpro [ ICICI ] : http://forums.devarticles.com/asp-development-3/how-to-integrate-payseal-icici-payment-gateway-95329.html

Here you can also find the development APIs or the guidelines for the development that which parameters they will require for processing the requests.

Hope this may help you.

Enjoy !!!

Bhavik Ambani
  • 6,557
  • 14
  • 55
  • 86
  • 1
    Hi Bhavik... thanks for the comment... I do believe that a wrapper for this could be written, since generic shopping carts like ZenCart and osCommerce (both php, but good examples of this) have the payment gateway abstracted and process the entire purchasing process by themselves without any additional programming required. Simply configuration. – Brad Parks May 08 '12 at 12:34
  • 1
    Thats true but I just displayed the way of doing the things. – Bhavik Ambani May 08 '12 at 12:41
1

I know only this product (commercial): IBM WebSphere Commerce Payment There is a tutorial to integrate also with PayPal: Integration with PayPal

I dont know the license cost, you must contact IBM for this.

Teg
  • 1,302
  • 13
  • 32
  • thanks for the comment.... I've chatted with IBM sales and they're going to get back to me on it.... I'll update with more info once I've got it. – Brad Parks May 14 '12 at 13:17
  • as a follow up, I never received any additional contact from IBM on my sales / tech inquiry. I chatted with a specialist that took my email address, but they never got back to me... and I did check my spam folder and there was no response ;-( – Brad Parks May 17 '12 at 17:56
1

There's this site which could be used via jruby.
This may or may not come somewhere near meeting your requirements.

GingerHead
  • 8,130
  • 15
  • 59
  • 93
GeekOnCoffee
  • 1,155
  • 5
  • 15
  • Hmmm! Very interesting.... I have no experience with jRuby, but this is exactly the type of library I'm looking for.... and the Shopify, connection makes me feel very comfortable with it's maturity... I'll definitely take a solid look! – Brad Parks May 16 '12 at 00:51
  • First of all this is not Java. Where you insist that the API must be in Java in your question! (even the tag) – GingerHead May 18 '12 at 08:24
  • I think "insist" isn't the right word here, but I completely agree that I suggested, and would've preferred to see a Java solution. But given that there isn't one, the ActiveMerchant Ruby solution with the possible use of JRuby is the best answer to me, so I've marked it as such. We'll let the users of StackOverflow upvote what they think is the best answer ;-) – Brad Parks May 18 '12 at 12:30
1

Java SDKs are available here - https://www.x.com/developers/paypal/documentation-tools/paypal-sdk-index

All of them come with a nice handy example (check README.md files) which will get you started.

  • thanks for the feedback.... but I'm looking for an API at a higher level than the PayPal API's, something that's more like an "ecommerce" API, very much like ActiveMerchant mentioned in one of the other responses... – Brad Parks May 17 '12 at 11:44
0

Though the thread is very old, I just wanted to add details of an API which I came across recently, that may match the requirements of the question. I hope this will help others who are looking for similar answers.

Try Shopizer. This API was build on Java, Spring, Hibernate, jQuery and elasticsearch.