Unitpay
en
en
  • Home
  • First steps
    • Registration
    • Adding a Project
      • Adding a VK Community Project
    • Project Moderation
    • Transfer of the Project
    • Video tutorials
  • Payments
    • Creating a payment (easy way)
    • Creating a Payment
    • Creating a payment (widget)
    • Parameters for receipts
    • Creating Payment Links in Your Personal Account
    • Payment Handler
    • Payment information
    • Payment Refund
    • Payments with Pre-authorization
    • Recurring payments
      • Creating a Subscription
      • Getting Information About Subscription
      • Getting a List of Active Subscriptions
      • Closing a Subscription
  • Mass payouts
    • Creating a payout
    • Information about Payout
    • Card information by BIN
    • Payments based on a CSV registry
  • Online cash desk
    • Parameters for generating a receipt
    • Unit.Reciepts
    • Adding online cash desk
    • Types of Online Cash Register Receipt Items
    • Advance credit reciepts
  • Modules
    • Payment handler
    • Unitpay SDK
    • CMS modules
      • Amiro
      • PHPShop
      • 1C Bitrix
      • CS-Cart
      • DIAFAN.CMS
      • Drupal 7 (commerce)
      • Drupal 7 (ubercart 3)
      • Drupal 8, 9 (commerce)
      • Ecwid by Lightspeed
      • HostCMS
      • InSales
      • Joomshopping 4 (joomla 3)
      • LogicBoxes
      • Magento
      • Magento 2
      • OpenCart
      • osCommerce
      • Prestashop
      • ReadyScript
      • ShopCMS
      • Simpla
      • Tilda
      • Netcat CMS
      • UMI.CMS
      • VamShop 2
      • VirtueMart 3 (joomla 3)
      • Webasyst Shop Script 7 (8)
      • Wix
      • Woocommerce Wordpress
      • Zen Cart
      • Amiro CMS
      • CMS NWICODE
      • MODX (miniShop2)
  • Manage Unitpay
    • Interface Instructions
    • SP documents
    • Legal entity documents
    • Current Balance
    • Commissions
    • Currency Conversion Rates
  • Book of reference
    • System IP addresses
    • Payment Form Appearance
    • Using the Test API
    • Operator Codes
    • Payment System Codes
    • Currency codes
    • Qiwi Country Codes
  • Referral program
    • Interface of Referrer's (Agent's) Account
  • Support
  • Other
    • Telegram bot
    • Using the Test API
  • Google Pay™
Powered by GitBook
On this page

Was this helpful?

  1. Payments

Creating a payment (widget)

PreviousCreating a PaymentNextParameters for receipts

Last updated 4 days ago

Was this helpful?

A widget is a pop-up window with a payment form. To use the widget, you just need to add its code to the site page, configure the transfer of parameters and create an event for its call (for example, clicking on a button). The example code and description of the used widget parameters are located in the Unitpay personal account in the project settings on the "Payment widget" tab (at the screenshot below).

Example code:

<script src="https://widget.unitpay.money/unitpay.js"></script>
<script type="text/javascript">
this.pay = function() {
var payment = new UnitPay();
payment.createWidget({
publicKey: "PUBLIC KEY",
sum: 1,
account: "demo",
domainName: "unitpay.money",
signature: "2c38bb3114b2f02222ee35f6b60c6bbe628ad31bed59633787204ae59659a02e",
desc: "Описание платежа",
locale: "ru",
});
payment.success(function (params) {
console.log('Успешный платеж');
});
payment.error(function (message, params) {
console.log(message);
});
return false;
};
</script>

Additional parameters:

Value

Description

locale

ru, en

Forcing the language of the widget.

currency

string

paymentType

string

hideMenu

true, false

Hides the menu with the payment method options.

hideOtherMethods

true, false

Hides the window with the payment method options.

subscription

true

subscriptionId

number

preauth

0,1

preauthExpireLogic

number

The field for the logic of blocking payments with pre-authorization:

0 - If there is no request for confirmation or cancellation, the payment will be confirmed upon the expiration of the blocking period on the acquiring bank's side (~ 114 hours after the creation of the payment);

1 - If there is no confirmation or cancellation request, the payment will be canceled after the blocking period on the side of the acquiring bank (~ 114 hours after the creation of the payment).

If the parameter is not used, the payment will be canceled after the expiration date.

If you've connected an online cash desc in your Unitpay personal account, then in order to generate receipts, you must additionally transfer a number of parameters:

Value

Description

cashItems

string

Can be formed as in the example or by these ways: btoa(unescape(encodeURIComponent(JSON.stringify([{"name":"Shaverma", "count": 1, "price":10.00, "type":"commodity"}])))) ________________________

const cashItems = [{ name: 'Shaverma', count: 1, price: this.amount, type: 'commodity' }];

btoa(JSON.stringify(cashItems))

customerEmail

string

Client's email to which the receipt will be sent

customerPhone

string

Order amount, for example, 10.00. Make sure to check this value with the original order amount.

customerPhone

string

Payer's phone number in international format without "+" (the check won't be sent to it)

If you'll have any additional questions during the integration, you can ask them to our customer support - in Unit.Help or send your questions to manager@unitpay.money

The order currency according to ISO 4217 (RUB, UAH, BYN, EUR, USD etc. ). If the payment system does not support the required currency, the amount will be converted to the payment system currency.

, through which the payment will be made.

Use this flag, if you want to create a subscription using the payer's card. The subscription ID (subscriptionId) will be passed in the PAY method to your . The use of subscriptions is possible only after agreement with the Unitpay Security Service.

Subscription ID in the UnitPay system. This parameter must be previously received in the PAY method to your .

Use this flag to create a payment with , by default the flag is switched off and the value is 0

Read more

Currency codes
Code of the payment system
payment handler
payment handler
pre-authorization
here