Relictum Pro
KNOWLEDGE BASEFAQDEVELOPING
English
English
  • KNOWLEDGE BASE
    • Relictum Pro TESTNET
      • Terms and conditions of access to RELICTUM PRO TESTNET
      • Instructions for downloading and installing Android-based application
    • The essence of the project
      • What is Relictum Pro?
      • Mechanisms and principles of work
      • N-dimensional model of smart-contracts
      • Technical specifications
      • Advantages
      • Networking and nodes
    • Introduction
      • What is Blockchain?
    • Historical review of the industry
    • Problem
    • Solution. Proof of tsar
    • Review of competitors and comparison
    • Distinctive features and advantages
    • Applications. Social significance
    • Tokenomics/Economic component of the platform
    • Roadmap
    • Brief description
  • FAQ
    • Instructions
      • How to install Relictum Pro node on MacOS?
      • How to create an account in a Relictum Pro node on Mac OS?
      • How to copy a Relictum Pro wallet to Mac OS?
      • How to create an account in a Relictum Pro node on Android?
      • How to create an account in a Relictum Pro node on Windows?
      • Instructions for importing GTN tokens from your personal account to the node
      • How to launch white node
      • Enabling the Payment Gateway
    • Hot Answers
  • DEVELOPING
    • Relictum Finance
      • Callback
      • User verification
      • Status
      • Purchase
      • List of available merchants
    • Relictum Node (JSON RPC API)
      • General information / configuration
      • webapi version
      • New user registration
      • Login
      • Getting user information
      • Getting balance
      • Export private key
      • Import private key
      • Transfer
      • Getting transfer status
      • Getting a list of wallet transactions
    • Relictum Node API
Powered by GitBook
On this page
  • 1. White Node
  • 2. Encryption Keys
  • 3. Relictum PHP SDK
  • 4. Registration of a Payment Contract in the White Node
  1. FAQ
  2. Instructions

Enabling the Payment Gateway

PreviousHow to launch white nodeNextHot Answers

Last updated 2 years ago

The following attributes are required for arranging the payment acceptance through Relictum Pay:

  1. White node.

  2. Encryption keys.

  3. Payment contract registered in the White node.

  4. Relictum PHP SDK.

1. White Node

A White node is a node with a public IP address, which can be used to arrange any private home server for publishing on the Internet.

on Medium.

2. Encryption Keys

Access keys must be generated for authorization on the node when performing invoicing requests and asset transfers.

Type the following commands in the console one by one:

openssl genrsa - out private .key 2048
openssl rsa - in private . key -pubout -out key .pub

Step-by-step instructions can be found below:

Step 1. First command.

Step 2. Result.

Step 3. Second command.

Step 4. Result.

The keys will be generated as a result. They will look as follows in the folder:

You need to rename the key.pub file to match your contract URI in order to issue invoices via RelictumPay. The file name must exclude "system://" and include the "-" character as a delimiter. Move it to the root directory of the node.

Example: your contract is system://payments/mycontract . In this case, the file (key) must be named payments-mycontract.pub .

Arranging payments from the node:

  • The key.pub file must be renamed into transfer.pub in order to send GTNs;

  • The key.pub file must be renamed into transfer2.pub in order to send any other tokens.

An example of a folder with a node with files is below:

When authorizing a request, the .key file corresponding to its .pub key pair must be sent along with the data.

This is another way to create an invoice for a customer via a php smart contract using our SDK:

$r = $request->doPaymentCreate( 'contract' , [ 'data' => [
        'payment' => $id,
        'addressfrom' => $relictum,
        'addressto' => $myaddress,
        'token' => 'usdr' ,
        'amount' => $sum
    ]]);

Result:

3. Relictum PHP SDK

If you use PHP in your project, the SDK will help you set up this process.

Installation. Enter the command in the console:

composer require relictumblockchain/rphpsdk

If you use versions from >=PHP8, you must add the disable version checking flag, otherwise the installation will fail:

--ignore-platform-req=php

You can also make requests in other languages or in other ways. The above sequence works for PHP.

4. Registration of a Payment Contract in the White Node

  1. Go to Products -> Payment contract -> Add contract

  2. Fill in the following fields:

  • System name of the contract: any name in Latin in lower case, preferably in one word;

  • Supplier: select any name, preferably a short one, as it will be visible in the RelictumPay section as the object issuing the invoice. If the supplier name is long, it will cause line folding, so it is advisable to use a short one).

Result:

  1. You will be charged 50 USDR after you create and save a payment contract.

Example of sending a request via the console:

<?php

require ( _DIR__ . '/vendor/autoload.php' );

$privateKeyPath = _DIR__ . '/transfer.key';
$authorizationHelper = new
\Relictum\RPHPSDK\Helpers\AuthorizationHelper($privateKeyPath);

// Create configurator and set node uri
$configurator = new Relictum\RPHPSDK\RequestConfigurator([
    'config' => [ 'base_uri' => 'http://127.0.0.1/api/' ],
    'authorization' => $authorizationHelper
]);

// Create a new request
$request = new Relictum\RPHPSDK\Request($configurator);

try {
    // Create a new payment invoice
    
    $id = 10 ; // Payment id (any number, unique for this
    contract)
    $contract = 'mycontract' ; // Contract alias
    $relictum = 100 ; // The account of the user to whom the
    invoice is being issued
    $myaddress = 1 ; // The account to which the tokens will be
    transferred after payment
    
    $response = $request->doPaymentCreate($contract, [ 'data' => [
        'payment' => $id,
        'accountfrom' => $relictum, // or addressfrom for use
        relictum address instead of id
        'accountto' => $myaddress, // or addressto for use
        relictum address instead of id
        'token' => 'usdr' ,
        'amount' => 200
    ]]);
}
catch (Relictum\RPHPSDK\Exceptions\NodeRequestException $e) {
    // Catch exception and output error data
    var_dump($e);
}

// Output node response
var_dump($response);

with an enabled payment contract and a detailed example of PHP scripts.

Installation guide
Example of a node