gap-nodejs-sdk 1.0.189 → 1.0.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -186,12 +186,12 @@ export default class CloverPaymentObject {
|
|
|
186
186
|
this.retrievePaymentResponse = null;
|
|
187
187
|
this.paymentResponse = null;
|
|
188
188
|
this.retrievePaymentCallback = callback;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
console.log({ message: "Sending retrieve", request:
|
|
192
|
-
console.log(`Payment: ${
|
|
189
|
+
let retrievePaymentClover = new clover.remotepay.RetrievePaymentRequest();
|
|
190
|
+
retrievePaymentClover.setExternalPaymentId(retrieveInput.refId.toString());
|
|
191
|
+
console.log({ message: "Sending retrieve", request: retrievePaymentClover });
|
|
192
|
+
console.log(`Payment: ${retrievePaymentClover.getExternalPaymentId()} is in progress.`);
|
|
193
193
|
// Send the retrieve to the device.
|
|
194
|
-
(_a = this.cloverConnector) === null || _a === void 0 ? void 0 : _a.retrievePayment(
|
|
194
|
+
(_a = this.cloverConnector) === null || _a === void 0 ? void 0 : _a.retrievePayment(retrievePaymentClover);
|
|
195
195
|
}
|
|
196
196
|
doRetrievePendingPayment() {
|
|
197
197
|
var _a;
|
|
@@ -418,6 +418,7 @@ export default class CloverPaymentObject {
|
|
|
418
418
|
// The payment's status can be used to resolve the payment in your POS.
|
|
419
419
|
const payment = retrievePaymentResponse.getPayment();
|
|
420
420
|
this.retrievePaymentCallback = this.handleSuccessCallback(payment, this.retrievePaymentCallback);
|
|
421
|
+
this.pendingSaleRequest = null;
|
|
421
422
|
// console.log(`${payment.getResult()}: Payment ${this.pendingSaleRequest.getExternalId()} is complete.`, payment.getResult() === clover.payments.Result.SUCCESS);
|
|
422
423
|
}
|
|
423
424
|
else if (retrievePaymentResponse.getQueryStatus() === clover.remotepay.QueryStatus.IN_PROGRESS) {
|
|
@@ -429,7 +430,6 @@ export default class CloverPaymentObject {
|
|
|
429
430
|
else if (retrievePaymentResponse.getQueryStatus() === clover.remotepay.QueryStatus.NOT_FOUND) {
|
|
430
431
|
let message = `Payment wasn't taken or was voided.`;
|
|
431
432
|
this.retrievePaymentCallback = this.handleErrorCallback(message, this.retrievePaymentCallback);
|
|
432
|
-
this.pendingSaleRequest = null;
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
else {
|
|
@@ -538,7 +538,7 @@ export default class CloverPaymentObject {
|
|
|
538
538
|
retrieveDeviceStatusRequest.setSendLastMessage(true);
|
|
539
539
|
(_a = this.cloverConnector) === null || _a === void 0 ? void 0 : _a.retrieveDeviceStatus(retrieveDeviceStatusRequest);
|
|
540
540
|
// Retrieve the payment status.
|
|
541
|
-
console.log(`Payment is currently pending.
|
|
541
|
+
console.log(`Payment is currently pending. Checking payment status ...`);
|
|
542
542
|
console.log(this.pendingSaleRequest);
|
|
543
543
|
const retrievePaymentRequest = new clover.remotepay.RetrievePaymentRequest();
|
|
544
544
|
retrievePaymentRequest.setExternalPaymentId(this.pendingSaleRequest.getExternalId());
|