Rocketfuel Blockchain
  • Welcome to Rocketfuel
  • Core Concepts
    • Overview
    • Partners
    • Merchants
    • Shoppers
    • Exchanges
    • QR Payments
    • Bank Payments
    • Invoices
    • Settlements
  • Plug-ins and SDKs
    • Bigcommerce
    • Magento
    • PrestaShop
    • WooCommerce
    • Webflow
    • Web SDK
  • Developer Guides
    • Overview
    • Quick Start
    • API Reference
      • PayIns
        • Overview
        • Encryption Algorithm
          • Public Key Based
          • Secret Key Based
        • Authentication
          • Authenticate a merchant
          • Authentication Without Email / Password
        • RocketFuel UI Integration
          • Generate Invoice Link
          • Payment Processing
            • RKFL Payment Page
            • RKFL Payment Widget
          • Transaction Lookup
            • Lookup using Auth
            • Lookup using Public Key
          • Webhooks
          • Handling Partial Payments
        • Custom UI Integration
          • Cryptocurrencies listing
          • Generate QR Code
          • QR Payment Status
          • Transactions Lookup
          • Webhooks
          • Handle Partial Payment
        • Utility APIs
          • Subscriptions/Recurring Payments
          • Store info
          • Shopper
            • Shopper manual signup
            • Verify shopper's email id
            • Shopper manual login
            • Shopper info
            • Shopper wallet balance
          • Exchange Payment
            • Exchanges listing
            • Pre-payment validation check
            • Payable amount
            • Trigger Exchange payment
          • Transaction listing
          • Order info
      • Payout
        • Overview
        • Add Payee
        • API Guide
        • Webhooks
    • Swagger API
  • Integrations
    • RocketFuel Integration
      • Objective
      • Target Audience
      • Product Feature overview
      • "How To" Guide
        • Sign up as a Merchant
        • KYC Verification
        • Using the RocketFuel API for Custom Integration
        • Using the RocketFuel Pre-built Solutions for Custom Integration
        • How to Use Testnet for Transactions
      • FAQ and Tips
  • Web UI
  • User Guide and Help Videos
    • White Label Requirements
    • ACI Merchant Onboarding Document (Certification)
    • Merchant User Guide
      • Sign-up Process
      • Sign-in Process
      • Merchant Dashboard
      • Transactions
      • Shoppers
      • Reports
      • Invoices
      • Users
      • Funds
      • Bank/ACH Payments
      • Instore
      • Settlements
      • Subscriptions
      • Release Notes
      • Verification
      • Help/FAQ
      • Plugins
        • How to Setup RocketFuel on Different plugins
        • How to Use Rocketfuel With Different SDKs
      • Settings
    • Shopper User Guide
      • Dashboard
      • Purchases
      • Profile
      • Exchange
      • Bank/ACH Payments
      • Help/FAQ
      • Settings
      • Subscriptions
    • Partner User Guide
      • Dashboard
        • How to Invite Merchants
        • How to Generate Auth Header for Merchants
      • Transactions
      • Refunds
      • Shoppers
      • Merchants
      • Reports
      • Subscriptions
      • Payment Settings
      • Settings
      • Release Notes
    • Super Partner Guide
      • Overview
      • How to Invite Partners
  • Release Notes
    • Change Log
Powered by GitBook
On this page

Was this helpful?

  1. Developer Guides
  2. API Reference
  3. PayIns
  4. Utility APIs
  5. Exchange Payment

Pre-payment validation check

In case of exchange payment, the merchant can check a few validations before initiating a payment ex:

  1. Insufficient Balance

  2. The deposit address is not whitelisted

  3. Password is required

  4. etc

This API is NOT a core element of the payment flow. However, this helps to make a user-friendly payment solution.

The validation messages vary from exchange to exchange, but the API returns the same object with a different code that needs to handle at the merchant website.

Example:

  1. OKcoin needs the deposit address for the whitelist, so this API checks whether or not the user has already whitelisted this address. In the API response, if the key "showWhitelistElement: true" means the deposit address is not whitelisted and merchant website should display the customer error.

  2. A shopper's password is needed to withdraw the fund. If API returns a key "password: true," the shopper didn't provide the password, and the merchant's website should display a message to enter the password.

This API accepts the request payload in an encrypted format. The encryption algo is <algo_name> and encryption key is <client_secret>.

// The sample request payload that needs to encrypt
{
  "clientId": "merchantid",
  "assets": "Selected exchange currency",
  "cart": "cart array",
  "offerId": "Order_id",
  "confirmation": "true",
  "nativeAmount": "cart amount in usd"
}

// clientId: The RKFL merchant identifier
// assets: Selected exchange currency (BTC/ETH)
// cart: cart array [{},{}]
// offerId: merchant unique identifie
// confirmation: true/false, true if shopper accept term and condition
// nativeAmount: cart total amount in USD

// The key "data" should generate from the below way.
export const data = async (toEncrypt, publicKey) => {
  const buffer = Buffer.from(toEncrypt);
  const encrypted = crypto.publicEncrypt(publicKey, buffer);
  return encrypted.toString('base64');
};

POST /exchanges/payment-validate/{exchange_name}

The value of exchange_name are "coinbase/okcoin/kraken/gemini/binanceus"

Headers

Name
Type
Description

Authorization*

String

"Bearer" + shopper access token

Content-Type

String

application/json

Request Body

Name
Type
Description

data*

String

Encrypted string

{
    "ok": true,
    "result": {
        "receiverAddress": "3Jmmku8JTHP2YsqNZ3RuhZdburbdHMtSjT",
        "receiverMemo": null,
        "amount": 0,
        "currency": "BTC",
        "fee": 0.00000526,
        "password": false,
        "showWhitelistElement": false,
        "exchange": "coinbase",
        "nativeAmount": 5,
        "newRate": {
            "percentRate": 0,
            "newFiatRate": 0
        }
    }
}
PreviousExchanges listingNextPayable amount

Last updated 2 years ago

Was this helpful?