Creating a payment (easy way)
Last updated
Last updated
To initiate a payment through a single form of payment, you just need to direct the user to a special URL and transfer a number of required parameters.
GET
https://unitpay.money/pay/PUBLICKEY?sum&account&desc&signature
The request is used to initialize a payment
publickey
string
You can find it under the Settings tab of your project
account
string
Subscriber ID in your system (for example, client e-mail or in-game nickname)
sum
number
Payment amount. In USD by default.
desc
string
Order description. It is used only for informing when making a payment
signature
string
It protects you from hackers: Digital signature.
It is formed as sha256(account + "{up}" + currency + "{up}" + desc + "{up}" + sum + "{up}" + secretKey), where sha256 is the hashing method; {up} is the parameter separator in the hash function; account, sum, currency, desc are the payment initialization parameters described above; secretKey is the secret key of the project (available in your personal account).
Important Note: If you do not transmit currency to the payment form, this parameter should not be used in signature generation.
The PUBLIC KEY and SECRET KEY values of the project can be found on the Project Settings page
currency
string
The order currency according to ISO 4217 (EUR, USD, RUB, UAH, BYN, etc. Currency codes).
If the payment system does not support the required currency, the amount will be converted to the payment system currency.
locale
string
It is mandatory to specify the payment form language, acceptable values: ru, en.
By default, the form language is determined based on the country that the user's IP address belongs to
backurl
string
The user's return address from the payment form without making a purchase; the project address is used by default. The project domain must be used in the address.
Examples:
https://redirect.<project domain>/?someParams", "https://<project domain>/redirect/
subscription
string
Valid values: true, false. Use this flag if you want to create a subscription by the payer's card. The subscription ID (subscriptionId) will be passed in the PAY method to your payment handler.
Subscriptions can be used only after coordination with the support service.
Example of creating a digital signature:
Example:
Default payment method
You can define the payment system that will be used for the user by default. To do this, add parameter / system_code corresponding to the alphabetic code of the payment system at the end of the URL of your payment form.
Return to the store's website
After initializing the payment, the user goes to the receipt page where the payment status is tracked. After users have received a successful or error status, they are redirected to the partner's site (Fail URL/Success URL fields in the project settings) with GET parameters:
Value
Description
account
text
Subscriber ID in the partner's system (for example, the subscriber's login or email)
paymentId
number
Payment number in the UnitPay system