Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dotdashpay

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotdashpay - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

10

examples/ListenForInteraction.example.js

@@ -11,3 +11,2 @@ /**

useExistingData: false,
existingDataTtlSeconds: 5,
amount: 128,

@@ -19,2 +18,6 @@ currency: "USD",

dotdashpay.platform.listenForInteraction(args)
.onStartedListeningForInteraction(function(response) {
console.log("Received onStartedListeningForInteraction response", JSON.stringify(response, null, 2));
var peripheralId = response.peripheralId; // e.g. "IDTechKioskIII"
})
.onStartedInteraction(function(response) {

@@ -43,3 +46,3 @@ console.log("Received onStartedInteraction response", JSON.stringify(response, null, 2));

var testErrorCode = 9000;
dotdashpay.simulator.setResponse("StartedInteraction", {
dotdashpay.simulator.setResponse("StartedListeningForInteraction", {
message: testErrorMessage,

@@ -50,2 +53,5 @@ code: testErrorCode

dotdashpay.platform.listenForInteraction(args)
.onStartedListeningForInteraction(function(response) {
return done(new Error("This example should only have an on*Error callback event, not StartedListeningForInteraction"));
})
.onStartedInteraction(function(response) {

@@ -52,0 +58,0 @@ return done(new Error("This example should only have an on*Error callback event, not StartedInteraction"));

9

examples/ListenForInteractionThenPreAuthorize.example.js

@@ -18,2 +18,6 @@ /**

dotdashpay.payment.listenForInteractionThenPreAuthorize(args)
.onStartedListeningForInteraction(function(response) {
console.log("Received onStartedListeningForInteraction response", JSON.stringify(response, null, 2));
var peripheralId = response.peripheralId; // e.g. "IDTechKioskIII"
})
.onStartedInteraction(function(response) {

@@ -53,3 +57,3 @@ console.log("Received onStartedInteraction response", JSON.stringify(response, null, 2));

var testErrorCode = 9000;
dotdashpay.simulator.setResponse("StartedInteraction", {
dotdashpay.simulator.setResponse("StartedListeningForInteraction", {
message: testErrorMessage,

@@ -60,2 +64,5 @@ code: testErrorCode

dotdashpay.payment.listenForInteractionThenPreAuthorize(args)
.onStartedListeningForInteraction(function(response) {
return done(new Error("This example should only have an on*Error callback event, not StartedListeningForInteraction"));
})
.onStartedInteraction(function(response) {

@@ -62,0 +69,0 @@ return done(new Error("This example should only have an on*Error callback event, not StartedInteraction"));

@@ -18,2 +18,6 @@ /**

dotdashpay.payment.listenForInteractionThenSettle(args)
.onStartedListeningForInteraction(function(response) {
console.log("Received onStartedListeningForInteraction response", JSON.stringify(response, null, 2));
var peripheralId = response.peripheralId; // e.g. "IDTechKioskIII"
})
.onStartedInteraction(function(response) {

@@ -53,3 +57,3 @@ console.log("Received onStartedInteraction response", JSON.stringify(response, null, 2));

var testErrorCode = 9000;
dotdashpay.simulator.setResponse("StartedInteraction", {
dotdashpay.simulator.setResponse("StartedListeningForInteraction", {
message: testErrorMessage,

@@ -60,2 +64,5 @@ code: testErrorCode

dotdashpay.payment.listenForInteractionThenSettle(args)
.onStartedListeningForInteraction(function(response) {
return done(new Error("This example should only have an on*Error callback event, not StartedListeningForInteraction"));
})
.onStartedInteraction(function(response) {

@@ -62,0 +69,0 @@ return done(new Error("This example should only have an on*Error callback event, not StartedInteraction"));

@@ -209,3 +209,2 @@ /**

useExistingData: false,
existingDataTtlSeconds: 5,
amount: 128,

@@ -219,2 +218,6 @@ currency: "USD",

dotdashpay.platform.listenForInteraction(args)
.onStartedListeningForInteraction(function(response) {
console.log("Received onStartedListeningForInteraction response", JSON.stringify(response, null, 2));
var peripheralId = response.peripheralId; // e.g. "IDTechKioskIII"
})
.onStartedInteraction(function(response) {

@@ -244,3 +247,3 @@ console.log("Received onStartedInteraction response", JSON.stringify(response, null, 2));

var testErrorCode = 9000;
dotdashpay.simulator.setResponse("StartedInteraction", {
dotdashpay.simulator.setResponse("StartedListeningForInteraction", {
message: testErrorMessage,

@@ -251,2 +254,5 @@ code: testErrorCode

dotdashpay.platform.listenForInteraction(args)
.onStartedListeningForInteraction(function(response) {
return done(new Error("This example should only have an on*Error callback event, not StartedListeningForInteraction"));
})
.onStartedInteraction(function(response) {

@@ -454,2 +460,6 @@ return done(new Error("This example should only have an on*Error callback event, not StartedInteraction"));

dotdashpay.payment.listenForInteractionThenPreAuthorize(args)
.onStartedListeningForInteraction(function(response) {
console.log("Received onStartedListeningForInteraction response", JSON.stringify(response, null, 2));
var peripheralId = response.peripheralId; // e.g. "IDTechKioskIII"
})
.onStartedInteraction(function(response) {

@@ -490,3 +500,3 @@ console.log("Received onStartedInteraction response", JSON.stringify(response, null, 2));

var testErrorCode = 9000;
dotdashpay.simulator.setResponse("StartedInteraction", {
dotdashpay.simulator.setResponse("StartedListeningForInteraction", {
message: testErrorMessage,

@@ -497,2 +507,5 @@ code: testErrorCode

dotdashpay.payment.listenForInteractionThenPreAuthorize(args)
.onStartedListeningForInteraction(function(response) {
return done(new Error("This example should only have an on*Error callback event, not StartedListeningForInteraction"));
})
.onStartedInteraction(function(response) {

@@ -615,2 +628,6 @@ return done(new Error("This example should only have an on*Error callback event, not StartedInteraction"));

dotdashpay.payment.listenForInteractionThenSettle(args)
.onStartedListeningForInteraction(function(response) {
console.log("Received onStartedListeningForInteraction response", JSON.stringify(response, null, 2));
var peripheralId = response.peripheralId; // e.g. "IDTechKioskIII"
})
.onStartedInteraction(function(response) {

@@ -651,3 +668,3 @@ console.log("Received onStartedInteraction response", JSON.stringify(response, null, 2));

var testErrorCode = 9000;
dotdashpay.simulator.setResponse("StartedInteraction", {
dotdashpay.simulator.setResponse("StartedListeningForInteraction", {
message: testErrorMessage,

@@ -658,2 +675,5 @@ code: testErrorCode

dotdashpay.payment.listenForInteractionThenSettle(args)
.onStartedListeningForInteraction(function(response) {
return done(new Error("This example should only have an on*Error callback event, not StartedListeningForInteraction"));
})
.onStartedInteraction(function(response) {

@@ -660,0 +680,0 @@ return done(new Error("This example should only have an on*Error callback event, not StartedInteraction"));

@@ -147,2 +147,3 @@ // _ _ _

thisReq._signals = {};
thisReq._signals.StartedListeningForInteraction = new Signal();
thisReq._signals.StartedInteraction = new Signal();

@@ -181,2 +182,13 @@ thisReq._signals.GotInteraction = new Signal();

/**
StartedListeningForInteraction is a UPDATE event
**/
ListenForInteractionThenPreAuthorizeRequest.prototype.onStartedListeningForInteraction =
function onStartedListeningForInteraction(callbackFunction) {
var thisReq = this;
logger.info("Registering callback for listenForInteractionThenPreAuthorize");
thisReq._signals.StartedListeningForInteraction.add(callbackFunction);
return thisReq;
};
/**
StartedInteraction is a UPDATE event

@@ -255,2 +267,3 @@ **/

