Giter Site home page Giter Site logo

spreedly-java's Introduction

spreedly-java

<dependency>
    <groupId>cc.protea.spreedly</groupId>
    <artifactId>spreedly</artifactId>
    <version>0.9.6</version>
</dependency>

I've attempted to preserve as much as possible of the Spreedly nomenclature, while making this more accessible to folk who spend a lot more time writing Java code than they do working with the Spreedly team.

There are no significant external dependencies. The module does depend on a three-class HTTP utility that I had previously included but is now its own project, but no substantial code will be pulled in. It also depends on JAXB which should be available on any reasonable server-side project.

This is not intended to be used in client-side or mobile applications since it depends heavily on your Spreedly apiSecret which should never leave your own servers and be exposed to the general public. For pure client-side work, I suggest an approach similar to that used in https://github.com/rjstanford/spreedly to tokenize.

In general, the only spelling differences are the use of StudlyCaps rather than under_scores. I have taken the liberty of branching the Spreedly term "gateway" into "gatewayAccount" and "gatewayProvider", which removes a frequent source of confusion for people newly exposed to the API. A gatewayProvider is a business such as Authorize.Net, and a gatewayAccount is the entity represented by a gatewayProvider and a set of credentials, such as a M_ID.

For general usage, create a new Spreedly(environmentKey, apiSecret) - this is threadsafe - and call its top level methods directly such as spreedly.listGatewayProviders() or spreedly.purchase(transactionRequest);

Since I assume that you're going to be using this in a much larger project, all Spreedly classes are prefaced with the word Spreedly to avoid confusion.

To run the (trivial) tests, simply set the environment variables SPREEDLYCORE_ENVIRONMENT_KEY and SPREEDLYCORE_API_SECRET to appropriate values.

###Upgrading to 0.9.6### Starting with v0.9.6 requests may throw an exception of type SpreedlyException if Spreedly returns an error; previously these failed requests returned a newly instantiated object of the expected type. This may occur when adding, updating, or listing gateways for an environment. Failed transactions do not throw an exception - these requests continue to return a SpreedlyTransactionResponse.

spreedly-java's People

Contributors

rjstanford avatar alexanderscott avatar lorencole avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.