
3. Online Merchant Interface Details

|
|
This section provides the details of how to integrate a merchant system with the GoldMoney OMI.
|
| 3.1 Merchant Holding OMI Properties |
In order for a merchant to become a GoldMoney merchant, the
merchant will have to open and maintain at least one Holding
within the OMI into which customers can transfer
(pay) GoldGrams from their respective Holdings.
Once the merchant has opened a Holding, he/she must
request GoldMoney to activate the OMI for that particular Holding.
This can be done using the secure messaging facility that is available
once logged in to a Holding.
As soon as GoldMoney activates the OMI for a particular Holding,
the merchant will be able to configure the following set of OMI properties
for that Holding:
|
| Table 1: Merchant Holding OMI Properties |
| Property Name |
Maximum Length |
Description |
| Result URL |
255 characters (case sensitive) |
The URL (on the merchant system) that the OMI
will send (HTTP POST) the details of a successful payment to. If
this URL is not specified by the merchant, the merchant will not
be notified by the OMI when payments are made to the
merchant's Holding. Alternatively, if this field starts with
"email:", the payment details will be sent via email to the
specified address, for example "email:pay@shopper.com". This URL
must start with "http://", "https://" or "email:". Please
note that URLs can only point to ports 80 and 443 on the
merchant system. All other ports will be rejected and the payment
notification will not be sent.
|
| Success URL |
255 characters (case sensitive) |
The URL (on the merchant system) that the user's browser will
be redirected to once the user has completed viewing the result
of a successful payment as presented by the GoldMoney web site.
This URL must start with "http://" or "https://".
|
| Success URL Method |
- |
The HTTP method (POST, GET or LINK) that will be used to link
to the Success URL.
|
| Fail URL |
255 characters (case sensitive) |
The URL (on the merchant system) that the user's browser will
be redirected to once the user has completed viewing the result
of a failed payment as presented by the GoldMoney web site. This
URL must start with "http://" or "https://".
|
| Fail URL Method |
- |
The HTTP method (POST, GET or LINK) that will be used to link
to the Fail URL.
|
| Payment Details Hash Method |
- |
The algorithm that the OMI should use when
hashing the payment details that it will send to the merchant
system in step 14 of Figure 1. The supported hash algorithms are
MD5 and SHA-1. Because SHA-1 is more secure, GoldMoney recommends
the use of SHA-1 rather than MD5. See Appendix A for an
overview of the different hash algorithms that are supported.
|
| Test/Live Flag |
- |
A flag that will enable the merchant to test the integration
of the merchant system with the OMI without
effecting real payments. If this flag is set to Test,
the OMI will send simulated payment
details to the merchant system, which will not relate to
actual payments made within the OMI. When this flag
is set to Test, only the merchant's Holding can be specified as
the payer Holding (i.e. when testing, the payer and the payee
Holding must be the same Holding).
|
| Active/Inactive Flag |
- |
A flag that will enable the merchant to completely deactivate
the OMI. If this flag is set to
Inactive, the OMI will always return
an error message to the user when it receives a payment request
for the benefit of the merchant that deactivated the OMI. This
flag can be used when the merchant system is experiencing
prolonged unexpected or planned downtime. The OMI
will never effect a payment to the merchant if the payment
relates to a merchant Holding that has this flag set to an
Inactive state.
|
| Secret Key |
255 characters (case sensitive) |
A secret string of characters that the OMI will
include in a hash as part of the payment details sent to the
merchant system, after completion of a successful payment to the
merchant's Holding. This key will enable the authentication of
the source and the validation of integrity of the payment details
sent to the merchant system.
|
| Send Secret Key Flag |
- |
A flag that will instruct the OMI to send the
Secret Key separately from the normal payment details hash to
the merchant system whenever it sends the Payment Notification Form.
This will relieve the merchant from having to perform a hash on the payment
details sent by the OMI to the merchant system in
order to verify their source - the integrity of the payment
details is inherently ensured by the SSL protocol as long as the
Result URL is secure, so a hash of the payment details is
not required to verify their integrity. This flag is only used
when the Result URL is secure (starts with "https://").
|
| Omit Payment Details Flag |
- |
A flag that will instruct the OMI to either
include the payment details in, or exclude certain
payment details from the email message it will send to the
Result URL (this only applies if the Result URL is an email address).
|
| Allow URL Overrides from Payment Request Form |
- |
A flag that will indicate to the OMI whether the
values of the Result URL, Success URL, Success URL Method, Fail URL and
Fail URL Method may be overridden from the Payment Request Form.
|
| Verify the SSL Certificate of the Result URL |
- |
This flag controls the behaviour of the OMI when the Result URL is secure
(starts with "https://") and when the Payment Notification Form is sent
to the merchant system. If the SSL certificate must be verified, then the
OMI will verify that the SSL certificate at the Result URL was signed by
a known certificate authority (CA), and that the common name in the certificate
matches the domain name in the Result URL. If this verification fails, then
the OMI will not send the Payment Notification Form to the Result URL.
Merchants have the option to ignore this verification process, for example
if they know that their SSL certificate was not issued by a known
certificate authority (in other words if it was self-issued).
|
| Authorised by GoldMoney for Use |
- |
This flag is set exclusively by the GoldMoney administrator, and
controls whether the OMI of a particular Holding is authorised
for testing purposes only, or whether it is authorised
to facilitate real payments. If a merchant Holding's OMI has not been fully authorised,
it will not be able to process real payments until such
time as it is fully authorised - it will only be able to
effect test (simulated) payments.
|
|
|
| 3.2 HTML Forms |
The OMI utilizes the following key HTML forms:
- Payment Request Form - this form is
generated by the merchant system for receipt by the GoldMoney
system, and is sent via the customer's browser;
- Payment Notification Form - this form is
generated by the OMI for receipt by the merchant's web site;
- Payment Success Form - this form is
generated by the OMI for receipt by the merchant
system, and is sent via the customer's browser;
- Payment Failure Form - this form is
generated by the OMI for receipt by the merchant
system, and is sent via the customer's browser.
|
| 3.2.1 Payment Request Form |
This form is submitted by the merchant system to the GoldMoney
system (via the customer's browser) in step 5 of Figure 1.
- Action - the form action must be set to the following URL:
https://secure.goldmoney.com/omi/omipmt.php
- Method - the form method must be set to POST or GET.
The following table describes the fields on the Payment Request Form:
|
| Table 2: Payment Request Form Fields |
| Field Name |
HTML Field Name |
Required? |
Description |
| Merchant Holding Number |
OMI_MERCHANT_HLD_NO |
Yes |
The Holding number (format '99-99-99-X') of the merchant that the payment must be made to (payee Holding).
Note that the dashes in the number must be included (if there are any), but the number can be in either
uppercase or lowercase.
|
| Currency Amount |
OMI_CURRENCY_AMT |
Yes |
The amount that the merchant wishes to be paid by the customer.
The amount must be greater than zero, and must be a valid number.
|
| Currency Code |
OMI_CURRENCY_CODE |
Yes |
The code of the currency that the above amount is
specified in. See Table 3 for a list of valid currency codes.
|
| Test Type Indicator |
OMI_SIM_MODE |
No |
An optional test indicator that indicates the
type of payment simulation the merchant wants to effect in Test mode:
- 0 or not specified: All simulated payments will succeed;
- 1: All simulated payments will fail;
- 2: Approximately 80% of simulated payments will
succeed, and therefore approximately 20% of simulated payments will fail.
The presence (or absence) of this field and its value has no
effect in Live mode.
|
| Merchant Reference Number |
OMI_MERCHANT_REF_NO |
No |
A field that the merchant can specify to
associate the customer order with. The reference number will be
included in the memo associated with the payment. The GoldMoney
system will eventually pass this field back to the merchant
system (steps 14 and 18 of Figure 1). GoldMoney recommends that
merchants use this field to identify and keep track of each order.
The maximum length allowed for this field is 50 characters.
|
| Result URL Override |
OMI_RESULT_URL |
No |
This field enables the merchant to temporarily
override the Result URL OMI property as set in the merchant's Holding.
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to true, and both this field as
well as all of the four other override fields contain values,
then the value of this field will be used in place of the
Result URL OMI property.
The value of this field is validated against the same rules that
apply for the Result URL.
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to false, then this field will be
ignored regardless of whether it is present or not, or whether it
contains a value or not.
The maximum length allowed for this field is 255 characters.
|
| Success URL Override |
OMI_SUCCESS_URL |
No |
This field enables the merchant to temporarily
override the Success URL OMI property as set in the merchant's Holding.
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to true, and both this field as
well as all of the four other override fields contain values,
then the value of this field will be used in place of the
Success URL OMI property.
The value of this field is validated against the same rules that
apply for the Success URL.
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to false, then this field will be
ignored regardless of whether it is present or not, or whether it
contains a value or not.
The maximum length allowed for this field is 255 characters.
|
| Success URL Method Override |
OMI_SUCCESS_URL_METHOD |
No |
This field enables the merchant to temporarily
override the Success URL Method OMI property as set in the merchant's Holding.
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to true, and both this field as
well as all of the four other override fields contain values,
then the value of this field will be used in place of the
Success URL Method OMI property.
The value of this field can be set to "POST", "GET" or "LINK".
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to false, then this field will be
ignored regardless of whether it is present or not, or whether it
contains a value or not.
|
| Fail URL Override |
OMI_FAIL_URL |
No |
This field enables the merchant to temporarily
override the Fail URL OMI property as set in the merchant's Holding.
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to true, and both this field as
well as all of the four other override fields contain values,
then the value of this field will be used in place of the
Fail URL OMI property.
The value of this field is validated against the same rules that
apply for the Fail URL.
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to false, then this field will be
ignored regardless of whether it is present or not, or whether it
contains a value or not.
The maximum length allowed for this field is 255 characters.
|
| Fail URL Method Override |
OMI_FAIL_URL_METHOD |
No |
This field enables the merchant to temporarily
override the Fail URL Method OMI property as set in the merchant's Holding.
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to true, and both this field as
well as all of the four other override fields contain values,
then the value of this field will be used in place of the
Fail URL Method OMI property.
The value of this field can be set to "POST", "GET" or "LINK".
If the value of the Allow URL Overrides from Payment Request
Form OMI property is set to false, then this field will be
ignored regardless of whether it is present or not, or whether it
contains a value or not.
|
| Default Payment Memo |
OMI_MERCHANT_MEMO |
No |
If specified, the OMI will default
the memo to be associated with the payment to the value of this
field (the customer will however be able to override this default
value).
The OMI will automatically prefix the memo with the
Merchant Reference Number (if specified) upon payment.
The OMI will insert whitespace in order to split
any continuous character sequences of 20 characters or
longer it finds in the memo field.
The maximum length allowed for this field is 200 characters,
but the OMI will truncate this field if it exceeds the maximum length
allowed for payment memos in the GoldMoney system.
|
| Merchant Parameters |
As specified by the merchant |
No |
The OMI will automatically retrieve
all remaining hidden fields (of which the field names do not
start with "OMI_") that the merchant may have specified on the
form, and eventually pass them back to the merchant system (in
steps 14 and 18 of Figure 1).
Note that submit buttons on HTML
forms are also inadvertently passed along,
because the OMI cannot distinghuish among the different
types of HTML input fields it retrieves from
the Payment Request Form.
|
|
|
The following table lists the valid currency codes that the OMI will accept on the
Payment Request Form:
|
| Table 3: Currency Codes |
| Currency Name |
Currency Code |
| GoldGram (XGG) |
0 (zero) |
| Australian Dollar (AUD) |
36 |
| Brazilian Real (BRL) |
986 |
| British Pound (GBP) |
826 |
| Canadian Dollar (CAD) |
124 |
| Chinese Yuan (CNY) |
156 |
| Deutsche Mark (DEM) |
280 |
| European Currency Unit (EUR) |
978 |
| French Franc (FRF) |
250 |
| Hong Kong Dollar (HKD) |
344 |
| Indian Rupee (INR) |
356 |
| Italian Lira (ITL) |
380 |
| Japanese Yen (JPY) |
392 |
| Kuwaiti Dinar (KWD) |
414 |
| Mexican Peso (MXN) |
484 |
| New Zealand Dollar (NZD) |
554 |
| Russian Ruble (RUR) |
810 |
| South African Rand (ZAR) |
710 |
| Swiss Franc (CHF) |
756 |
| Turkish Lira (TRL) |
792 |
| United States Dollar (USD) |
840 |
|
If the specified currency code is not zero (in other words,
it is a currency code other than GoldGrams), the OMI
will convert the specified amount into GoldGrams on behalf of the
merchant using GoldMoney's exchange rates that are provided
through the currency converter. These exchange rates are updated
frequently, and when specifying a currency code other than zero,
the merchant acknowledges that GoldMoney's exchange rate will be
satisfactory.
The merchant acknowledges that GoldMoney provides GoldGram
exchange rates for convenience only. While GoldMoney believes
these exchange rates to be accurate, GoldMoney does not accept
any responsibility for the accuracy of these rates because they
are provided by third parties and are beyond the control of
GoldMoney.
If the merchant does not wish to rely on GoldMoney to perform the
conversion of the specified amount to GoldGrams, the merchant
system will have to perform this conversion prior to submitting
the Payment Request Form. In this case the currency code
must be set to zero to indicate that the specified amount is
already a GoldGram amount.
|
|
The following is an example extract of a Payment
Request Form in which the URLs are not being overridden:
|
<form action="https://secure.goldmoney.com/omi/omipmt.php" method="post">
<input type="hidden" name="OMI_MERCHANT_HLD_NO" value="50-01-00-H">
<input type="hidden" name="OMI_CURRENCY_AMT" value="100.45">
<input type="hidden" name="OMI_CURRENCY_CODE" value="840">
<input type="hidden" name="OMI_SIM_MODE" value="0">
<input type="hidden" name="OMI_MERCHANT_REF_NO" value="12-ABCDEF-34-xyz">
<input type="hidden" name="OMI_MERCHANT_MEMO" value="Payment for order 12-ABCDEF-34-xyz.">
<input type="hidden" name="MERCHANT_FIELD_1" value="VALUE_1">
<input type="hidden" name="MERCHANT_FIELD_2" value="VALUE_2">
...
<input type="hidden" name="MERCHANT_FIELD_X" value="VALUE_X">
</form>
|
|
|
The following is an example extract of a Payment
Request Form in which the URLs are being overridden:
|
<form action="https://secure.goldmoney.com/omi/omipmt.php" method="post">
<input type="hidden" name="OMI_MERCHANT_HLD_NO" value="50-01-00-H">
<input type="hidden" name="OMI_CURRENCY_AMT" value="100.45">
<input type="hidden" name="OMI_CURRENCY_CODE" value="840">
<input type="hidden" name="OMI_SIM_MODE" value="0">
<input type="hidden" name="OMI_MERCHANT_REF_NO" value="12-ABCDEF-34-xyz">
<input type="hidden" name="OMI_MERCHANT_MEMO" value="Payment for order 12-ABCDEF-34-xyz.">
<input type="hidden" name="OMI_RESULT_URL" value="https://www.merchant.com/omiresult.asp">
<input type="hidden" name="OMI_SUCCESS_URL" value="http://www.merchant.com/omisuccess.asp">
<input type="hidden" name="OMI_SUCCESS_URL_METHOD" value="post">
<input type="hidden" name="OMI_FAIL_URL" value="http://www.merchant.com/omifail.html">
<input type="hidden" name="OMI_FAIL_URL_METHOD" value="link">
<input type="hidden" name="MERCHANT_FIELD_1" value="VALUE_1">
<input type="hidden" name="MERCHANT_FIELD_2" value="VALUE_2">
...
<input type="hidden" name="MERCHANT_FIELD_X" value="VALUE_X">
</form>
|
|
| 3.2.2 Payment Notification Form |
This form is submitted by the OMI to the merchant
system in step 14 of Figure 1. The OMI will only
send this form once a successful payment (or simulated payment) has been effected.
- Action - the form action will be set to the Result URL.
- Method - the form method will be set to POST.
The following table describes the fields on the Payment Notification Form:
|
| Table 4: Payment Notification Form Fields |
| Field Name |
HTML Field Name |
Description |
| Merchant Reference Number |
OMI_MERCHANT_REF_NO |
A reference number specified by the merchant that is associated with the payment.
If the merchant did not specify a reference number,
this field will still be sent, but will just have an empty value.
This field is always treated as case sensitive.
|
| Test/Live Mode Flag |
OMI_MODE |
Indicates whether the payment notification relates to a real payment
or a test (simulated) payment. This is the value of the Test/Live Flag
OMI property as set for the merchant Holding, and will be set to either "TEST" or "LIVE".
This field is always in uppercase.
|
| Merchant Holding Number |
OMI_MERCHANT_HLD_NO |
The Holding number that the payment was effected to (the payee), in the format "99-99-99-X".
This field is always in uppercase.
|
| Payer Holding Number |
OMI_PAYER_HLD_NO |
The Holding number that the payment was effected from (the payer), in the format "99-99-99-X".
This field is always in uppercase.
|
| Currency Code |
OMI_CURRENCY_CODE |
The code of the currency, as given in Table 3, that the payment amount was converted from into GoldGrams.
This field is always numeric.
|
| Currency Amount |
OMI_CURRENCY_AMT |
The amount, in the above currency, that was paid to the specified merchant Holding.
This field is always numeric.
|
| GoldGram Amount |
OMI_GOLDGRAM_AMT |
The amount, in GoldGrams, that was paid from the specified payer Holding to the specified merchant Holding.
This field is always numeric.
|
| Transaction ID |
OMI_TXN_ID |
The unique GoldMoney transaction ID that is associated with the payment.
This field is always in uppercase.
|
| Transaction Date and Time |
OMI_TXN_DATETIME |
The date and time (GMT) that the OMI effected the payment, in the format "YYYY-Mon-DD HH24:MI:SS".
This field is always treated as case sensitive.
|
| Secret Key |
OMI_SECRET_KEY |
The Secret Key that is only known by the merchant and the OMI.
This field will always be empty if the Result URL is not
secure, if the Send Secret Key Flag OMI property is set to
indicates that it should not be sent, or if the Result URL is being overridden.
This field is always treated as case sensitive.
|
| Payment Details Hash |
OMI_HASH |
A hash of the above payment notification details using the
hash method as specified by the Payment Details Hash Method OMI property.
This field is always in uppercase.
|
| Merchant Parameters |
As specified by the merchant |
All merchant-specific fields as specified by the merchant on the Payment Request Form.
|
|
Very Important:
- If the Result URL is not an email address, in other words the Result URL
starts with either "http://" or "https://", then the OMI will assume that the
Payment Notification Form was successfully sent to the merchant if and only if
the merchant system returns the string "200 OK" in response to the
Payment Notification message.
- It will be prudent of the merchant to verify both the source and
the integrity of the above payment notification details sent in the Payment Notification Form
as described in section 3.3.
|
|
The following is an example of a Payment Notification Form:
|
<form action="<Result URL>" method="post">
<input type="hidden" name="OMI_MERCHANT_REF_NO" value="12-ABCDEF-34-xyz">
<input type="hidden" name="OMI_MODE" value="LIVE">
<input type="hidden" name="OMI_MERCHANT_HLD_NO" value="50-01-00-H">
<input type="hidden" name="OMI_PAYER_HLD_NO" value="50-04-00-N">
<input type="hidden" name="OMI_CURRENCY_CODE" value="840">
<input type="hidden" name="OMI_CURRENCY_AMT" value="100.45">
<input type="hidden" name="OMI_GOLDGRAM_AMT" value="10.430">
<input type="hidden" name="OMI_TXN_ID" value="R56TMKF">
<input type="hidden" name="OMI_TXN_DATETIME" value="2001-Feb-03 15:02:18">
<input type="hidden" name="OMI_SECRET_KEY" value="Q34rf764GT5r">
<input type="hidden" name="OMI_HASH" value="84AF9B4D4A06ECD097033A170F12D2EF">
<input type="hidden" name="MERCHANT_FIELD_1" value="VALUE_1">
<input type="hidden" name="MERCHANT_FIELD_2" value="VALUE_2">
...
<input type="hidden" name="MERCHANT_FIELD_X" value="VALUE_X">
</form>
|
|
If the Result URL is an email address (starts with
"email:"), then the fields on the Payment Notification
Form will be sent by the OMI to the merchant
system via email to the specified email address.
If the Result URL is an email address, and the value of
the Omit Payment Details Flag is set to true, then the OMI will only include the
following fields from the Payment Notification Form in the
email message:
- Merchant Holding Number (masked);
- Transaction ID;
- Merchant Reference Number.
|
|
| 3.2.3 Payment Success Form |
This form is submitted by the OMI to the merchant
system (via the customer's browser) in step 18 of Figure 1, if a
successful payment (or simulated payment) was effected by the OMI.
- Action - the form action will be set to the Success URL.
- Method - the form method will be set to POST, GET or LINK, depending on
the value of the merchant-specified Success URL Method. In the case of a LINK, the OMI will not send a form
(via the customer's browser) to the Success URL, but will only provide a link to it.
The following table describes the fields on the Payment Success Form:
|
| Table 5: Payment Success Form Fields |
| Field Name |
HTML Field Name |
Description |
| Merchant Reference Number |
OMI_MERCHANT_REF_NO |
The merchant reference number as specified on the Payment Request Form.
If the merchant did not specify a reference number,
this field will still be sent, but will just have an empty value.
|
| Merchant Referrer URL |
OMI_MERCHANT_URL |
If the merchant's checkout page identified itself via the HTTP referrer field in step 5 of Figure 1,
this field will contain that referrer URL, otherwise it will contain the
URL of GoldMoney's home page.
|
| Transaction ID |
OMI_TXN_ID |
The unique GoldMoney transaction ID that is associated with the payment.
|
| Merchant Parameters |
As specified by the merchant |
All merchant-specific fields as specified by the merchant on the Payment Request Form.
|
|
|
The following is an example of a Payment Success Form:
|
<form action="<Success URL>" method="<Success URL Method>">
<input type="hidden" name="OMI_MERCHANT_REF_NO" value="12-ABCDEF-34-xyz">
<input type="hidden" name="OMI_MERCHANT_URL" value="https://www.merchant.com/checkout.asp">
<input type="hidden" name="OMI_TXN_ID" value="R56TMKF">
<input type="hidden" name="MERCHANT_FIELD_1" value="VALUE_1">
<input type="hidden" name="MERCHANT_FIELD_2" value="VALUE_2">
...
<input type="hidden" name="MERCHANT_FIELD_X" value="VALUE_X">
</form>
|
|
| 3.2.4 Payment Failure Form |
This form is submitted by the OMI to the merchant
system (via the customer's browser) in step 18 of Figure 1 if the OMI
was unable to effect a successful payment (or simulated payment),
or if the payment notification (step 14 in Figure 1) failed.
- Action - the form action will be set to the Fail URL.
- Method - the form method will be set to POST, GET or LINK, depending on
the value of the merchant-specified Fail URL Method. In the case of a LINK, the OMI will not send a form
(via the customer's browser) to the Fail URL, but will only provide a link to it.
The fields on the Payment Failure Form are identical to those on the Payment Success Form (see Table 5).
|
|
The following is an example of a Payment Failure Form:
|
<form action="<Fail URL>" method="<Fail URL Method>">
<input type="hidden" name="OMI_MERCHANT_REF_NO" value="12-ABCDEF-34-xyz">
<input type="hidden" name="OMI_MERCHANT_URL" value="https://www.merchant.com/checkout.asp">
<input type="hidden" name="OMI_TXN_ID" value="">
<input type="hidden" name="MERCHANT_FIELD_1" value="VALUE_1">
<input type="hidden" name="MERCHANT_FIELD_2" value="VALUE_2">
...
<input type="hidden" name="MERCHANT_FIELD_X" value="VALUE_X">
</form>
|
|
|
Note that the OMI_TXN_ID field on the Payment Failure Form will contain a
value in the case where the OMI effected a successful payment from the payer Holding to the
merchant Holding, but the subsequent payment notification of that payment
failed for whatever reason (in step 14 of Figure 1). However, in most cases the value of the OMI_TXN_ID
field on the Payment Failure Form will be empty, indicating failure of the
payment (in which case a payment notification will not have been sent either).
|
| 3.3 Validation of Critical Payment Information |
Upon successful payment (or simulated payment) from a customer
Holding to a merchant Holding, the OMI will attempt
to notify the merchant system of such a payment (step 14 in
Figure 1) by sending the payment notification details (via the
Payment Notification Form) to the Result URL.
Although a merchant is not required to execute any of the
following validations, GoldMoney recommends that, upon receipt of
a Payment Notification Form, the merchant system performs
the following:
- Verify whether the payment notification was in fact sent by
the OMI (verify the payment notification source);
- Verify the integrity of the payment notification details sent
by the OMI (verify that no data tampering took place);
- Verify the amount received;
- Verify that the PAYEE Holding number is the same as the
merchant Holding number;
- Verify whether the payment relates to a real or a simulated
payment.
Each of the above steps is described in more detail in the following sections.
|
| 3.3.1 Verify Payment Notification Source |
As mentioned before, the Secret Key OMI property should
only be known by the merchant Holding and the OMI
(this will always be the case, unless it was somehow compromised
by the merchant or the merchant system). Because of this, the
Secret Key enables the authentication of the payment
notification source to the merchant system. The merchant can
authenticate the source in one of several ways, depending on
whether the Result URL is secure or not:
Result URL is Secure, and Result URL is not overridden
If the Result URL is secure (starts with "https://"), and if the
merchant requests the Secret Key to be sent to the Result URL, and
if the Result URL is NOT overridden from the
Payment Request Form, then the merchant has the following options:
- If the merchant does not wish to perform a hash (that must
include the Secret Key) in order to verify the payment
notification source, the merchant can set the Send Secret Key
Flag OMI property to true, and then the OMI will
send the merchant system the Secret Key directly (in the
OMI_SECRET_KEY field of the Payment Notification Form).
The merchant system can then compare its own copy of the Secret
Key with the one sent by the OMI, and if they are
the same, then the merchant system can deduct that the payment
notification source was indeed the GoldMoney OMI;
- If the merchant wishes to perform a hash (that must include
the Secret Key) in order to verify the payment
notification source, the merchant system will, by generating the
hash and comparing it to the hash sent by the OMI,
verify the payment notification source, as the hash must include
the Secret Key. Although it would not make much of a
difference in this case, the Send Secret Key Flag OMI
property can be set to false.
Result URL is not Secure, or Result URL is overridden
If the Result URL is not secure (does not start with
"https://", or is an email address), or if the merchant does
not want the Secret Key to be sent to the Result URL, or if the Result URL
is overridden from the Payment Request Form, then the
OMI will never send the Secret Key directly
to the merchant system via the OMI_SECRET_KEY field in the
Payment Notification Form. In this case it will only
include the Secret Key as part of a hash of the payment
notification details, and this hash is then sent to the merchant
system. This is similar to the scenario described above in which
the Result URL is secure, but the merchant wishes to
perform a hash anyway.
|
| 3.3.2 Verify Integrity of Payment Notification Details |
The OMI will, when sending payment notification
details to the merchant system, send both the payment
notification details and a hash of the payment notification
details.
The merchant can authenticate the source in one of several ways,
depending on whether the Result URL is secure or not:
Result URL is Secure, and Result URL is not overridden
If the Result URL is secure (starts with "https://"), and
if the Result URL is NOT overridden from the
Payment Request Form, then the merchant does not need to
perform a hash of the payment notification details in order to
verify their integrity, as the underlying SSL protocol will
ensure the integrity of the payment notification details during
their transmission from the OMI to the merchant
system. As the OMI will send a hash of the payment
notification details to the merchant system regardless of whether
the Result URL is secure or not, the merchant is therefore
free to still perform a hash if so desired.
Result URL is not Secure, or Result URL is overridden
If the Result URL is not secure (does not start with
"https://", or is an email address), or if the Result URL
is overridden from the Payment Request Form, then
GoldMoney strongly recommends that the merchant system performs a
hash of the payment notification details upon receipt in order to
verify their integrity.
Payment Details Hash
The hash of the payment notification details serves as a
mechanism that the merchant system can use to verify both the
source and the integrity of the payment notification details it
receives at the Result URL in the Payment Notification
Form.
In order to generate the hash, the OMI concatenates
the following fields in the Payment Notification Form
using a question mark ("?") as delimiter:
- Merchant Reference Number
- Test/Live Mode Flag
- Merchant Holding Number
- Payer Holding Number
- Currency Code
- Currency Amount
- GoldGram Amount
- Transaction ID
- Transaction Date and Time
- Secret Key
The hash algorithm the OMI will use to generate the
hash will be determined by the value of the Payment Details
Hash Method OMI property as set in the merchant Holding (MD5
or SHA-1).
In the case of MD5, the calculated hash will consist of 32
hexadecimal digits in UPPERCASE. In the case of SHA-1, the
calculated hash will consist of 40 hexadecimal digits in
UPPERCASE. GoldMoney recommends that merchants implement the
SHA-1 hash method, as it is more secure than the more commonly
used MD5 hash method.
The following provides an example of the calculation of a
payment notification details hash using both hash methods. Assume
the following payment notification details were sent by
the OMI to the merchant system in the Payment
Notification Form (excluding the merchant parameters):
|
| Table 6: Payment Notification Details Hash Fields Example |
| No |
Field Name |
HTML Field Name |
Sample Value and Notes |
| 1 |
Merchant Reference Number |
OMI_MERCHANT_REF_NO |
12-ABCDEF-34-xyz |
| 2 |
Test/Live Mode Flag |
OMI_MODE |
LIVE |
| 3 |
Merchant Holding Number |
OMI_MERCHANT_HLD_NO |
50-01-00-H |
| 4 |
Payer Holding Number |
OMI_PAYER_HLD_NO |
50-04-00-N |
| 5 |
Currency Code |
OMI_CURRENCY_CODE |
840 |
| 6 |
Currency Amount |
OMI_CURRENCY_AMT |
100.45 |
| 7 |
GoldGram Amount |
OMI_GOLDGRAM_AMT |
10.430 |
| 8 |
Transaction ID |
OMI_TXN_ID |
R56TMKF |
| 9 |
Transaction Date and Time |
OMI_TXN_DATETIME |
2001-Feb-03 15:02:18 |
| 10 |
Secret Key |
OMI_SECRET_KEY |
Q34rf764GT5r
(the value of this field may be blank, depending on
the value of the Send Secret Key Flag OMI property, and
whether the Result URL is secure or not)
|
| 11 |
Payment Details Hash (as calculated by the OMI) |
OMI_HASH |
84AF9B4D4A06ECD097033A170F12D2EF |
|
Using the above values (excluding the hash as calculated by
the OMI), a string is created by concatenating the
above values in the specified order using a question mark ("?")
as delimiter:
12-ABCDEF-34-xyz?LIVE?50-01-00-H?50-04-00-N?840?100.45?10.430?R56TMKF?2001-Feb-03 15:02:18?Q34rf764GT5r
Note that the above string may not be shown as a continuous
string of characters in this document (because it may be wrapped),
but the hash will be
performed on a continuous string of characters. In addition, the
value of the Secret Key in the above concatenation must be
used as it is known to the merchant system, and NOT as it
was sent by the OMI (if it was sent at all).
The expected hash in the OMI_HASH field of the Payment
Notification Form, if the Payment Details Hash Method
OMI property is set to MD5, is:
84AF9B4D4A06ECD097033A170F12D2EF
The expected hash in the OMI_HASH field of the Payment
Notification Form, if the Payment Details Hash Method
OMI property is set to SHA-1, is:
2288FEA4F5375D90F47943D7E33290ABF6792632
If the hash sent by the OMI is identical to the
hash calculated by the merchant system, the merchant can safely
infer that:
- the payment notification details were indeed sent by the
GoldMoney OMI;
- the values of the fields in the Payment Notification
Form were received exactly as they were sent by the OMI.
|
Very Important:
Because some of the fields on the Payment Notification
Form are passed via the customer's browser prior to them
being sent back to the merchant system by the OMI in
step 14 of Figure 1, there can be no absolute guarantee that the
values of these fields will be the same as set on the Payment
Request Form by the merchant (because the field values on an
HTML form can be modified manually, using a text editor, before
the form is submitted to a web server). It is therefore important
that the merchant does not assume that the integrity of these
field values are necessarily intact.
|
| 3.3.3 Verify Amount Received |
|
Because any information submitted by a customer's browser can
be modified by the customer (such as the amount and currency
code), it is important that the merchant verifies that the
GoldGram amount paid to the merchant Holding (OMI_GOLDGRAM_AMT
field in the Payment Notification Form) is indeed the
GoldGram amount that the merchant was expecting to receive.
|
| 3.3.4 Verify Payee Holding Number |
|
Because any information submitted by a customer's browser can
be modified by the customer (such as the payee Holding number),
it is important that the merchant verifies that the merchant
Holding number (payee) as specified by the OMI
(OMI_MERCHANT_HLD_NO field in the Payment Notification
Form) is indeed the Holding number of the merchant.
|
| 3.3.5 Verify Real or Test/Simulated Payment |
Because the OMI enables merchants to test the integration of
the OMI with the merchant system without effecting real payments,
the Payment Notification Form can relate to either a real
payment or a simulated payment, based on the value of the
Test/Live Flag OMI property set by the merchant.
It is therefore important for a merchant system to verify that,
upon receipt of a Payment Notification Form, whether a
real payment was effected in the OMI, or if it was
only a test or simulated payment. The OMI_MODE field in the Payment
Notification Form can be used for this purpose, as it will be
set to either "TEST" or "LIVE" depending on the value of the
Test/Live Flag OMI property.
If the value of the OMI_MODE field is "TEST", then the payment
notification details on the Payment Notification Form will
NOT BE AUTHENTIC, as they were fabricated by the GoldMoney
system, and therefore WILL NOT relate to an actual
payment.
If the value of the OMI_MODE field is "LIVE", then the payment
notification details on the Payment Notification Form are
indeed authentic, as they will relate to an actual payment
effected in the OMI.
|
| 3.3.6 Conclusion |
|
From the previous sections it should be obvious that having a
secure Result URL has more advantages than a non-secure
Result URL. GoldMoney recommends that merchants implement
secure Result URLs if at all possible. GoldMoney also
recommends the selection of SHA-1 rather than MD5 as the
Payment Details Hash Method, as it is more secure.
|