5) Mobile Payment Create

Merchants should send mobile payment request to api.paym.es service as follows.

order_create

POST https://api.paym.es/v4.6/order_create

The first step to getting mobile payments via Paymes is creating a Payment request.

You can send the data shown below as an HTTP Post Request to Paymes to create a payment request. If the information is OK, your request to create a mobile payment transaction is approved and the necessary information is sent to the mobile phone number to complete the payment. Card information can be sent to Paymes servers in 2 different ways; via a Hosted Payment Page that developed and maintaned by Pamyes, or using Paymes API via HTTP Post Request method. It is sufficient to use only one of these two different methods. If there is no error in the card information, the URL to which the buyer will be directed for 3D verification is sent as a reply.

Request Body

NameTypeDescription

publicKey*

string

Your public key

orderId*

string

Unique variable in your system so that you can follow the payment process

price*

string

Payment price amount Example: 10.00

currency*

string

"TRY", "USD", EUR"

productName*

string

The name or stock code of the product

buyerName*

string

The name and surname of the buyer.

buyerPhone*

string

Phone number of the buyer.

buyerEmail*

string

Email of the buyer.

buyerAddress*

string

Address of the buyer.

hash*

string

Base64 encoded string of SHA512 hash of data sent. It is detailed below.

mobilePay*

boolean

true

{
    "status" : "return_url",
    
    "message" : "Redirect 3D",
    
    "returnUrl" : "https:\/\/api.paym.es\/payment\/fbe04621-ee39-451b-a694-09a6fed22809",
    
    "paymesOrderId" : "fbe04621-ee39-451b-a694-09a6fed22809"
}

Generating Hash Information

To generate hash; concatenate strings in this order: "orderId + price + currency + productName + buyerName + buyerPhone + buyerEmail + buyerAddress + secretKey" Get the hash of the string with SHA512 (SHA1 512). Encoding this output should be base64

For example, a hash value that created using the following values:

orderId = "123456789";

price = "1050";

currency = "TRY";

productName = "Ürün İsmi";

buyerName = "Mehmet Yılmaz";

buyerPhone = "05555555555";

buyerEmail = "email@example.com";

buyerAddress = "Örnek adres bilgisi";

secretKey = "111111111";

Combine these variables via the string concatenate method:

str = orderId + price + currency + productName + buyerName + buyerPhone + buyerEmail + buyerAddress + secretKey;

str = "1234567891050TRYÜrün İsmiMehmet Yılmaz05555555555email@example.comÖrnek adres bilgisi111111111";

If this string is hashed with the SHA512 method and then the output is encoded with base64, the output will be in the following string:

hash = "knYih0b6Nrvqvw7yxtt5H9Tb6kkH7RJkYlB450FziSBKfx0q2eZACHLi+ZexDZKcs9rxJ//QCmoaq12LaI5+3g==";

If the hash is sent incorrectly, the request will fail.

Last updated