Project

General

Profile

Actions

Programming Guide » History » Revision 5

« Previous | Revision 5/21 (diff) | Next »
chin-yeh, 10/18/2011 02:58 PM


Programming Guide

This guide describes how to make use of the NMI APIs for payment related transaction and it consists of 2 main parts:

The demo application can be found here:

http://192.168.2.68/ukstore/nmi-sample/orders.jsp

Step-By-Step

Before begin, install the following libraries into your development environment (remove the old versions if exists):

Suggested Payment Flow

Steps:
  1. gather the

Generate the form action URL

Generates the form action URL which is needed in the self-hosted payment form.

Method Signature:

public static String getFormActionUrl(String orderId, String orderDescription, BigDecimal orderAmount, String returnUrl)

Input Parameters

  • orderId - the unique ID for the order
  • orderDescription - a simple description of the order
  • orderAmount - the settlement amount of the order in 2 decimal places, e.g. 12.34
  • returnUrl - the receipt URL

Output Parameters

Returns a form action URL

Code Snippets

    String orderId = request.getParameter("order-id");
    String orderDescription = request.getParameter("order-description");
    BigDecimal orderAmount = new BigDecimal(request.getParameter("order-amount"));
    String returnUrl = request.getParameter("return-url");

    String formUrl = PaymentUtils.getFormActionUrl(orderId, 
            orderDescription, 
            orderAmount, 
            returnUrl);

Updated by chin-yeh almost 13 years ago · 5 revisions