From 7b5e0c63c637567afb581a20e765721770ed1dc2 Mon Sep 17 00:00:00 2001 From: dima Date: Tue, 23 Mar 2021 16:13:50 +0200 Subject: [PATCH] frn-1134 fix code style fields and try it out to all sections --- add-custom-button-section.js | 13 ++++++++----- add-tutorial-section.js | 33 ++++++++++++++++----------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/add-custom-button-section.js b/add-custom-button-section.js index 4eb6ff0..550aa68 100644 --- a/add-custom-button-section.js +++ b/add-custom-button-section.js @@ -107,7 +107,10 @@ setTimeout(function () { }).render("cps-button-container-2"); -
+
+

Try it out

+
+
@@ -154,7 +157,7 @@ setTimeout(function () { }
-
+

Try it out

@@ -216,7 +219,7 @@ setTimeout(function () {
-
+

Try it out

@@ -245,7 +248,7 @@ setTimeout(function () {
-
+

Try it out

`; @@ -473,4 +476,4 @@ setTimeout(function () { var container = document.getElementById("webhooks-log-container"); container.scrollTop = container.scrollHeight; - }},3000); \ No newline at end of file + }},3000); diff --git a/add-tutorial-section.js b/add-tutorial-section.js index 68dd3e5..76f8ece 100644 --- a/add-tutorial-section.js +++ b/add-tutorial-section.js @@ -35,7 +35,7 @@

For getting all available currencies we'll send an HTTP request (GET) to /api/v1/currencies.
The response will contain information about all available currencies.
Currency information looks like

-
{
+  
{
      "id":1,
      "type":"crypto",
      "symbol":"BTC",
@@ -83,7 +83,7 @@
   
   
   

The response will be looks like

-
{
+  
{
     "items": [
       {
         "baseCurrencyId": 1,
@@ -100,7 +100,7 @@
   
  • Buyer personal data (name, email, phone, etc)
  • For creating new payment we will send HTTP request (POST) to /api/v1/invoices. The request body should look like

    -
    {
    +  
    {
         "clientId": "string",
         "currencyId": 0,
         "invoiceId": "string",
    @@ -315,7 +315,7 @@
       
    • id - The id of the account from which to spend funds from
    -
    {
    +  
    {
         "recipients": [
           {
             "address": "string",
    @@ -359,7 +359,7 @@
       
       
       

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    +  
    {
         "spendRequestId": "string",
         "spendRequestToken": "string"
       }
    @@ -390,7 +390,7 @@
       
  • id - The id of the account for converting
  • The request body should look like

    -
    {
    +  
    {
         "convertToCurrency": 0,
         "recipients": [
           {
    @@ -439,7 +439,7 @@
       
       
       

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    +  
    {
         "spendRequestId": "string",
         "spendRequestToken": "string"
       }
    @@ -468,8 +468,7 @@
       

    Tutorial 4: Using the MerchantCallback api endpoints

    This tutorial covers creating callback addresses CoinPayments.net using the API request /api/v1/merchant/callbacks and receiving IPNDTO on your url. It also explains how to list all callback addresses, find the callback address by its id, update information about the callback address and list information about all merchant transactions.

    For sending any of these requests you have to use a pre-request for the authentication. Here is an example in JavaScript: -
    -    
    + 
    
       var clientId = "7aa5e7ba45d84d978c5ea7f62498abf4";
       var clientKey = "I1sCXrA4jS29f4JYk3mohCoErLHvpESW3XF83sxo/lg=";
       pm.request.headers.add({
    @@ -506,7 +505,7 @@
             

    Part A: Creating callback addresses

    For creating callback addresses we'll send HTTP request(POST) to /api/v1/merchant/callbacks

    The request body should look like

    -
    {
    +        
    {
         "clientId":"7aa5e7ba45d84d978c5ea7f62498abf4",
         "currencyId":4,
         "label":"testcallbacketh",
    @@ -549,7 +548,7 @@
               
             
             

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    +        
    {
          "id":"6Fa43sdVgjHuZRMuzei8ae",
          "clientId":"AaXX9g2Zp99ij2cvLVymTN",
          "created":"2020-10-28T09:44:54.9986654+00:00",
    @@ -607,7 +606,7 @@
             
             After making these steps the request will be sent on your url.
           

    The body of the request contains next information:

    -
    {
    +      
    {
       "id": "bdaae1f4c051445099325f384a74e46b",
       "type": "CallbackDepositConfirmed",
       "timestamp": "2020-10-15T13:16:56.27704444+00:00",
    @@ -700,7 +699,7 @@
               
  • limit -
  • When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    +       
    {
          "items":[{
              "id":"6Fa43sdVgjHuZRMuzei8ae",
               "clientId":"AaXX9g2Zp99ij2cvLVymTN",
    @@ -748,7 +747,7 @@
               
  • id - The id of the callback address
  • When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    +        
    {
          "id":"56NVoGgbkPxStkhTjokV8E",
          "clientId":"AaXX9g2Zp99ij2cvLVymTN",
          "created":"2020-09-28T13:43:10.01129+00:00",
    @@ -807,7 +806,7 @@
               
  • id - The id of the callback address
  • The request body should look like

    -
    {
    +        
    {
         "clientId":"7aa5e7ba45d84d978c5ea7f62498abf4",
         "currencyId":4,
         "label":"testcallbacketh",
    @@ -856,7 +855,7 @@
     
             
             

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    +        
    {
         "items":[{
             "id":"Dv1vDiDmfVrgSkEB2bLcUA",
             "created":"2020-09-25T08:36:23.470791+00:00",
    @@ -946,4 +945,4 @@
             var apiContent = $("#apiContent")
             apiContent.insertBefore(createElementFromHTML(contentHtml), apiContent.firstChild.nextSibling);
     
    -    }, 1000);
    \ No newline at end of file
    +    }, 1000);