Payeer Merchanten
Payeer Merchanten
To connect to Payeer:
2. Activate the merchant in the “Merchant Settings” tab by going to the “Activation” tab and
filling in the following fields:
Name: the name of your website, e.g. “Google”. This name will be displayed on your
merchant list and the user’s list when paying an invoice.
Secret key: a string of characters for signing data transmitted in the payment
initialization form and checking incoming data when processing a payment.
Domain : your website’s domain name, e.g. “google.com”. The domain name can
only contain Latin letters, numbers, and hyphens. To convert national domain names, use
any punycode converter such as punycoder.
3. Confirm your ownership of the website by placing a text file in the website's root directory.
1
4. Fill in the following fields:
Success URL: this is the address the customer will be redirected to once payment
has been completed successfully.
Fail URL: this is the address the customer will be redirected to in the event of an error
during the payment process or if payment is cancelled.
Status URL: the address of the payment processor. This page is where orders can be
marked as paid or, for example, funds can be sent to the customer’s account on your
website.
Key for encrypting additional parameters:a secret key for encrypting additional fields,
as well as dynamic success, fail, and status URL’s.
5. Submit the merchant for moderation. Prior to moderation, only the owner of the merchant
can perform payment as long as this person has already logged into Payeer.
1. Enter a new secret code (unfortunately, it is not possible to view the old code for security
reasons, but you can always replace it with a new one).
3. Enter a key for encrypting additional parameters if you are planning to transfer them to the
payment form or you need dynamic interaction addresses (success, fail, or processor’s
address).
4. Enter the addresses of successful and failed payments and the payment processor.
2
5. Select a notification server (by default, the server is selected automatically when a
notification is sent).
In the “Appearance” tab you can disable unneeded sections and payment methods or set
only the currencies you need. Methods unavailable for direct payment of the invoice are
grayed out, but your customer can always add funds to their internal Payeer account and
then pay your invoice from that account. After clicking on these methods, the customer is
provided with detailed instructions on how to return to paying your invoice.
In the “Website connection” tab you can download a ready-made module for your CMS and
find examples for manual connection.
To test a signature that has been generated, you can use the tab of the same name in the
merchant’s settings.
3
Explanation of the Parameters of the Payment Initialization Form
Example:12345
Example:1.00
Potential currencies:USD,
EUR, RUB
It is encoded by a base64
algorithm.
Example:dGVzdA==
4
PHP код:<?php echo
base64_encode('test'); ?>
Example:
9F86D081884C7D659A2FE
AA0C55AD015A3BF4F1B2
B0B822CD15D6C15B0F00
A08
Example:2609
Example:USD
Additional parameters
5
to in the event of an error in
the payment process or if
payment is cancelled
PHP
<?php
$m_shop = '12345'; // merchant ID
$m_orderid = '1'; // invoice number in the merchant's invoicing system
$m_amount = number_format(1, 2, '.', ''); // invoice amount with two decimal places
following a period
$m_curr = 'USD'; // invoice currency
$m_desc = base64_encode('Test'); // invoice description encoded using a base64
algorithm
$m_key = 'Your secret key';
/*
// Forming an array for additional parameters
$arParams = array(
'success_url' => 'http://google.com/new_success_url',
'fail_url' => 'http://google.com/new_fail_url',
'status_url' => 'http://google.com/new_status_url',
6
// Forming an array for additional fields
'reference' => array(
'var1' => '1',
'var2' => '2',
'var3' => '3',
'var4' => '4',
'var5' => '5',
),
// Forming a signature
$sign = strtoupper(hash('sha256', implode(':', $arHash)));
?>
<form method="post" action="https://payeer.com/merchant/">
<input type="hidden" name="m_shop" value="<?=$m_shop?>">
<input type="hidden" name="m_orderid" value="<?=$m_orderid?>">
<input type="hidden" name="m_amount" value="<?=$m_amount?>">
<input type="hidden" name="m_curr" value="<?=$m_curr?>">
<input type="hidden" name="m_desc" value="<?=$m_desc?>">
<input type="hidden" name="m_sign" value="<?=$sign?>">
<?php /*
<input type="hidden" name="form[ps]" value="2609">
<input type="hidden" name="form[curr[2609]]" value="USD">
*/ ?>
<?php /*
<input type="hidden" name="m_params" value="<?=$m_params?>">
*/ ?>
<?php /*
<input type="hidden" name="m_cipher_method" value="AES-256-CBC">
*/ ?>
7
<input type="submit" name="m_process" value="send" />
</form>
Java
import java.util.*;
import java.lang.*;
import java.security.MessageDigest;
import java.util.Base64;
class Rextester
{
public static void main(String args[])
{
String m_shop = "12345";
String m_orderid = "1";
String m_amount = "1.00";
String m_curr = "USD";
String m_desc = "Test invoice";
String m_key = "Your secret key'";
System.out.println(url);
}
return bytesToHex(hash).toUpperCase();
}
catch(Exception ex)
{
throw new RuntimeException(ex);
}
}
8
public static String bytesToHex(byte[] bytes)
{
StringBuffer result = new StringBuffer();
for (byte b : bytes) result.append(Integer.toString((b & 0xff) + 0x100,
16).substring(1));
return result.toString();
}
}
PHP
<?php
$m_shop = '12345'; // merchant ID
$m_orderid = '1'; // invoice number in the merchant's invoicing system
$m_amount = number_format(1, 2, '.', ''); // invoice amount with two decimal places
following a period
$m_curr = 'USD'; // invoice currency
$m_desc = base64_encode('Test'); // invoice description encoded using a base64
algorithm
$m_key = 'Your secret key';
$arHash = array(
$m_shop,
$m_orderid,
$m_amount,
$m_curr,
$m_desc
);
// Forming a signature
9
$sign = strtoupper(hash('sha256', implode(":", $arHash)));
Python 2
import binascii
from hashlib import sha256
m_shop = "12345"
m_orderid = "1"
m_amount = "1.00"
m_curr = "USD"
description = "Test"
m_desc = binascii.b2a_base64(description.encode('utf8'))[:-1].decode()
m_key = "Secret key"
result_string = ":".join(list_of_value_for_sign)
sign_hash = sha256(result_string)
sign = sign_hash.hexdigest().upper()
C#
using System;
using System.Security.Cryptography;
using System.Text;
namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
var m_shop = "12345";
var m_orderid = "1";
var m_amount = "1.00";
var m_curr = "USD";
var m_desc = Base64Encode("Test");
var m_key = "Secret key";
var arr = new string[] { m_shop, m_orderid, m_amount, m_curr, m_desc, m_key };
10
public static string sign_hash(string text)
{
byte[] data = Encoding.Default.GetBytes(text);
var result = new SHA256Managed().ComputeHash(data);
return BitConverter.ToString(result).Replace("-","").ToUpper();
}
Payment Processor
The payment processor is designated to process payments on your website. This page is
where orders can be marked as paid or, for example, funds can be sent to the customer’s
account.
PHP
<?php
// Rejecting queries from IP addresses not belonging to Payeer
if (!in_array($_SERVER['REMOTE_ADDR'], array('185.71.65.92', '185.71.65.189',
'149.202.17.210'))) return;
11
// Adding additional parameters to the array if such parameters have been
transferred
if (isset($_POST['m_params']))
{
$arHash[] = $_POST['m_params'];
}
// Forming a signature
$sign_hash = strtoupper(hash('sha256', implode(':', $arHash)));
To ensure the security of queries accepted from your website, be sure to install
a check of the sender’s IP address. You can get a list of our IP addresses here
https://payeer.com/merchant/ips.txt
You can always see how your payment processor has responded to our payment notification
by going to History, clicking on your merchant’s tab, and then clicking on the notification
button.
12
Internal payment number m_operation_id A unique payment number
in the Payeer system
Example:123456
Date and time of transaction m_operation_date The date and time of the
transaction (UTC+3)
Example:21.12.2012 21:12
Date and time of payment m_operation_pay_date The date and time of the
payment (UTC+3)
Example:21.12.2012 21:12
Example:12345
Example:1.00
Potential currencies:USD,
EUR, RUB
Example:dGVzdA==
13
check the cohesiveness of
the information obtained and
directly identify the sender
Example:
9F86D081884C7D659A2FE
AA0C55AD015A3BF4F1B2
B0B822CD15D6C15B0F00
A08
Example:
[email protected]
Example:P1000001
Example:12345
Example:1.00
14