Buxter Wiki / Setting up the Java Buxter API Client
View
 

Setting up the Java Buxter API Client

This guide will show you how to

 

• Compile the Buxter Java API Client from SVN

• Set up a Buxter developer account

• Download a comprehensive demo project to learn from

 

1. Prerequisites

The following components are required to build the buxter project

 

2. Building the Library

The buxter java client is currently maintained at the project site located at http://code.google.com/p/buxter-api/.

Please enter the following commands.

 

mkdir buxter
cd buxter
svn checkout http://buxter-api.googlecode.com/svn/trunk/ buxter-api-read-only

 

Now the source code is transferred to your computer. To compile please invoke maven with the following commands.

 

cd buxter-api-read-only/
mvn package
mvn install

 

This will cause maven to download all Buxter client dependencies and create the .jar files. When it is ready, it will greet you with a "BUILD SUCCESSFUL" message, which means you have just created a working client module for Buxter.

 

3. Set up a Buxter developer account

 

If you haven't used Buxter before, you will have to sign up for the service first. This is done by logging into your Facebook account and visiting one of the following URLs and accepting the TOS

 

http://apps.facebook.com/buxtersandbox/ - The Buxter sandbox, for development purposes, where no real money is traded

http://apps.facebook.com/mybuxter/ -The Buxter production system

 

Now click on the "Applications" tab. This is the place where you create the link between Buxter and your own application. 

 

When you click on the "Add" Button you will be able to enter your application details. This will be the base information Buxter will use to communicate with your application.

You will be shown the box below in which you can enter three parameters.



Your application name will be shown whenever someone buys an item from you to signal the customer to whom the payment will go to. 

 

Application url is the location to which the customer will be redirected after he has made or cancelled a purchase of an item. The underlying controller code of this url must be able to verify a few parameters that will be passed by buxter to verify if an item was purchased.

 

The Application Icon URL is a link to the icon you want to use as a brand element in the Buxter UI. It will lend your corporate identity to the transaction, though the entire handling is done on the Buxter side. This parameter is optional.

 


For demonstration purposes we will create an online kitten shop.

 

As you can see on the image to the left, the kitten shop was successfully created. Also, Buxter created a set of parameters for us that are quite important.

 

API Configuration ID we will use this as the identifier to Buxter. The three parameters we entered when we created our application are stored under this configuration id.

 

Secret key this is the data that will be used later to calculate the security hashes that will secure the sales process.

 

Status is the status of the Buxter configuration of your application. On creation it is just "Created", you will have to click on "Activate" to enable the Buxter application to receive payments. This is basically a flag for development purposes, if you switched to active your payment configuration is now live.


 

 

4. Integrating Buxter payment to your web application

For the sake of briefness we prepared a small web application based that you can download here. It is based on the Stripes web framework. It's basically a web shop selling kitten images. Since this is a demo implementation, we are using the Buxter Sandbox instead of the real Buxter application. The sandbox uses sandbox money instead of real currency.

 

This software is licensed as CC-GNU LGPL of Version 2.1 or higher. 

 

Download kittenshop.zip (2445.7K)

Comments (0)

You don't have permission to comment on this page.