thisReq._signals = {};
thisReq._signals.StartedListeningForInteraction = new Signal();
thisReq._signals.StartedInteraction = new Signal();

@@ -289,2 +302,13 @@ thisReq._signals.GotInteraction = new Signal();

/**
StartedListeningForInteraction is a UPDATE event
**/
ListenForInteractionThenSettleRequest.prototype.onStartedListeningForInteraction =
function onStartedListeningForInteraction(callbackFunction) {
var thisReq = this;
logger.info("Registering callback for listenForInteractionThenSettle");
thisReq._signals.StartedListeningForInteraction.add(callbackFunction);
return thisReq;
};
/**
StartedInteraction is a UPDATE event

@@ -291,0 +315,0 @@ **/

@@ -178,2 +178,3 @@ // _ _ _

thisReq._signals = {};
thisReq._signals.StartedListeningForInteraction = new Signal();
thisReq._signals.StartedInteraction = new Signal();

@@ -209,2 +210,13 @@ thisReq._signals.GotInteraction = new Signal();

/**
StartedListeningForInteraction is a UPDATE event
**/
ListenForInteractionRequest.prototype.onStartedListeningForInteraction =
function onStartedListeningForInteraction(callbackFunction) {
var thisReq = this;
logger.info("Registering callback for listenForInteraction");
thisReq._signals.StartedListeningForInteraction.add(callbackFunction);
return thisReq;
};
/**
StartedInteraction is a UPDATE event

@@ -211,0 +223,0 @@ **/

