Skip to main content

XAMAX plugin with exchange

XAMAX provides you PHP plugin that you can use as HTML widget. You can add the XAMAX payment script to the website's html layout and accept payments without the need for integration using the API.

tip

We provide Merchant key, which you will use for requesting to XAMAX API

You need to provide the following information to connect:

  • Your SMTP server details for sending emails to you and your customers (required)
    • Host
    • Port
    • Username
    • Password
  • Your E-mail for order notifications (required)
  • URL for redirect upon successful payment; (not necessary)
  • URL for redirect in case of unsuccessful payment; (not necessary)
  • Chat ID for Telegram ; (not necessary)

Connecting to an iFrame Page

Attach js file https://link.xamax.io/payment.min.js - paste it after opening <body> tag:

<script type="text/javascript" src="https://link.xamax.io/payment.min.js"></script>

Make a request to an iFrame window with an object:

{
"merchant": {
"key": "merchant_key",
"Wallet": "final destination wallet",
"redirect": {
"success": "https://site.com/congratulations?code_item=123123",
"fail": "https://site.com/error?code_item=123123"
}
},
"order": {
"name": "Test",
"amount": 599,
"descriptions": "Text for description",
"currency": "USD",
"text_after_confirm": "Text printing after confirm order"
// text to display after order confirmation (page with QR-Code)
}
}

Example: Request iFrame window for payment. To call the iFrame window, on the payment methods selection page, you need to add the XAMAX payment method to the "Pay" button for this payment method.

Page code example:

<!doctype html>
<html just="in">

<head>
<title>Test Page Xamax</title>
</head>

<body>
<script type="text/javascript" src="https://link.xamax.io/payment.min.js"></script>

<a href="javascript:iFrameXamaxPay({merchant: { key: '222', wallet: '0xFD2E5E91EeCE76C0deA7fe5DB082f911bE1F5cb3', redirect:{"success": "https://site.com/congratulations?code_item=123123" , "fail" : "https://site.com/error?code_item=123123" ,}}, 'order' : {'name' : 'TestProduct2' , 'amount' : 5, 'currency' : 'USD' }});">TestProduct2 5 USD to 0xFD2E5E91EeCE76C0deA7fe5DB082f911bE1F5cb3</a>
</body>

</html>

In the example the following parameters are sent:

ParameterDescription
keyreceived from us
wallet*Final destination wallet, when should be send the payment; (in the example: 0xFD2E5E91EeCE76C0deA7fe5DB082f911bE1F5cb3) (Mandatory)
name*The name of the product/service for which the Client pays; (in the example above: Test)(mandatory field) - this will be displayed to the user on the link page.
amount*the cost of the course to be paid; (in the example above: 599)(Mandatory)
currency*exchange rate currency; (example: USD)(Mandatory)
redirect.successThe URL to which the user will be redirected after successful payment
redirect.failThe URL to which the user will be redirected after an unsuccessful payment
* - Mandatory field

Supported fiat currencies

Supported currencies that we can convert to cryptocurrencies:

Currency codeTitle
USDUS Dollar
EUREuropean Euro
CNYChinese Yuan
GBPBritish Pound Sterling

Supported cryptocurrencies

Currency codeTitle
ethEthereum
usdt (ERC-20)Ethereum ERC-20 USDT
btcBitcoin
bchBitcoin Cash
btgBitcoin Gold
dashDash
ltcLitecoin
qtumQtum
zecZcash
usdc (ERC-20)TRON
usdt (TRC-20)TRON TRC-20 USDT

User statuses

Currently, the system has the following user statuses:

StatusDescription
Createdthe transaction has been created, awaiting payment;
Awaiting paymenta transaction is fixed in the blockchain;
In progressreceiving confirmations in the blockchain;
Successfully paidthe transaction was successfully paid;
Payment has been expiredthe transaction has expired, the payment has NOT been made (by default, the transaction lifetime is 30 minutes - can be extended);
Payment has failedthe transaction was canceled by the client;

Redirect to pages after successful or unsuccessful payment

After payment, the user is automatically redirected to the URL. There are two kinds of redirects, successful URL and unsuccessful URL.

<!doctype html>
<html just="in">

