Sale Token

Added the checkout 3rd type - Sale Token , which allows to sell currency
- Select the type
- Fill the form
Payment methods - choice of currencies in which the user wants to accept payments.
Receive payment - the currency the user wants to sell.
The currency you selected in the "Receive payment" field is reset in the "Payment methods" field. Therefore, if you first selected one currency, and then selected another in the "Receive payment" field, then fill in the "Payment methods" field again.
Merchant wallet - wallet from which sales will be carried out.
Min - minimum sale amount.
Max - maximun sale amount.
Max button - button to receive the maximum possible amount for sale. When receiving the amount, MinerFee and System Fee are taken into account, as well as already created checkouts based on the selected merchant wallet.
The amount of checkouts based on one merchant's wallet should not exceed its balance. For example, on your merchant wallet balance is 2000 TRX, you can create n number of checkouts, but their value in the max field in total should not exceed 2000 TPX.
If you do not have the main currency on your account, that is, not enough to pay Miner Fee for at least one transaction, then when you receive the maximum amount for the token, you will receive 0.
Fixed - the user enters the currency price on their own.
Market - the price of the currency is taken from CPAY Coin Price - service for obtaining historical, statistical data on crypto pairs.
Add token - link to the form for adding your own currency.
Enter price - field for entering your own currency price. The field is limited to 6 decimal places.
Expire time - the time that the estimated selling price of your currency will be held.
- Payment widget
You send - field for entering the amount and selecting the currency for which you want to purchase the currency indicated in the You Get field.
Estimated Exchange Rate - the exchange rate of your chosen currencies.
You get - field for entering the amount of currency you want to buy.
Min amount - the minimum allowable sale amount.
Max amount - the maximum allowable sale amount. This value is updated every 15 seconds and also when the user fills in the Recipient field.
If the user did not use the MAX button and entered the entire balance of the wallet, then the max amount field will be recalculated and will contain the value from Miner Fee and System Fee.
If, based on the results of sales, the maximum amount is less than the minimum amount, then a corresponding message is displayed:
Price fixed for {n} minutes - fixed price per amount and currency in the You get field. When the time passes, a form is displayed to update the price:
Recipient - the wallet to which the purchased funds are sent. When you enter it, the fixed price is also updated.
- Comfirm exchange
- Customer details
- Payment widget
Amount - the price of the currency specified in the You get field.
Address - wallet address to which you want to send the amount specified in the Amount field.
If the user sent an amount less than specified in the Amount field, then the purchase will be an amount less. But if the total amount sent in the equivalent is less than indicated in the min amount field, then the purchase will not be made.
If the user sent an amount greater than the amount specified in the Amount field, then the purchase will be for an amount greater or close to it (depending on the merchant wallet from which the sale is made) in accordance with the established rate.
Awaiting deposit - waiting for replenishment of funds to the specified address.
Confirming - replenishment of funds to the specified address is completed.
Exchanging - there is an exchange of currencies, on the example of BNB for ETH.
Sending to you - sending funds to a recipient.
If exchange rate expired, then opens the payment widget.
- Payment successfull
Make an exchange - return to payment widget.