Crypto Payment Gateway or API for Crypto Payments

BestRate
BestRate
Published in
5 min readMar 31, 2020

--

Overview

BestRate has already developed plugins for popular CMS platforms, like Magento and WooCommerce. However, we wanted to make a Universal Crypto Payment product that can be used by any traditional or blockchain business to accept payments in BTC, ETH, USDT, and 120+ blockchains and tokens or accept payment with bank cards transforming it to crypto on the fly. We are ready to present Crypto Payment Gateway or API for crypto payments.

Advantages

BestRate is not the only company that may help with crypto payments. However, we are the only ones that make it universal. Any business can start process crypto payments using their local crypto exchange, like Kraken, Binance, Coinbase or any other. That means that you can create a business account at Kraken crypto exchange and collect all the payments at that crypto exchange without any commission from our side. Additionally, we are able to exchange incoming payments into a stable coin, like USDT or TUSD, to protect you against volatility risks. BestRate administrates and orchestrates the process, so you and your team can focus on other tasks.

Advantages of using BestRate:

  • Use of any crypto exchange
  • No hidden commissions
  • Automatic conversion to stable coins at your crypto exchange account
  • Full transparency of operations at your crypto exchange account
  • Crypto->Fiat transfers using your local crypto exchange

How to start using it?

To start using the BestRate’s blockchain as a service generalized software interface, you must register on the site. Immediately after registration, a 30 day free trial period will begin, allowing you to check the platform’s capabilities for free.

How to add your crypto exchange?

As a next step, we would ask you to configure the Binance exchange account (if you don’t have it, please create one) to deposit all funds there. We recommend using Binance, but you can add any other supported exchange too.

  1. Open Binance website, sing in and follow this link: https://www.binance.com/en/usercenter/settings/api-management
  2. Enter a name, e.g. BestRate and press the Create button. Then, you will get API Key & Secret Key from Binance.
  3. Open https://bestrate.org/cabinet and sign in with username and password.
  4. Open BestRate->“Crypto Exchanges” and press the “Add Account” button. Copy Binance keys step by step into the BestRate add account form.
  5. Go to BestRate->”Subscription” and SignUp for Crypto Gateway plan, you’ll have 30 days of a free trial period for tests.

If you need a more detailed description of how to integrate your Binance account with screenshots, you can find it in this blog post.

How can I configure Crypto Payment Gateway?

Please go to BestRate->eCommerce and create new Crypto Payment Gateway, like this:

Choose your Crypto Gateway name and description, it could be your business name. Let’s fill all the fields for World Wildlife Fund, as an example. You would need to add your business URL, Receiver Currency(currently, BTC, ETH) and choose your connected crypto exchange account.

As a result, you’ll get your API and Secret Key, that you can use with API methods, described below. You can check orders by clicking “Orders” tab on the upper side of the configuration page.

Where can I see the API methods?

Please check the Complete Sequence Diagram and API methods below. If you have any questions, don’t hesitate to contact us.

Terms

Crypto Payment Gateway API usage requires a “Crypto Gateway” plan(199$/month) with 30 days free trial.

If you have any questions, please contact us at support@bestrate.org

Start your FREE trial

Complete Sequence Diagram

Complete sequence diagram

API methods

1.1 Create order.

1.1.1 Request

{
"jsonrpc": "2.0",
"id": 1,
"method": "payment-gateway.order.create",
"params": {
"account_engine": "api",
"amount": 100,
"callback_token": "Custom value",
"callback_url": "https://jinigram.com/api/v1/callback",
"currency": "Shop currency, e.g. eth, usd, etc",
"customer_email": "testmail@gmail.com",
"properties": {},
"shop_created_at": "2019-12-11T18:31:01",
"shop_domain": "jinigram.com",
"shop_order_id": "1",
"timestamp": 1576063803
}
}

1.1.2 Response. Order_uuid is required to identify current order.

{
"id": "1",
"result": {
"order_uuid": "10cc6a6a-d762-478b-b2f1-21f620e263a2"
},
"success": true
}

1.1.3 Headers

  • 1.1.3.1 Public-Key: you account public key
  • 1.1.3.2 Signature: hex(md5(amount + currency + shop_order_id + account_engine + private_key + timestamp));

1.2 Check commission. It depends on the order currency and payment currency.

1.2.1 Request

{
"jsonrpc": "2.0",
"id": 1,
"method": "payment-gateway.order.cost",
"params": {
"currency": "payment currency, e.g. eth, btc, etc",
"order_uuid": "1b6f6682-dea0-457e-9f5e-5db8c0f3f76b"
}
}

1.2.2 Response

{
"id": "1",
"result": {
"amount": 40
},
"success": true
}

2.3 Pay

2.3.1 Request

{
"jsonrpc": "2.0",
"id": 1,
"method": "payment-gateway.order.pay",
"params": {
"currency": "btc",
"order_uuid": "1b6f6682-dea0-457e-9f5e-5db8c0f3f76b"
}
}

