Project

General

Profile

Specification » History » Version 6

chin-yeh, 01/10/2011 04:32 PM

1 2 chin-yeh
{{toc}}
2
3 1 chin-yeh
h1. Specification
4 2 chin-yeh
5 5 chin-yeh
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).
6
7 6 chin-yeh
h2. Introduction
8 1 chin-yeh
9 6 chin-yeh
*Payment Flow*:
10 1 chin-yeh
!flow_diagram.jpg!
11 6 chin-yeh
12
13
h3. Java Package Name
14
15
Package name:
16
<pre>
17
my.com.eCosway.globalcollect
18
</pre>
19
20
h3. Table(s) used
21
22
<pre>
23
GLOBALCOLLECT_INTERFACE
24
</pre>
25
26
h2. Configuration
27
28
The GlobalCollect's *Customer Link* requires the merchant to provide the following URL:
29
* *Return URL* - A link to be displayed on GlobalCollect's payment pages. 
30
* *PSC URL* - GlobalCollect sends the payment information to this URL after the consumer has completed a payment attempt successfully.
31
32
h3. globalcollect.properties
33
34
This properties file is located at:
35
<pre>
36
resources/properties/uk/globalcollect.properties
37
</pre>
38
39
*Properties Description*:
40
|_.Property Name|_.Description|
41
|cl.url|The API URL for Customer Link|
42
|merchant.id|The merchant ID (provided by GlobalCollect)|
43
|merchant.ip|The merchant's public IP address|
44
|order.api.version|The API version of INSERT_ORDER|
45
|order.status.api.version|The API version of GET_ORDERSTATUS|
46
|currency.code|3 letter currency code (ISO-4217)|
47
|country.code|2 letter country code|
48
|language.code|2 letter language code (ISO-639)|
49
50
h2. Programming
51
52
This section contains 3 parts:
53
* Generate redirect URL - describes how to generate the redirect URL
54
* Back URL - describes how to handle the returned consumer
55
* PSC URL - describes how to capture the payment information
56
57
h3. Generate redirect URL
58
59
This URL will be used to redirect the consumer to GlobalCollect's payment pages. 
60
61
*Step-by-Step:*
62
# Prepare  the following parameters:
63
** *connection* - an established database connection
64
** *orderId* - the unique order ID, 20 alphanumeric characters
65
** *amount* - the order amount in cents, and integer values only
66
# Pass the above parameters to the following interface:
67
<pre>
68
String redirectUrl = PaymentUtils.genRedirectPaymentUrl(connection, orderId, amount);
69
</pre>
70
# Insert the order ID information into session.
71
# Redirect the consumer to the generated URL using *JavaScript* or *HttpServletResponse.sendRedirect*. 
72
73
h3. Back URL
74
75
The back URL acts as receipt URL also. This is where the consumer will be redirected to after completed the payment.
76
77
As GlobalCollect will not forward payment information to the URL, one has to obtain the order details through the session. The following guide assumes the order ID is stored in the session.
78
79
*Step-by-Step:*
80
# Prepare the following parameters:
81
** *connection* - an established database connection
82
** *orderId* - the unique order ID, 20 alphanumeric characters
83
# Pass the above parameters to the following interface:
84
<pre>
85
String orderId = (String) session.getAttribute("test_ord_id");
86
PaymentUtils.persistPaymentStatusForReceipt(connection, orderId);
87
</pre>
88
89
h3. PSC URL
90
91
For every payment transaction with the status 500 and above, GlobalCollect will post the payment information to the PSC URL.
92
93
*Step-by-Step*:
94
# Prepare the following parameters:
95
** *connection* - an established database connection
96
** *request* - the HttpServletRequest object
97
# Pass the above parameters to:
98
<pre>
99
PaymentUtils.persistPaymentStatusForPsc(dataBean.getConnection(), request);
100
</pre>
101
# *[Important]* The PSC must not contains any HTML element except a *'OK'* string e.g., 
102
<pre>
103
out.print("OK");
104
</pre>
105