{
"name": "dotdashpay",
"version": "1.1.1",
"version": "1.2.0",
"description": "DotDashPay Node SDK",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -15,3 +15,2 @@ /**

useExistingData: false,
existingDataTtlSeconds: 5,
amount: 128,

@@ -75,2 +74,8 @@ currency: "USD",

dotdashpay.platform.listenForInteraction(args)
.onStartedListeningForInteraction(function(response) {
callbacksVisited++;
console.log("Received onStartedListeningForInteraction response", JSON.stringify(response, null, 2));
var peripheralId = response.peripheralId; // e.g. "IDTechKioskIII"
assert.isDefined(peripheralId);
})
.onStartedInteraction(function(response) {

@@ -91,3 +96,3 @@ callbacksVisited++;

assert.isDefined(customerProfile);
assert.equal(callbacksVisited, 2, "Not all callbacks were called")
assert.equal(callbacksVisited, 3, "Not all callbacks were called")
return done();

@@ -109,3 +114,3 @@ })

var testErrorCode = 9000;
dotdashpay.simulator.setResponse("StartedInteraction", {
dotdashpay.simulator.setResponse("StartedListeningForInteraction", {
message: testErrorMessage,

@@ -116,2 +121,5 @@ code: testErrorCode

dotdashpay.platform.listenForInteraction(args)
.onStartedListeningForInteraction(function(response) {
return done(new Error("This example should only have an on*Error callback event, not StartedListeningForInteraction"));
})
.onStartedInteraction(function(response) {

@@ -118,0 +126,0 @@ return done(new Error("This example should only have an on*Error callback event, not StartedInteraction"));

@@ -74,2 +74,8 @@ /**

dotdashpay.payment.listenForInteractionThenPreAuthorize(args)
.onStartedListeningForInteraction(function(response) {
callbacksVisited++;
console.log("Received onStartedListeningForInteraction response", JSON.stringify(response, null, 2));
var peripheralId = response.peripheralId; // e.g. "IDTechKioskIII"
assert.isDefined(peripheralId);
})
.onStartedInteraction(function(response) {

@@ -102,3 +108,3 @@ callbacksVisited++;

assert.isDefined(transactionChainId);
assert.equal(callbacksVisited, 4, "Not all callbacks were called")
assert.equal(callbacksVisited, 5, "Not all callbacks were called")
return done();

@@ -124,3 +130,3 @@ })

var testErrorCode = 9000;
dotdashpay.simulator.setResponse("StartedInteraction", {
dotdashpay.simulator.setResponse("StartedListeningForInteraction", {
message: testErrorMessage,

@@ -131,2 +137,5 @@ code: testErrorCode

dotdashpay.payment.listenForInteractionThenPreAuthorize(args)
.onStartedListeningForInteraction(function(response) {
return done(new Error("This example should only have an on*Error callback event, not StartedListeningForInteraction"));
})
.onStartedInteraction(function(response) {

@@ -133,0 +142,0 @@ return done(new Error("This example should only have an on*Error callback event, not StartedInteraction"));

@@ -74,2 +74,8 @@ /**

dotdashpay.payment.listenForInteractionThenSettle(args)
.onStartedListeningForInteraction(function(response) {
callbacksVisited++;
console.log("Received onStartedListeningForInteraction response", JSON.stringify(response, null, 2));
var peripheralId = response.peripheralId; // e.g. "IDTechKioskIII"
assert.isDefined(peripheralId);
})
.onStartedInteraction(function(response) {

@@ -102,3 +108,3 @@ callbacksVisited++;

assert.isDefined(transactionChainId);
assert.equal(callbacksVisited, 4, "Not all callbacks were called")
assert.equal(callbacksVisited, 5, "Not all callbacks were called")
return done();

@@ -124,3 +130,3 @@ })

var testErrorCode = 9000;
dotdashpay.simulator.setResponse("StartedInteraction", {
dotdashpay.simulator.setResponse("StartedListeningForInteraction", {
message: testErrorMessage,

@@ -131,2 +137,5 @@ code: testErrorCode

dotdashpay.payment.listenForInteractionThenSettle(args)
.onStartedListeningForInteraction(function(response) {
return done(new Error("This example should only have an on*Error callback event, not StartedListeningForInteraction"));
})
.onStartedInteraction(function(response) {

@@ -133,0 +142,0 @@ return done(new Error("This example should only have an on*Error callback event, not StartedInteraction"));

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc