Payment signature

Digital signature of payment is necessary to verify the immutability/correctness of data in the process of transferring them over the network between the participants of the payment.

The parameters that make up the digital signature (the order of the parameters does matter):

Parameter Description Type Example
publicKey Payment application ID for PayOp merchant. string application-1
amount Order amount. Number with 4 digits after the comma as a string.
An example of formatting/casting to a string:
number_format(2.3400000, 4)
string 2.3400
currency Order currency. string USD, EUR, RUB
orderId Order id/number. string 1457, fa34-e1
paymentType Payment type: but or app. string but
payment Requested payment method. string ALL
status Transaction status in PayOp system.
wait — pending transaction payment.
success — transaction is paid.
error — improper processing of transaction.
refund — transaction is refunded.
Empty string (''), if status is not known or not passed.
string '', 'success'
payopId Internal payment transaction id. Empty string (''), if id is not known or not passed. string '', 15752

Signature encryption method - sha256

Example of generating a signature:

<?php
    $msg = implode(',', array($publicKey, $amount, $currency, $orderId, $paymentType, $payment, $status, $payopId, $secretKey));
    $hash = hash("sha256", $msg);