2.3.2 Response (crypto pay). Qr_code contains unique address to send payment.

{
"id": "1",
"result": {
"action": {
"address": "3FCBvrvWP4pHRe9cm2gF6HmH1grY1trnn3",
"currency": "btc",
"qr_code":
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXIAAAFyAQAAAADAX2ykAAACgElEQVR4nO2bQW7bMBBF31QE
vKSAHKBHoa7WI/UG0lF8gADi0oCE3wVJ2UlRJCls1SqGC5mm3+IDg88ZDmUTXxnTty/h4LzzzjvvvPPO/4m3OgJM5WHGZG
Y25PbbsKMe5+/Fh/KRRoD8AqkVXFZmuVvK1330OP8YPleH2gBAXNDYmGLsffU4/yB+sgDpHABW+/d6nL8/b0NcMLOTbHgG
Pc7/Nd823iggA8RXE3SC/ILIcNsCeTb9zn+Kn8zMrAfS+SQbcsAGwAbWUj7vq8f5O/HFvzcOnXq2rLtaNfZ+epx/BN+OuQ
GNcaHUzz/6TqWw9vr5sDySJI100hgXpLlT+2EpD1KZSRqfTb/zn+PjxWzIAaa+rtiQT2IqJj7pHf9oPc7fh6++vHqVKEGs
a1CMLZHcvwfkS3xL8DR3LdIztCBLV87jezS+xpfmUNK8ebpl4lJueXyPy0tnM7jJv6sxfV+oMT97/j0o/zb/quXauRNJLb
7EOnP/Ho2/yb+k+W0tFVXPTCOdfH8+JN8aF7mnbMhkQ5N1i6V5DaRzwJJW0z56nL8vv90vLIH083ofuJom68TUd4uRXzz/
HpNv+3PbmsshqSZhbs/Enn+PyF/9i0FYjHgxpXNYBGpXDdnw/fmQ/FY/t15G2mZb1ez+PS7f+htldCqtq7Q1scpJafb+1b
H52p8EG9guFGIz8fR9wYY99Th/J36rr6herWv1aqFC3p/8b/gS5HwSSRcrja2R7cXZp9fv/JsRfl9aDeLFRO4x6GQQvH4+
Jv/+/UnBEgQrlkZhxBmIr417Nv3OfzDe1c+t09FewiqXhO0m2PPv0XjTx8zN8P93O++888477/wd+F/Nsdq7C+u8dgAAA
ABJRU5ErkJggg==",
"type": "default"
},
"message": "",
"transaction": {
"deposit_value": 0.04011556,
"id": "pp-dc10101c-e620-4041-9750-d5f84df016ca",
"withdrawal_value": 1.96642772
}
},
"success": true
}

2.3.3 Response (fiat pay)

{
"id": "1",
"result": {
"action": {
"fields": [
{
"name": "version",
"type": "hidden",
"value": "1"
},
{
"name": "partner",
"type": "hidden",
"value": "bestratewallet"
},
{
"name": "payment_flow_type",
"type": "hidden",
"value": "wallet"
},
{
"name": "return_url",
"type": "hidden",
"value": "https://bestrate.org/exchange/transaction-info?id=7e4e7b734d254068931b8994f43033db"
},
{
"name": "quote_id",
"type": "hidden",
"value": "26408c1e-286b-4c1e-ab69-3c96c55dbc02"
},
{
"name": "payment_id",
"type": "hidden",
"value": "ff012bd0-1cfa-11ea-afeb-4796ccbe94b0"
},
{
"name": "user_id",
"type": "hidden",
"value": "f150f37ad309f6362255ddda5ccdb42a"
},
{
"name": "destination_wallet[address]",
"type": "hidden",
"value": "0xaBa5A33e9ddd38975C1f6332c69d929aa51eC890"
},
{
"name": "destination_wallet[currency]",
"type": "hidden",
"value": "ETH"
},
{
"name": "fiat_total_amount[amount]",
"type": "hidden",
"value": "14447.91"
},
{
"name": "fiat_total_amount[currency]",
"type": "hidden",
"value": "USD"
},
{
"name": "digital_total_amount[amount]",
"type": "hidden",
"value": "95.00345893"
},
{
"name": "digital_total_amount[currency]",
"type": "hidden",
"value": "ETH"
}
],
"message": "You will be redirected to the page of our partner - Simplex.
Your funds will be delivered to your wallets in 5-30 minutes. Click Continue to agree and proceed.",
"type": "form",
"url": "https://checkout.simplexcc.com/payments/new"
},
"transaction": {
"deposit_value": 14447.908045,
"id": "pp-063392c3-1575-496c-bc99-5e11f7c79755",
"withdrawal_value": 95.00345893
}
},
"success": true
}

--

--