
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
remote-pay-cloud
Advanced tools
Current version: 1.1.0-RC1
This SDK provides an API to allow your web application using Javascript to interface with a Clover® Mini device (https://www.clover.com/pos-hardware/mini)
The API is available on GitHub for download, and can be used in conjunction with the proper browser framework from a NodeJS require
directive, hosted on NPM
Sale()
, VoidTransaction()
, ManualRefund()
, etc.onSaleResponse
, onRefundPaymentResponse
, etc.Payment
, CardTransaction
, Order
, etc. These objects will match those defined in clover-android-sdkThe library requires the browser you use to support WebSockets. See WebSocket Browser Support.
A sale/refund UI example project Clover Cloud Connector Example is available for download and deployment, or direct deployment to a Heroku server.
A example project composed of small examples Clover Cloud Connector Unit Examples is available for download and deployment, or direct deployment to a Heroku server.
Please report back to us any questions/comments/concerns, by emailing semi-integrations@clover.com.
A deprecated beta version of the Connector (Clover.js) is included in this version with require
directive syntax, but will removed in the future.
The beta version includes the earliest library as well as a server with examples of the functions.
Clover's cloud connector API. Published as an NPM package. Intended for use in a browser environment.
require("prototype");
var $ = require('jQuery');
var clover = require("remote-pay-cloud");
var log = clover.Logger.create();
var connector = new clover.CloverConnectorFactory().createICloverConnector({
"oauthToken": "1e7a9007-141a-293d-f41d-f603f0842139",
"merchantId": "BBFF8NBCXEMDV",
"clientId": "3RPTN642FHXTX",
"deviceSerialId": "C031UQ52340015",
"domain": "https://dev1.dev.clover.com/"
});
var ExampleCloverConnectorListener = Class.create( clover.remotepay.ICloverConnectorListener, {
initialize: function (cloverConnector) {
this.cloverConnector = cloverConnector;
},
onReady: function (merchantInfo) {
var saleRequest = new clover.remotepay.SaleRequest();
saleRequest.setExternalId(clover.CloverID.getNewId());
saleRequest.setAmount(10000);
this.cloverConnector.sale(saleRequest);
},
onVerifySignatureRequest: function (request) {
log.info(request);
this.cloverConnector.acceptSignature(request);
},
onSaleResponse: function (response) {
log.info(response);
connector.dispose();
if(!response.getIsSale()) {
console.error("Response is not an sale!");
console.error(response);
}
}
});
var connectorListener = new ExampleCloverConnectorListener(connector);
connector.addCloverConnectorListener(connectorListener);
connector.initializeConnection();
// Close the connection cleanly on exit. This should be done with all connectors.
$(window).on('beforeunload ', function () {
try {
connector.dispose();
} catch (e) {
console.log(e);
}
});
require("prototype");
var clover = require("remote-pay-cloud");
This will require gathering the configuration information to create the connector. In this example, the configuration is hard coded. The creation of the connector is done using the connector factory.
var connector = new clover.CloverConnectorFactory().createICloverConnector({
"merchantId": "BBFF8NBCXEMDT",
"clientId": "3RPTN642FHXTC",
"deviceSerialId": "C031UQ52340045",
"domain": "https://dev1.dev.clover.com/"
});
There are several ways the Clover Connector object can be configured.
Examples of configurations that can be used when creating the Clover Connector object:
{
"clientId" : "3BZPZ6A6FQ8ZM",
"domain" : "https://sandbox.dev.clover.com/",
"merchantId" : "VKYQ0RVGMYHRS",
"deviceSerialId" : "C021UQ52341078"
}
{
"oauthToken" : "6e6313e8-fe33-8662-7ff2-3a6690e0ff14",
"domain" : "https://sandbox.dev.clover.com/",
"merchantId" : "VKYQ0RVGMYHRS",
"clientId" : "3BZPZ6A6FQ8ZM",
"deviceSerialId" : "C021UQ52341078"
}
The functions implemented will be called as the connector encounters the events. These functions can be found in the clover.remotepay.ICloverConnectorListener.
var ExampleCloverConnectorListener = Class.create( clover.remotepay.ICloverConnectorListener, {
// This function overrides the basic prototype.js initialization function. This example
// expects that a coler connector implementation instance is passed to the created listener.
initialize: function (cloverConnector) {
this.cloverConnector = cloverConnector;
},
// The ICloverConnectorListener function that is called when the device is ready to be used.
// This example starts up a sale for $100
onReady: function (merchantInfo) {
var saleRequest = new clover.remotepay.SaleRequest();
saleRequest.setExternalId(clover.CloverID.getNewId());
saleRequest.setAmount(10000);
this.cloverConnector.sale(saleRequest);
},
// The ICloverConnectorListener function that is called when the device needs to have a signature
// accepted, or rejected.
// This example accepts the signature, sight unseen
onVerifySignatureRequest: function (request) {
log.info(request);
this.cloverConnector.acceptSignature(request);
},
// The ICloverConnectorListener function that is called when a sale request is completed.
// This example logs the response, and disposes of the connector. If the response is not an expected
// type, it will log an error.
onSaleResponse: function (response) {
log.info(response);
connector.dispose();
if(!response.getIsSale()) {
console.error("Response is not an sale!");
console.error(response);
}
}
}
var connectorListener = new ExampleCloverConnectorListener(connector);
connector.addCloverConnectorListener(connectorListener);
connector.initializeConnection();
This example uses jQuery to add a hook for the window beforeunload
event that ensures that the connector is displosed of.
$(window).on('beforeunload ', function () {
try {
connector.dispose();
} catch (e) {
console.log(e);
}
});
API documentation is generated when npm install
is run.
Online Docs
FAQs
Access Clover devices through the cloud.
The npm package remote-pay-cloud receives a total of 166 weekly downloads. As such, remote-pay-cloud popularity was classified as not popular.
We found that remote-pay-cloud demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.