How To : Using Amazon FPS

Page Status: Beta

Back to Concepts and HOW TOs

Contents

[edit] Description

Amazon Flexible Payments Service (Amazon FPS) is a set of web services APIs designed from the ground up for developers. The APIs allow you to move money between any two entities (humans or computers).

The tricky part about using Amazon FPS is signing each of the requests to the service. Amazon has made it easy for some developers by providing a library (in several languages) to sign the requests. Similarly, Bungee provides the fpsAPI to make it quick and efficient to implement Amazon FPS.

The Bungee fpsApi is a wrapper interface for the AmazonFPS REST API (see http://aws.amazon.com for more information). Each REST call has an associated function that contains the parameters for the input and response parameters. Because Bungee is object-based, for each response, we convert the XML to a Bungee object.

The Amazon FPS WSDL had most of the functionality already built-in. However, we needed to add a couple of functions for authenticating users. This involves the application sending credentials to Amazon.com for signing in so the application can charge them. The process, called FPS Co-Branded UI Pipeline by Amazon, is different depending on the type of financial arrangement (prepaid, postpaid, etc.). In addition, functions were added to construct the URL that redirects customers for the prepaid and postpaid pipelines.

Note: The arguments on each of the functions match the FPS documentation.

For detailed documentation on the Amazon FPS API, see http://developer.amazonwebservices.com/connect/entry.jspa?externalID=913&ref=featured.

Note: Normally, we would have used SOAP, but Amazon uses WSSE and right now, Bungee doesn’t have a predictable way to use the body in signing the request. However, this feature has been added to the roadmap and will be available in future releases.

[edit] Prerequisites

Understanding Solutions and Projects
Understanding WSDL Files
Understanding REST

Procedure

To use the Bungee fpsAPI service, you must set the values for the following fields.

  1. awsIdentity.accessKeyId—Set the value to the accessKeyId provided by Amazon when you registered for a developer account.
  2. awsIdentity.secretAccessKey—Set the value to the secretAccessKey provided by Amazon when you registered for a developer account.
  3. callerToken—Set the value to your caller token. If you do not have a caller token you can get one through the installPaymentInstruction method. See the amazon documentation for details.
  4. recipientToken—If you will be receiving the payments, set the value to your recipient token. If you do not have a recipient token you can get one through the installPaymentInstruction method. Otherwise set it for your users. 
  5. returnURL—Set the value to the URL you would like users to return to after completing the Co-Brand Pipeline with Amazon.

[edit] Error Handling

 

[edit] Examples

 

[edit] Going Live

By default, all calls are made through the sandbox. If you would like to move to your application to production, change the URLs in the following fields:

  • apiUrl— Set the value to the URL for the production servers.
  • coBrandUrl— Set the value to URL for the production version of the coBranded Pipeline.

[edit] Tags

   

    Copyright © 2005 - 2007 Bungee Labs. All rights reserved.