Skip to content

jf2978/Amazon-Pay-Servlet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Amazon Pay Servlet

As a part of my internship, I was matched with Convessa - an enterprise-grade voice platform that enables the development of extensive, robust and scalable voice applications. One of my assigned tasks was to research, evaluate and implement a payment service and checkout flow for the company's showcase voice app Mastermind. This project creates this flow (front-end & back-end) according to Amazon Payment's Express Integration (hosted payment).

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Files

  1. button.html

HTML containing a simple webpage that holds the JavaScript code for the custom Amazon Pay button - uses jQuery to hit the ButtonServlet to retrieve JSON parameters

  1. ButtonServlet.java

Servlet used to send JSON parameters to button.html

  1. AmazonParameters.java

Provides Amazon credentials + parameters

  1. AmazonSignature.java

Calculates + encrypts signature with secret key to verify requests

  1. AmazonPayAPI.java

Configures + wraps the Amazon Pay SDK for use with the Mastermind account

  1. ChaChing.java

Servlet used to handle the return URL (GET) and Amazon notifications (POST)

  1. PaymentProcessor.java

Object class used to process results from both the GET and POST

  1. MMPaymentServer.java Main method that instantiates a SSL Jetty Server with the servlets intact

Prerequisites

Even though this integration was tested locally (Amazon Pay Sandbox Mode), there are a few things that have to be set up in order to effectively test each aspect of the checkout flow.

Deployment

Some things to remember to change once moving onto Production

  1. Change the script source in button.html to render the button w/o the sandbox watermark and enable access to real Amazon accounts (just remove '/sandbox')
  2. In AmazonPayAPI.java, the SDK Client object should not include the ".withSandboxMode(true)" parameter

Built With

  • Eclipse - Java IDE for embedded Jetty
  • Maven - Dependency Management

Authors

  • Jeffrey Fabian - jf2978
  • Dan McCafferty - SSL Cert Configuration - Convessa Co-Founder & CTO

About

Amazon Pay integration servlet for Mastermind Alexa skill

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published