<head>
<title>Test Page Xamax redirect url</title>
</head>

<body>
<script type="text/javascript" src="https://link.xamax.io/payment.min.js"></script>

<a href='javascript:iFrameXamaxPay({"merchant": {"key": "merchant_key", “wallet”:”wallet”, "redirect": {"success": "https://site.com/congratulations", "fail": "https://site.com/error"}},"order": {"name": "Test","amount": 599,"currency": "USD"} );'>Test pay 599 USD</a>

</body>

</html>

Notifications

Email Notification

After successful payment, an automatic email will be sent to:

  • user, which he indicated in the form of payment;
  • to the merchant (to you)

To set up outgoing mail, you need to send your manager the following data from the mail server from which it will be sent:

  • SMTP server. Host
  • SMTP server. Port
  • SMTP server. Login
  • SMTP server. Password

Email for notifications – a letter will be sent to this e-mail about successful payment by the Client;

Notifications in Telegram

You can use telegram bot @XamaxLinkBot , to receive notifications of successful / unsuccessful payment from our system.

To do this, you need to give us your user/group id.

  1. Finding a bot @username_to_id_bot and running it.
  2. in response you will receive a message like "P.S. Your ID: 661465180"
  3. After giving us the ID, we will find the bot@XamaxLinkBot and run it (this step is required to allow the bot to send you messages)
  4. After that bot will notify the user with the ID passed to us.

If you need to receive notifications in a chat for a group of people, you can create your own chat in which @XamaxLinkBot must be an Administrator, with the ability to send messages.

Chat ID can also be found through the bot @username_to_id_bot and send it to us.

Support cases

Payment failed:

  1. It is necessary to request from the client the tx hash of the transaction
  2. Verify transaction via:
    1. Ethereum/USDT(ERC-20)/USDC – etherscan.io
    2. Tron/USDT (TRC-20) – tronscan.org
    3. Other currencies – blockstream.info
  3. If there is a transaction, but the money has not been credited to the wallet, notify your manager

No notifications from payment:

  1. You need to go to your Personal Account on my.xamax.io and see if there is an incoming transaction in the Crypto Transactions section in the Complete status.
  2. If this transaction exists, then write to your manager;
  3. If this transaction does not exist, then it is necessary to request tx hash from the Client for verification;

How to test with test currency

tip

Our test (sandbox) environment supported next currencies: Bitcoin, Litecoin, Bitcoin Cash, Ethereum, TRON, USDT (ERC-20), USDT (TRC-20), USDC (ERC-20), ZCASH, QTY

If You don’t have wallets at any currencies above, You can use:

  • MetaMask (for ETH, USDT (ERC-20) and USDC (ERC-2))
  • TronLink (for TRX, USDT(TRC-20))
  • or You can use our documentation about test wallets or see below:

MetaMask:

  1. Install extension MetaMask (Google Chrome, Firefox) (if don’t have)
  2. Create account (or login into account)
  3. Select a network - Sepolia
  4. If You don’t see, check the switcher “Show test network” - should be ON
  5. At account click to “Import token” , paste token at filed “Token contract address”: 0x3bFE52C28219fd26Fda584fbc8c8e87f728a2073
  6. You successfully added an ETH token.
  7. For top up balance of wallet at ETH, open the link - https://sepoliafaucet.com/
  8. Paste Your wallet
  9. Click “Send me”
tip

If You need USDT(ERC-20), please, contact us.

  1. Install extension TronLink (Google Chrome, Firefox) (if don’t have)
  2. Create account (or login into account)
  3. Select a network - Tron Nile Testnet
  4. If You don’t see, check the switcher “Show test network” - should be ON
  5. Click to plus (➕) and select USDT (TRC-20)
  6. You successfully added TRX token and USDT
  7. For top up balance of wallets open link https://testfaucet.bt.io/#/tron
  8. Select network - Nile Testnet
  9. Select token: TRX, USDT (TRC-20)
  10. Paste Your address from TronLink
  11. Click “Obtain”

How to pay at sandbox environment:

  1. You created invoice and You got invoice wallet and amount for payment;
  2. Open MetaMask/TronLink;
  3. Click to “Send” at extension;
  4. Input received wallets and amount;
  5. Click to “Pay”