Project

General

Profile

Actions

Specification » History » Revision 8

« Previous | Revision 8/19 (diff) | Next »
chin-yeh, 01/11/2011 10:24 AM


Specification

The chosen integration method is Customer Link. The consumer enters payment information on GlobalCollect's hosted payment pages and GlobalCollect will forward the payment result to the merchant through Payment Status Communicator (PSC).

Introduction

Payment Flow:

Java Package Name

Package name:

my.com.eCosway.globalcollect

Table(s) used

GLOBALCOLLECT_INTERFACE

Configuration

The GlobalCollect's Customer Link requires the merchant to provide the following URL:
  • Return URL - A link to be displayed on GlobalCollect's payment pages.
  • PSC URL - GlobalCollect sends the payment information to this URL after the consumer has completed a payment attempt successfully.

globalcollect.properties

This properties file is located at:

resources/properties/uk/globalcollect.properties

Properties Description:
Property Name Description
cl.url The API URL for Customer Link
merchant.id The merchant ID (provided by GlobalCollect)
merchant.ip The merchant's public IP address
order.api.version The API version of INSERT_ORDER
order.status.api.version The API version of GET_ORDERSTATUS
currency.code 3 letter currency code (ISO-4217)
country.code 2 letter country code
language.code 2 letter language code (ISO-639)

Programming

This section contains 3 parts:
  • Generate redirect URL - describes how to generate the redirect URL
  • Back URL - describes how to handle the returned consumer
  • PSC URL - describes how to capture the payment information

Generate redirect URL

This URL will be used to redirect the consumer to GlobalCollect's payment pages.

Step-by-Step:
  1. Prepare the following parameters:
    • connection - an established database connection
    • orderId - the unique order ID, 20 alphanumeric characters
    • amount - the order amount in cents, and integer values only
  2. Pass the above parameters to the following interface:
    String redirectUrl = PaymentUtils.genRedirectPaymentUrl(connection, orderId, amount);
    
  3. Insert the order ID information into session.
  4. Redirect the consumer to the generated URL using JavaScript or HttpServletResponse.sendRedirect.

Back URL

The back URL acts as receipt URL also. This is where the consumer will be redirected to after completed the payment.

As GlobalCollect will not forward payment information to the URL, one has to obtain the order details via the active session. The following guide assumes the order ID is stored in the session.

Step-by-Step:
  1. Prepare the following parameters:
    • connection - an established database connection
    • orderId - the unique order ID, 20 alphanumeric characters
  2. Pass the above parameters to the following interface:
    String orderId = (String) session.getAttribute("test_ord_id");
    PaymentUtils.persistPaymentStatusForReceipt(connection, orderId);
    
  3. And then, one can obtain the payment status in the interface table (see Table Name);

PSC URL

For every payment transaction with the status 500 and above, GlobalCollect will post the payment information to the PSC URL.

Step-by-Step:
  1. Prepare the following parameters:
    • connection - an established database connection
    • request - the HttpServletRequest object
  2. Pass the above parameters to:
    PaymentUtils.persistPaymentStatusForPsc(dataBean.getConnection(), request);
    
  3. [Important] The PSC must not contains any HTML element except a 'OK' string e.g.,
    out.print("OK");
    

FAQ

PSC:
  • GlobalCollect post the payment result within 2 minutes after completed payment
  • The PSC URL must be a HTTPS URL
  • Only those payment result with status 500 or above will be posted to PSC URL.
  • The number of retry attempt is 10 and retry interval is 2 minutes. When reached the maximum retry attempt, the PSC posting will be disabled.

Updated by chin-yeh almost 14 years ago · 8 revisions