Te Timata Ma te Keeti Matatapu i te Node JS

Mena kei te whakamahere koe ki te tiimata ki te whakaae ki nga utu moni crypto me te kore e mohio ki te mahi a PrivacyGate, he pai ki te whakapau i te 5 meneti o to wa.

Rarangi o nga moni crypto e waatea ana: Bitcoin, Bitcoin Cash, Ethereum, Litecoin, USD Coin, Tether (ERC20), Dai, Chainlink.

Tirohia tauira kaupapa i:https://github.com/privacyshore/privacygate-node-sample

alt

Na kia timata tatou.

I mua i tetahi mea ka haere

  1. Registering an PrivacyGate accountalt
  2. Navigating to the “settings” pagealt
  3. Generating an API keyaltalt
  4. Keep track of this API key as it will be needed in this tutorial

I muri i to mahi i tenei, haere ki to taiao whanaketanga me te mahi i nga whakahau e whai ake nei:In case you have no project to work with as of right now, check out our sample project athttps://github.com/privacyshore/privacygate-node-sample

npm install privacygate

Ma tenei ka whakauru i te whare pukapuka nodejs privacygate.

var privacygate = require('privacygate');
var Client = privacygate.Client;

var clientObj = Client.init('<API_KEY>');
clientObj.setRequestTimeout(3000);

Ma tenei ka hanga he ahanoa kiritaki ka taea e matou te whakamahi ki te taunekeneke me te API privacygate.

Ma tenei ka taea e tatou te mahi i nga mahi maha. Hei tauira (mo nga Takitaki):

  1. Retrieve
var Checkout = privacygate.resources.Checkout;
Checkout.retrieve(<checkout_id>, function (error, response) {
  console.log(error);
  console.log(response);
});
  1. Create
var checkoutData = {
    'name': 'The Sovereign Individual',
    'description': 'Mastering the Transition to the Information Age',
    'pricing_type': 'fixed_price',
    'local_price': {
        'amount': '100.00',
        'currency': 'USD'
    },
    'requested_info': ['name', 'email']
};
Checkout.create(checkoutData, function (error, response) {
  console.log(error);
  console.log(response);
});

// or

var checkoutObj = new Checkout();

checkoutObj.name = 'The Sovereign Individual';
checkoutObj.description = 'Mastering the Transition to the Information Age';
checkoutObj.pricing_type = 'fixed_price';
checkoutObj.local_price = {
    'amount': '100.00',
    'currency': 'USD'
};
checkoutObj.requested_info = ['name', 'email'];

checkoutObj.save(function (error, response) {
  console.log(error);
  console.log(response);
});
  1. Update
var checkoutObj = new Checkout();

checkoutObj.id = <checkout_id>;
checkoutObj.name = 'new name';

checkoutObj.save(function (error, response) {
  console.log(error);
  console.log(response);
});
// or
var newParams = {
    'name': 'New name'
};

Checkout.updateById(<checkout_id>, newParams, function (error, response) {
  console.log(error);
  console.log(response);
});
  1. Delete
var checkoutObj = new Checkout();

checkoutObj.id = <checkout_id>;
checkoutObj.delete(function (error, response) {
 console.log(error);
 console.log(response);
});

// or

Checkout.deleteById(<checkout_id>, function (error, response) {
 console.log(error);
 console.log(response);  
});

Tirohangahttps://github.com/privacyshore/privacygate-node/tree/master/examples/resourcesmo etahi atu tauira