@figuredev/payments-sdk
Advanced tools
Comparing version 0.18.0 to 0.19.0
import { UserContext } from "./utils"; | ||
import { PaymentAuthTokenDTO, PaymentGatewayDTO, PaymentInitializedResponseDTO, PaymentInputDTO, PaymentRequestDTO, PaymentResponseDTO } from "./types"; | ||
import { PaymentAuthTokenDTO, PaymentGatewayDTO, PaymentGetResponseDTO, PaymentInitializedResponseDTO, PaymentInputDTO, PaymentRequestDTO, PaymentRequestSaveDTO } from "./types"; | ||
declare type PaymentsClientConfig = { | ||
@@ -18,5 +18,6 @@ baseUrl: string; | ||
cancel(ctx: UserContext, id: string): Promise<void>; | ||
getPaymentInfo(ctx: UserContext, id: string): Promise<PaymentResponseDTO>; | ||
save(ctx: UserContext, id: string, data: PaymentRequestSaveDTO): Promise<void>; | ||
getPaymentInfo(ctx: UserContext, id: string): Promise<PaymentGetResponseDTO>; | ||
getAuthenticationToken(ctx: UserContext, gateway: PaymentGatewayDTO, amount?: number): Promise<PaymentAuthTokenDTO>; | ||
} | ||
export {}; |
@@ -142,2 +142,15 @@ "use strict"; | ||
} | ||
save(ctx, id, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield axios_1.default | ||
.request({ | ||
baseURL: this.config.baseUrl, | ||
method: "POST", | ||
url: `/payment/${id}/save`, | ||
headers: (0, utils_1.constructHeaders)(this.config.secret, ctx), | ||
data: data, | ||
}) | ||
.then((r) => r.data); | ||
}); | ||
} | ||
getPaymentInfo(ctx, id) { | ||
@@ -144,0 +157,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -20,3 +20,3 @@ import { Maybe } from "fgr-lib-backend/lib/types"; | ||
} | ||
export declare enum PaymentEntryModeDTO { | ||
export declare enum PaymentRequestEntryModeDTO { | ||
Card = "card", | ||
@@ -47,3 +47,3 @@ Manual = "manual" | ||
amount: Maybe<number>; | ||
entryMode?: PaymentEntryModeDTO; | ||
entryMode?: PaymentRequestEntryModeDTO; | ||
referenceId?: string; | ||
@@ -53,2 +53,33 @@ orderId?: string; | ||
}; | ||
export declare enum PaymentDeclineCode { | ||
InsufficientFunds = "InsufficientFunds", | ||
CardExpired = "CardExpired", | ||
CardRestricted = "CardRestricted", | ||
CardStolen = "CardStolen", | ||
CardLost = "CardLost", | ||
UnsupportedIssuer = "UnsupportedIssuer", | ||
InvalidPIN = "InvalidPIN", | ||
InvalidCVV = "InvalidCVV", | ||
InvalidExpirationDate = "InvalidExpirationDate", | ||
InvalidCardNumber = "InvalidCardNumber", | ||
InvalidTrackData = "InvalidTrackData", | ||
TransactionAlreadySettled = "TransactionAlreadySettled", | ||
BatchAlreadyClosed = "BatchAlreadyClosed", | ||
OtherReason = "OtherReason", | ||
OtherReasonPossibleFraud = "OtherReasonPossibleFraud" | ||
} | ||
export declare type PaymentRequestSaveDTO = { | ||
gateway: PaymentGatewayDTO; | ||
command: PaymentCommandDTO; | ||
referenceId?: string; | ||
status: PaymentStatusDTO; | ||
amountAuthorized?: number; | ||
gatewayRefId?: string; | ||
authCode?: string; | ||
card?: Maybe<PaymentSaveCardDataDTO>; | ||
declineCode?: Maybe<PaymentDeclineCode>; | ||
declineMessage?: Maybe<string>; | ||
eCommerce?: boolean; | ||
currency?: string; | ||
}; | ||
export declare type PaymentAuthTokenDTO = { | ||
@@ -60,7 +91,7 @@ token: string; | ||
}; | ||
export declare type PaymentResponseDTO = { | ||
export declare type PaymentGetResponseDTO = { | ||
referencePaymentId: Maybe<string>; | ||
gateway: PaymentResponseGatewayDTO; | ||
command: PaymentResponseCommandDTO; | ||
status: PaymentStatusDTO; | ||
status: PaymentResponseStatusDTO; | ||
amountAuthorized?: number; | ||
@@ -73,2 +104,17 @@ gatewayRefId?: string; | ||
}; | ||
export declare enum PaymentResponseStatusDTO { | ||
InProgress = "InProgress", | ||
Approved = "Approved", | ||
Declined = "Declined", | ||
Error = "Error", | ||
Voided = "Voided" | ||
} | ||
export declare enum PaymentResponseGatewayDTO { | ||
CardPointe = "CardPointe", | ||
Bolt = "Bolt", | ||
Converge = "Converge", | ||
USAePay = "USAePay", | ||
Dejavoo = "Dejavoo", | ||
TSYS = "TSYS" | ||
} | ||
export declare type PaymentResponseCardDataDTO = { | ||
@@ -83,12 +129,4 @@ number?: Maybe<string>; | ||
name?: Maybe<string>; | ||
entryMethod?: Maybe<PaymentResponseEntryMethodDTO>; | ||
entryMethod?: Maybe<PaymentEntryMethodDTO>; | ||
}; | ||
export declare enum PaymentResponseGatewayDTO { | ||
CardPointe = "CardPointe", | ||
Bolt = "Bolt", | ||
Converge = "Converge", | ||
USAePay = "USAePay", | ||
Dejavoo = "Dejavoo", | ||
TSYS = "TSYS" | ||
} | ||
export declare enum PaymentResponseCommandDTO { | ||
@@ -104,2 +142,9 @@ Sale = "Sale", | ||
} | ||
export declare enum PaymentEntryMethodDTO { | ||
Swiped = "swiped", | ||
KeyedIn = "keyed-in", | ||
Saved = "saved", | ||
Chip = "chip", | ||
Contactless = "contactless" | ||
} | ||
export declare enum PaymentCardIssuerDTO { | ||
@@ -115,8 +160,12 @@ MasterCard = "MasterCard", | ||
} | ||
export declare enum PaymentResponseEntryMethodDTO { | ||
Swiped = "swiped", | ||
KeyedIn = "keyed-in", | ||
Saved = "saved", | ||
Chip = "chip", | ||
Contactless = "contactless" | ||
} | ||
export declare type PaymentSaveCardDataDTO = { | ||
number?: Maybe<string>; | ||
issuer?: Maybe<PaymentCardIssuerDTO>; | ||
last4?: Maybe<string>; | ||
token?: Maybe<string>; | ||
expiration?: Maybe<string>; | ||
zip?: Maybe<string>; | ||
cvv2?: Maybe<string>; | ||
name?: Maybe<string>; | ||
entryMethod?: Maybe<PaymentEntryMethodDTO>; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PaymentResponseEntryMethodDTO = exports.PaymentCardIssuerDTO = exports.PaymentResponseCommandDTO = exports.PaymentResponseGatewayDTO = exports.PaymentStatusDTO = exports.PaymentCommandDTO = exports.PaymentEntryModeDTO = exports.PaymentGatewayDTO = void 0; | ||
exports.PaymentCardIssuerDTO = exports.PaymentEntryMethodDTO = exports.PaymentResponseCommandDTO = exports.PaymentResponseGatewayDTO = exports.PaymentResponseStatusDTO = exports.PaymentDeclineCode = exports.PaymentStatusDTO = exports.PaymentCommandDTO = exports.PaymentRequestEntryModeDTO = exports.PaymentGatewayDTO = void 0; | ||
var PaymentGatewayDTO; | ||
@@ -13,7 +13,7 @@ (function (PaymentGatewayDTO) { | ||
})(PaymentGatewayDTO = exports.PaymentGatewayDTO || (exports.PaymentGatewayDTO = {})); | ||
var PaymentEntryModeDTO; | ||
(function (PaymentEntryModeDTO) { | ||
PaymentEntryModeDTO["Card"] = "card"; | ||
PaymentEntryModeDTO["Manual"] = "manual"; | ||
})(PaymentEntryModeDTO = exports.PaymentEntryModeDTO || (exports.PaymentEntryModeDTO = {})); | ||
var PaymentRequestEntryModeDTO; | ||
(function (PaymentRequestEntryModeDTO) { | ||
PaymentRequestEntryModeDTO["Card"] = "card"; | ||
PaymentRequestEntryModeDTO["Manual"] = "manual"; | ||
})(PaymentRequestEntryModeDTO = exports.PaymentRequestEntryModeDTO || (exports.PaymentRequestEntryModeDTO = {})); | ||
var PaymentCommandDTO; | ||
@@ -38,2 +38,28 @@ (function (PaymentCommandDTO) { | ||
})(PaymentStatusDTO = exports.PaymentStatusDTO || (exports.PaymentStatusDTO = {})); | ||
var PaymentDeclineCode; | ||
(function (PaymentDeclineCode) { | ||
PaymentDeclineCode["InsufficientFunds"] = "InsufficientFunds"; | ||
PaymentDeclineCode["CardExpired"] = "CardExpired"; | ||
PaymentDeclineCode["CardRestricted"] = "CardRestricted"; | ||
PaymentDeclineCode["CardStolen"] = "CardStolen"; | ||
PaymentDeclineCode["CardLost"] = "CardLost"; | ||
PaymentDeclineCode["UnsupportedIssuer"] = "UnsupportedIssuer"; | ||
PaymentDeclineCode["InvalidPIN"] = "InvalidPIN"; | ||
PaymentDeclineCode["InvalidCVV"] = "InvalidCVV"; | ||
PaymentDeclineCode["InvalidExpirationDate"] = "InvalidExpirationDate"; | ||
PaymentDeclineCode["InvalidCardNumber"] = "InvalidCardNumber"; | ||
PaymentDeclineCode["InvalidTrackData"] = "InvalidTrackData"; | ||
PaymentDeclineCode["TransactionAlreadySettled"] = "TransactionAlreadySettled"; | ||
PaymentDeclineCode["BatchAlreadyClosed"] = "BatchAlreadyClosed"; | ||
PaymentDeclineCode["OtherReason"] = "OtherReason"; | ||
PaymentDeclineCode["OtherReasonPossibleFraud"] = "OtherReasonPossibleFraud"; | ||
})(PaymentDeclineCode = exports.PaymentDeclineCode || (exports.PaymentDeclineCode = {})); | ||
var PaymentResponseStatusDTO; | ||
(function (PaymentResponseStatusDTO) { | ||
PaymentResponseStatusDTO["InProgress"] = "InProgress"; | ||
PaymentResponseStatusDTO["Approved"] = "Approved"; | ||
PaymentResponseStatusDTO["Declined"] = "Declined"; | ||
PaymentResponseStatusDTO["Error"] = "Error"; | ||
PaymentResponseStatusDTO["Voided"] = "Voided"; | ||
})(PaymentResponseStatusDTO = exports.PaymentResponseStatusDTO || (exports.PaymentResponseStatusDTO = {})); | ||
var PaymentResponseGatewayDTO; | ||
@@ -59,2 +85,10 @@ (function (PaymentResponseGatewayDTO) { | ||
})(PaymentResponseCommandDTO = exports.PaymentResponseCommandDTO || (exports.PaymentResponseCommandDTO = {})); | ||
var PaymentEntryMethodDTO; | ||
(function (PaymentEntryMethodDTO) { | ||
PaymentEntryMethodDTO["Swiped"] = "swiped"; | ||
PaymentEntryMethodDTO["KeyedIn"] = "keyed-in"; | ||
PaymentEntryMethodDTO["Saved"] = "saved"; | ||
PaymentEntryMethodDTO["Chip"] = "chip"; | ||
PaymentEntryMethodDTO["Contactless"] = "contactless"; | ||
})(PaymentEntryMethodDTO = exports.PaymentEntryMethodDTO || (exports.PaymentEntryMethodDTO = {})); | ||
var PaymentCardIssuerDTO; | ||
@@ -71,10 +105,2 @@ (function (PaymentCardIssuerDTO) { | ||
})(PaymentCardIssuerDTO = exports.PaymentCardIssuerDTO || (exports.PaymentCardIssuerDTO = {})); | ||
var PaymentResponseEntryMethodDTO; | ||
(function (PaymentResponseEntryMethodDTO) { | ||
PaymentResponseEntryMethodDTO["Swiped"] = "swiped"; | ||
PaymentResponseEntryMethodDTO["KeyedIn"] = "keyed-in"; | ||
PaymentResponseEntryMethodDTO["Saved"] = "saved"; | ||
PaymentResponseEntryMethodDTO["Chip"] = "chip"; | ||
PaymentResponseEntryMethodDTO["Contactless"] = "contactless"; | ||
})(PaymentResponseEntryMethodDTO = exports.PaymentResponseEntryMethodDTO || (exports.PaymentResponseEntryMethodDTO = {})); | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@figuredev/payments-sdk", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27565
485