lightrail-client
Advanced tools
Comparing version 1.6.1 to 1.7.0
import { CapturePendingTransactionParams, CreateAccountCardParams, CreateTransactionParams, SimulateTransactionParams, VoidPendingTransactionParams } from "./params"; | ||
import { Card, ContactIdentifier, Transaction } from "./model"; | ||
import { Card, CardDetails, ContactIdentifier, Transaction } from "./model"; | ||
/** | ||
@@ -8,2 +8,3 @@ * Creates a contact first if contact doesn't exist (if userSuppliedId or shopperId provided) | ||
export declare function createAccount(contact: ContactIdentifier, params: CreateAccountCardParams): Promise<Card>; | ||
export declare function getDetails(contact: ContactIdentifier, currency: string): Promise<CardDetails>; | ||
export declare function createTransaction(contact: ContactIdentifier, params: CreateTransactionParams): Promise<Transaction>; | ||
@@ -10,0 +11,0 @@ export declare function capturePendingTransaction(contact: ContactIdentifier, transaction: Transaction, params: CapturePendingTransactionParams): Promise<Transaction>; |
@@ -41,2 +41,16 @@ "use strict"; | ||
exports.createAccount = createAccount; | ||
function getDetails(contact, currency) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const contactId = yield getContactId(contact); | ||
if (!contactId) { | ||
return null; | ||
} | ||
const accountCard = yield cards.getAccountCardByContactAndCurrency(contactId, currency); | ||
if (!accountCard) { | ||
return null; | ||
} | ||
return cards.getDetails(accountCard); | ||
}); | ||
} | ||
exports.getDetails = getDetails; | ||
function createTransaction(contact, params) { | ||
@@ -43,0 +57,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "lightrail-client", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"description": "A Javascript and Typescript client for Lightrail", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
75466
1573
0