See also the Resource Collection response object.

Returns a collection of CreditCard objects that expire between the specified dates.

Using a callback:

Node.js
const before = new Date('2018-01-01');
const after = new Date('2018-12-31');

gateway.creditCard.expiringBetween(before, after, (err, expiredCards) => {
});

Using a stream:

Node.js
const stream = require("stream");

const writableStream = stream.Writable({objectMode: true});
writableStream._write = (chunk, enc, next) => {
  // ...
  next();
};

const before = new Date('2018-01-01');
const after = new Date('2018-12-31');

gateway.creditCard.expiringBetween(before, after);

writeableStream.on('data', () => {
});
Arguments
startDate required, String

The minimum expiration date of cards returned in the search (inclusive).

endDate required, String

The maximum expiration date of cards returned in the search (inclusive).