Payment Page is the quickest
way to integrate with Roecny and enjoy the benefits of
this feature-rich payment solution.
Simply loading Payment Page via
an IFrame or a full page redirect is all it takes to
seamlessly integrate Payment
Page’s features and functionality
into your site.
To use the Payment Page
solution, create an HTTPS request with all the relevant
transaction input encoded as a query string, and use it
to redirect your customer to our page (or IFrame).
Follow the steps below to integrate and use
Payment Page.
Payment Page can be
customized using the Theme Builder
in the Control Panel.
The Payment Page product should not
be confused with the Simply Connect product
(checkout()
method), which is an
entirely different solution.
The transaction input parameters
string is a list of all the input
parameters and their values in the
exact order that they are sent in the
request.
Prepare the input parameters:
- Calculate a
total_amount
for the
transaction. For details, see the Total Amount
Calculation topic.
- Create a transaction input parameters
string containing the input
parameters this format:
[field1]=[value1]&[field]2=[value2]&[field3]=[value3]…
These are the minimum (required) input
parameters needed to process a transaction:
There are many other input parameters that
you can include.
Parameter |
Description |
merchant_id |
The vendor’s
unique identification number
provided by Roecny. |
merchant_site_id
|
The vendor
website’s unique identification
number provided by Roecny. |
total_amount |
The total amount
of the transaction. |
currency |
The three-letter
ISO currency code for the currency
used in the transaction. |
user_token_id |
This parameter is
a unique identifier for each
customer generated by the vendor.
|
item_name_N |
The name of the
item. |
item_amount_N |
The price of the
item number. |
item_quantity |
The amount of
items being purchased. |
time_stamp |
The GMT time that
the transaction took place in the
following format:
YYYY-MM-DD.HH:MM:SS |
version |
The current
version of the payment page.
Currently, the version is=4.0.0 |
notify_url |
URL to which the
webhook notification is sent. |
checksum |
The calculated
checksum value. |
merchant_id=283475&merchant_site_id=89123755&total_amount=15¤cy=USD&user_token_id=test@test.com&item_name_1=item1&item_amount_1=15&item_quantity_1=1&time_stamp=2011-01-05.06:04:26&version=4.0.0¬ify_url=https://notify.merchant.com
3.
Prepare the Authentication Request
Include a SHA-256 encrypted checksum
in your
HTTPS request to help Roecny authenticate the request
and avoid communication errors.
Follow these steps to create the checksum
:
- Create a string of the values of
all the input parameters (without spaces) in the
exact order that they are sent in the request, as
follows:
- Copy the transaction input
parameters
string and delete
everything except the
values of all the input
parameters (without spaces).
- Concatenate the
value of your
secret
key to the front
of the string.
For example, assuming a secret
key value of:
Secret123
Secret1232834758912375515USDtest@test.comitem11512011-01-05.06:04:264.0.0https://notify.merchant.com
- Generate an encrypted
checksum (based on the
example string above) by running the string through
a SHA-256 encryption function:
027402ea5d3e62179bfd82ec70eae2ad16efe7802880d452214d685169ce9300
- Use the encrypted checksum
value the
checksum
parameter in the
request:
checksum=fedf7e2f70006c83fa740bfa121cdcac0932a672fc7e12a55621153cb52cddf9
4.
Submit a Request to the Payment Page
Send an HTTPS request to the Payment Page either in the
GET name/value pair format or as a POST.
Create an HTTPS query string by
concatenating the endpoint URL
of your payment page and the transaction
input parameters string:
5. Handle the Response
After Roecny attempts to process the payment, your
customer is redirected to a relevant Transaction
Outcome page on your site, depending on the
results:
Roecny also sends you a response via an HTTPS GET, which
contains transaction details such as the outcome and
customer payment details.
Four sets of parameters that are sent as part of the
HTTPS GET:
6. Appendix
– Calculations
Response
Checksum Parameter
To ensure that the HTTPS GET from Roecny is authentic, an
advanceResponsechecksum
parameter is
included in the HTTPS GET.
Calculate the SHA-256 or MD5 encoded checksum, of a
string of the concatenated values, of the following
parameters:
Although MD5 encryption is supported, SHA-256 is
recommended.
merchantSecretKey
totalAmount
currency
responseTimeStamp
ppp_TransactionID
status
productId
Example Response
Checksum
The concatenated string is made up of the values of the
above parameters (assuming the secret key value is Secret123
and an item_quantity_1 (1):
Secret123115USD2007-11-13.13:22:343453459APPROVEDYourProduct
The calculated checksum would then be:
4cf3573877655c9b84ae8040beb586d9bc69d09d33ee4f4b451027579aa3f586
Total Amount
Calculation
Calculate the transaction total
amount as follows:
- Calculate the transaction
sub-total:
The transaction sub-total
is the sum of all the item amounts, including their
shipping, handling, discounts, etc.
Calculate the transaction
sub-total in either of
these ways:
- Calculate the per-item
total for each item
and then sum all the per-item
totals to get a
transaction
sub-total.
- Calculate the entire transaction total to
get a transaction
sub-total.
- Calculate the transaction
tax:
The transaction tax is
calculated as a percentage of the transaction
sub-total.
- Add the transaction tax to
the transaction
sub-total to get the
transaction total amount.
The parameters that can be used in the calculation
include:
- Item level parameters:
item_amount_N
item_discount_N
item_shipping_N
item_handling_N
item_quantity_N
shipping
handling
discount
total_tax
(this is the tax
percentage to be applied to the
transaction)
version
Example of a
Total Amount Calculation
Calculate the transaction total
amount as follows:
- Either:
- Calculate the per-item totals:
Transaction sub-total
=
sum((item_amount_N
–
item_discount_N
+
item_shipping_N
+
item_handling_N
) *
item_quantity_N
)
- Or calculate the entire transaction
total:
Transaction sub-total
=
item_amount_N
+
shipping
+
handling
–
discount
- The tax is then added to calculate the total:
calculatedTotalAmount
=
transaction sub-total +
transaction sub-total
* (total_tax
/ 100)
Example of a Total Amount Calculation (with values)
Input values:
- Item amount = 350
- Shipping = 10
- Discount = -20
- Total tax = 23% (0.23)
- Total amount = 418.20
- Either:
- Calculate the per-item totals:
Transaction sub-total
=
sum((item_amount_N
–
item_discount_N
+
item_shipping_N
+
item_handling_N
) *
item_quantity_N
)
340
= 350
+ 10
– 20
- Or calculate the entire transaction total
(which includes shipping & handling
costs and discounts):
Transaction sub-total
=
item_amount_N
+
shipping
+
handling
–
discount
340
= 350
+ 10
– 20
- The tax is then added to calculate the total:
calculatedTotalAmount
=
transaction sub-total +
transaction sub-total
* (total_tax
/
100)
418.20
= 340
+ ( 0.23
* 340)
If the total amount has more than two digits
after the decimal, you must round the amount
to the nearest hundredth.