@smartpay/sdk-node
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -1,2 +0,2 @@ | ||
import type { CustomerInfo, CustomerInfoLoose, SimpleLineItem, SimpleChekoutSessionPayload, ShippingInfo, Address, LooseObject } from './types'; | ||
import type { CustomerInfo, CustomerInfoLoose, ProductData, PriceData, LineItemDataFlat, OrderDataLoose, ChekoutSessionPayloadFlat, ShippingInfo, Address, LooseObject } from './types'; | ||
export declare const omit: (obj: LooseObject, omitKeys: string[]) => { | ||
@@ -6,7 +6,7 @@ [x: string]: any; | ||
export declare const normalizeCustomerInfo: (customer?: CustomerInfoLoose) => CustomerInfo; | ||
export declare const normalizeItem: (item: SimpleLineItem) => { | ||
quantity: number; | ||
name: string; | ||
export declare const normalizeProductData: (product?: Partial<ProductData>) => { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
@@ -16,38 +16,65 @@ images: string[] | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
export declare const normalizePriceData: (price?: Partial<PriceData>) => { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
export declare const normalizeLineItemData: (item: LineItemDataFlat) => { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}; | ||
export declare const normalizeItems: (list?: SimpleLineItem[]) => { | ||
export declare const normalizeLineItemDataList: (list?: LineItemDataFlat[]) => { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
name: string; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}[]; | ||
export declare const normalizeShippingInfo: (shipping?: Partial<ShippingInfo> & Partial<Address>) => { | ||
address: Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
export declare const normalizeCheckoutSessionPayload: (payload: SimpleChekoutSessionPayload) => { | ||
export declare const normalizeOrderData: (order: OrderDataLoose) => { | ||
amount: number | undefined; | ||
@@ -57,36 +84,39 @@ currency: string | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
items: { | ||
coupons: string[] | undefined; | ||
shippingInfo: ShippingInfo | undefined; | ||
lineItemData: { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
name: string; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}[]; | ||
customerInfo: CustomerInfo; | ||
shippingInfo: { | ||
address: Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
reference: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
successUrl: string | undefined; | ||
cancelUrl: string | undefined; | ||
}; | ||
declare const _default: { | ||
normalizeCheckoutSessionPayload: (payload: SimpleChekoutSessionPayload) => { | ||
export declare const normalizeShipping: (shipping?: Partial<ShippingInfo> & Partial<Address>) => { | ||
address: Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
export declare const normalizeCheckoutSessionPayload: (payload: ChekoutSessionPayloadFlat) => { | ||
customerInfo: CustomerInfo; | ||
orderData: { | ||
amount: number | undefined; | ||
@@ -96,35 +126,73 @@ currency: string | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
items: { | ||
coupons: string[] | undefined; | ||
shippingInfo: ShippingInfo | undefined; | ||
lineItemData: { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
name: string; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}[]; | ||
customerInfo: CustomerInfo; | ||
shippingInfo: { | ||
address: Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
reference: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
successUrl: string | undefined; | ||
cancelUrl: string | undefined; | ||
}; | ||
successUrl: string; | ||
cancelUrl: string; | ||
}; | ||
declare const _default: { | ||
normalizeCheckoutSessionPayload: (payload: ChekoutSessionPayloadFlat) => { | ||
customerInfo: CustomerInfo; | ||
orderData: { | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
captureMethod: "automatic" | "manual" | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
coupons: string[] | undefined; | ||
shippingInfo: ShippingInfo | undefined; | ||
lineItemData: { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}[]; | ||
reference: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
successUrl: string; | ||
cancelUrl: string; | ||
}; | ||
}; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
import { KeyString, SmartPayOptions, CheckoutSession, SimpleChekoutSessionPayload } from './types'; | ||
import { KeyString, SmartPayOptions, ChekoutSessionPayload, CheckoutSession, ChekoutSessionPayloadFlat } from './types'; | ||
interface Params { | ||
@@ -25,4 +25,4 @@ [key: string]: string; | ||
}): Promise<any>; | ||
static normalizeCheckoutSessionPayload(payload: SimpleChekoutSessionPayload): SimpleChekoutSessionPayload; | ||
createCheckoutSession(payload: SimpleChekoutSessionPayload): Promise<CheckoutSession>; | ||
static normalizeCheckoutSessionPayload(payload: ChekoutSessionPayloadFlat): ChekoutSessionPayload; | ||
createCheckoutSession(payload: ChekoutSessionPayloadFlat): Promise<CheckoutSession>; | ||
setPublicKey(publicKey: KeyString): {}; | ||
@@ -29,0 +29,0 @@ getSessionURL(session: CheckoutSession, options?: GetSessionURLOptions): string; |
@@ -82,5 +82,7 @@ export interface LooseObject { | ||
}; | ||
export declare type SimpleLineItem = { | ||
export declare type LineItemDataFlat = { | ||
price?: string; | ||
priceData?: PriceData; | ||
quantity: number; | ||
name: string; | ||
name?: string; | ||
brand?: string; | ||
@@ -92,4 +94,5 @@ categories?: string[]; | ||
url?: string; | ||
amount: number; | ||
currency: string; | ||
amount?: number; | ||
priceAmount?: number; | ||
currency?: string; | ||
label?: string; | ||
@@ -123,2 +126,15 @@ description?: string; | ||
}; | ||
export declare type OrderDataLoose = { | ||
amount?: number; | ||
currency?: string; | ||
captureMethod?: 'automatic' | 'manual'; | ||
confirmationMethod?: 'automatic' | 'manual'; | ||
coupons?: string[]; | ||
lineItemData?: LineItemData[]; | ||
items?: LineItemDataFlat[]; | ||
shippingInfo?: ShippingInfo; | ||
reference?: string; | ||
description?: string; | ||
metadata?: MetaData; | ||
}; | ||
export declare type ChekoutSessionPayload = { | ||
@@ -131,3 +147,3 @@ customerInfo: CustomerInfo; | ||
}; | ||
export declare type SimpleChekoutSessionPayload = { | ||
export declare type ChekoutSessionPayloadFlat = { | ||
amount?: number; | ||
@@ -137,11 +153,21 @@ currency?: string; | ||
confirmationMethod?: 'automatic' | 'manual'; | ||
items: SimpleLineItem[]; | ||
coupons?: string[]; | ||
lineItemData?: LineItemData[]; | ||
shippingInfo?: ShippingInfo; | ||
items?: LineItemDataFlat[]; | ||
shipping?: Partial<ShippingInfo> & Partial<Address>; | ||
customerInfo?: CustomerInfo; | ||
description?: string; | ||
metadata?: MetaData; | ||
customer?: CustomerInfoLoose; | ||
orderData?: OrderData; | ||
reference?: string; | ||
successURL?: string; | ||
cancelURL?: string; | ||
successUrl?: string; | ||
cancelUrl?: string; | ||
description?: string; | ||
metadata?: MetaData; | ||
orderDescription?: string; | ||
orderMetadata?: MetaData; | ||
promotionCode?: string; | ||
test?: boolean; | ||
}; | ||
@@ -148,0 +174,0 @@ export declare type RefundPayload = { |
@@ -1,2 +0,2 @@ | ||
import type { KeyString, SimpleChekoutSessionPayload, ErrorDetails } from './types'; | ||
import type { KeyString, ChekoutSessionPayload, ChekoutSessionPayloadFlat, ErrorDetails } from './types'; | ||
export declare class SmartError extends Error { | ||
@@ -18,43 +18,44 @@ statusCode?: number; | ||
export declare const isValidPaymentID: (paymentID: string) => boolean; | ||
export declare const validateCheckoutSessionPayload: (payload: SimpleChekoutSessionPayload) => ErrorDetails; | ||
export declare const validateCheckoutSessionPayload: (payload: ChekoutSessionPayload) => ErrorDetails; | ||
/** | ||
* Try to get the currency of this checkout | ||
*/ | ||
export declare const getCurrency: (payload: SimpleChekoutSessionPayload) => string; | ||
export declare const normalizeCheckoutSessionPayload: (input: SimpleChekoutSessionPayload) => { | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
captureMethod: "automatic" | "manual" | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
items: { | ||
quantity: number; | ||
name: string; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
export declare const getCurrency: (payload: ChekoutSessionPayload) => string | undefined; | ||
export declare const normalizeCheckoutSessionPayload: (input: ChekoutSessionPayloadFlat) => { | ||
customerInfo: import("./types").CustomerInfo; | ||
orderData: { | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
captureMethod: "automatic" | "manual" | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
coupons: string[] | undefined; | ||
shippingInfo: import("./types").ShippingInfo | undefined; | ||
lineItemData: { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}[]; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}[]; | ||
customerInfo: import("./types").CustomerInfo; | ||
shippingInfo: { | ||
address: import("./types").Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
reference: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
successUrl: string | undefined; | ||
cancelUrl: string | undefined; | ||
successUrl: string; | ||
cancelUrl: string; | ||
}; | ||
@@ -61,0 +62,0 @@ export declare const DEFAULT_ERROR_MESSAGES: { |
@@ -41,2 +41,3 @@ var __defProp = Object.defineProperty; | ||
emailAddress, | ||
email, | ||
firstName, | ||
@@ -48,4 +49,6 @@ lastName, | ||
phoneNumber, | ||
phone, | ||
dateOfBirth, | ||
legalGender, | ||
gender, | ||
reference | ||
@@ -56,2 +59,3 @@ } = customer; | ||
"emailAddress", | ||
"email", | ||
"firstName", | ||
@@ -63,4 +67,6 @@ "lastName", | ||
"phoneNumber", | ||
"phone", | ||
"dateOfBirth", | ||
"legalGender", | ||
"gender", | ||
"reference" | ||
@@ -70,3 +76,3 @@ ]); | ||
accountAge, | ||
emailAddress, | ||
emailAddress: emailAddress || email, | ||
firstName, | ||
@@ -77,10 +83,57 @@ lastName, | ||
address, | ||
phoneNumber, | ||
phoneNumber: phoneNumber || phone, | ||
dateOfBirth, | ||
legalGender, | ||
legalGender: legalGender || gender, | ||
reference | ||
}); | ||
}; | ||
var normalizeItem = (item) => { | ||
var normalizeProductData = (product = {}) => { | ||
const { | ||
name, | ||
brand, | ||
categories, | ||
description, | ||
gtin, | ||
images, | ||
reference, | ||
url, | ||
metadata | ||
} = product; | ||
const rest = omit(product, [ | ||
"name", | ||
"brand", | ||
"categories", | ||
"description", | ||
"gtin", | ||
"images", | ||
"reference", | ||
"url", | ||
"metadata" | ||
]); | ||
return __spreadProps(__spreadValues({}, rest), { | ||
name, | ||
brand, | ||
categories, | ||
description, | ||
gtin, | ||
images, | ||
reference, | ||
url, | ||
metadata | ||
}); | ||
}; | ||
var normalizePriceData = (price = {}) => { | ||
const { productData, amount, currency, metadata } = price; | ||
const rest = omit(price, ["productData", "amount", "currency", "metadata"]); | ||
return __spreadProps(__spreadValues({}, rest), { | ||
productData: normalizeProductData(productData), | ||
amount, | ||
currency, | ||
metadata | ||
}); | ||
}; | ||
var normalizeLineItemData = (item) => { | ||
const { | ||
price, | ||
priceData, | ||
quantity, | ||
@@ -105,2 +158,4 @@ name, | ||
const rest = omit(item, [ | ||
"price", | ||
"priceData", | ||
"quantity", | ||
@@ -125,23 +180,68 @@ "name", | ||
return __spreadProps(__spreadValues({}, rest), { | ||
price: typeof price === "string" ? price : void 0, | ||
priceData: normalizePriceData(priceData || { | ||
productData: { | ||
name, | ||
brand, | ||
categories, | ||
gtin, | ||
images, | ||
reference, | ||
url, | ||
description: productDescription, | ||
metadata: productMetadata | ||
}, | ||
amount: amount != null ? amount : typeof price === "number" ? price : void 0, | ||
currency, | ||
label, | ||
description: priceDescription, | ||
metadata: priceMetadata | ||
}), | ||
quantity, | ||
name, | ||
brand, | ||
categories, | ||
gtin, | ||
images, | ||
description, | ||
metadata | ||
}); | ||
}; | ||
var normalizeLineItemDataList = (list = []) => Array.isArray(list) ? list.map((item) => normalizeLineItemData(item)) : []; | ||
var normalizeOrderData = (order) => { | ||
const { | ||
amount, | ||
currency, | ||
captureMethod, | ||
confirmationMethod, | ||
coupons, | ||
shippingInfo, | ||
items, | ||
lineItemData, | ||
reference, | ||
url, | ||
description, | ||
metadata | ||
} = order; | ||
const rest = omit(order, [ | ||
"amount", | ||
"currency", | ||
"captureMethod", | ||
"confirmationMethod", | ||
"coupons", | ||
"shippingInfo", | ||
"items", | ||
"lineItemData", | ||
"reference", | ||
"description", | ||
"metadata" | ||
]); | ||
return __spreadProps(__spreadValues({}, rest), { | ||
amount, | ||
currency, | ||
label, | ||
captureMethod, | ||
confirmationMethod, | ||
coupons, | ||
shippingInfo, | ||
lineItemData: normalizeLineItemDataList(lineItemData || items), | ||
reference, | ||
description, | ||
metadata, | ||
productDescription, | ||
productMetadata, | ||
priceDescription, | ||
priceMetadata | ||
metadata | ||
}); | ||
}; | ||
var normalizeItems = (list = []) => Array.isArray(list) ? list.map((item) => normalizeItem(item)) : []; | ||
var normalizeShippingInfo = (shipping = {}) => { | ||
var normalizeShipping = (shipping = {}) => { | ||
const { | ||
@@ -203,5 +303,10 @@ address, | ||
confirmationMethod, | ||
coupons, | ||
lineItemData, | ||
shippingInfo, | ||
items, | ||
shipping, | ||
customerInfo, | ||
shippingInfo, | ||
customer, | ||
orderData, | ||
reference, | ||
@@ -211,3 +316,5 @@ description, | ||
successUrl, | ||
cancelUrl | ||
cancelUrl, | ||
successURL, | ||
cancelURL | ||
} = payload; | ||
@@ -220,2 +327,3 @@ const rest = omit(payload, [ | ||
"coupons", | ||
"lineItemData", | ||
"shippingInfo", | ||
@@ -226,5 +334,7 @@ "items", | ||
"customer", | ||
"orderData", | ||
"reference", | ||
"metadata", | ||
"description", | ||
"promotionCode", | ||
"successUrl", | ||
@@ -234,19 +344,23 @@ "cancelUrl" | ||
return __spreadProps(__spreadValues({}, rest), { | ||
amount, | ||
currency, | ||
captureMethod, | ||
confirmationMethod, | ||
items: normalizeItems(items), | ||
customerInfo: normalizeCustomerInfo(customerInfo), | ||
shippingInfo: normalizeShippingInfo(shippingInfo), | ||
reference, | ||
description, | ||
metadata, | ||
successUrl, | ||
cancelUrl | ||
customerInfo: normalizeCustomerInfo(customerInfo || customer), | ||
orderData: normalizeOrderData(orderData || { | ||
amount, | ||
currency, | ||
captureMethod, | ||
confirmationMethod, | ||
coupons, | ||
shippingInfo: shippingInfo || normalizeShipping(shipping), | ||
items, | ||
lineItemData, | ||
reference, | ||
description, | ||
metadata | ||
}), | ||
successUrl: successUrl || successURL || "", | ||
cancelUrl: cancelUrl || cancelURL || "" | ||
}); | ||
}; | ||
// src/schemas/simple-checkout-session-payload.jtd.ts | ||
var simple_checkout_session_payload_jtd_default = { | ||
// src/schemas/checkout-session-payload.jtd.ts | ||
var checkout_session_payload_jtd_default = { | ||
definitions: { | ||
@@ -271,22 +385,20 @@ address: { | ||
}, | ||
customer: { | ||
product: { | ||
properties: { | ||
name: { type: "string" } | ||
}, | ||
optionalProperties: { | ||
accountAge: { type: "uint32" }, | ||
emailAddress: { type: "string" }, | ||
firstName: { type: "string" }, | ||
lastName: { type: "string" }, | ||
phoneNumber: { type: "string" }, | ||
firstNameKana: { type: "string" }, | ||
lastNameKana: { type: "string" }, | ||
address: { ref: "address" }, | ||
dateOfBirth: { type: "string" }, | ||
legalGender: { type: "string" }, | ||
reference: { type: "string" } | ||
brand: { type: "string" }, | ||
categories: { elements: { type: "string" } }, | ||
description: { type: "string" }, | ||
gtin: { type: "string" }, | ||
images: { elements: { type: "string" } }, | ||
reference: { type: "string" }, | ||
url: { type: "string" } | ||
}, | ||
additionalProperties: true | ||
}, | ||
lineItem: { | ||
price: { | ||
properties: { | ||
name: { type: "string" }, | ||
quantity: { type: "uint16" }, | ||
productData: { ref: "product" }, | ||
amount: { type: "uint32" }, | ||
@@ -297,7 +409,22 @@ currency: { type: "string" } | ||
description: { type: "string" }, | ||
label: { type: "string" } | ||
}, | ||
additionalProperties: true | ||
}, | ||
lineItem: { | ||
properties: { | ||
quantity: { type: "uint16" } | ||
}, | ||
optionalProperties: { | ||
priceData: { ref: "price" }, | ||
amount: { type: "uint32" }, | ||
currency: { type: "string" }, | ||
description: { type: "string" }, | ||
image: { type: "string" }, | ||
priceDescription: { type: "string" }, | ||
productDescription: { type: "string" }, | ||
label: { type: "string" }, | ||
name: { type: "string" }, | ||
brand: { type: "string" }, | ||
categories: { elements: { type: "string" } }, | ||
productDescription: { type: "string" }, | ||
gtin: { type: "string" }, | ||
@@ -309,28 +436,60 @@ images: { elements: { type: "string" } }, | ||
additionalProperties: true | ||
} | ||
}, | ||
properties: { | ||
amount: { type: "uint32" }, | ||
currency: { type: "string" }, | ||
items: { elements: { ref: "lineItem" } }, | ||
customerInfo: { ref: "customer" }, | ||
shippingInfo: { | ||
}, | ||
order: { | ||
properties: { | ||
address: { ref: "address" } | ||
amount: { type: "uint32" }, | ||
currency: { type: "string" }, | ||
lineItemData: { elements: { ref: "lineItem" } }, | ||
shippingInfo: { | ||
properties: { | ||
address: { ref: "address" } | ||
}, | ||
optionalProperties: { | ||
addressType: { type: "string" }, | ||
feeAmount: { type: "uint32" }, | ||
feeCurrency: { type: "string" } | ||
}, | ||
additionalProperties: true | ||
} | ||
}, | ||
optionalProperties: { | ||
addressType: { type: "string" }, | ||
feeAmount: { type: "uint32" }, | ||
feeCurrency: { type: "string" } | ||
captureMethod: { type: "string" }, | ||
confirmationMethod: { type: "string" }, | ||
coupons: { elements: { type: "string" } }, | ||
reference: { type: "string" } | ||
}, | ||
additionalProperties: true | ||
}, | ||
customer: { | ||
optionalProperties: { | ||
accountAge: { type: "uint32" }, | ||
emailAddress: { type: "string" }, | ||
firstName: { type: "string" }, | ||
lastName: { type: "string" }, | ||
phoneNumber: { type: "string" }, | ||
firstNameKana: { type: "string" }, | ||
lastNameKana: { type: "string" }, | ||
address: { ref: "address" }, | ||
dateOfBirth: { type: "string" }, | ||
legalGender: { type: "string" }, | ||
reference: { type: "string" } | ||
}, | ||
additionalProperties: true | ||
} | ||
}, | ||
properties: {}, | ||
optionalProperties: { | ||
captureMethod: { type: "string" }, | ||
confirmationMethod: { type: "string" }, | ||
description: { type: "string" }, | ||
customerInfo: { ref: "customer" }, | ||
customer: { ref: "customer" }, | ||
orderData: { ref: "order" }, | ||
amount: { type: "uint32" }, | ||
currency: { type: "string" }, | ||
lineItemData: { elements: { ref: "lineItem" } }, | ||
items: { elements: { ref: "lineItem" } }, | ||
shipping: { ref: "address" }, | ||
reference: { type: "string" }, | ||
successUrl: { type: "string" }, | ||
cancelUrl: { type: "string" } | ||
cancelUrl: { type: "string" }, | ||
successURL: { type: "string" }, | ||
cancelURL: { type: "string" } | ||
}, | ||
@@ -377,5 +536,5 @@ additionalProperties: true | ||
var validateCheckoutSessionPayload = (payload) => { | ||
const errors = validate(simple_checkout_session_payload_jtd_default, JSON.parse(JSON.stringify(payload))); | ||
if (payload.items.length === 0) { | ||
errors.push("payload.items is required."); | ||
const errors = validate(checkout_session_payload_jtd_default, JSON.parse(JSON.stringify(payload))); | ||
if (payload.orderData.lineItemData.length === 0) { | ||
errors.push("payload.orderData.lineItemnData is required."); | ||
} | ||
@@ -385,6 +544,7 @@ return errors; | ||
var getCurrency = (payload) => { | ||
var _a2; | ||
let { currency } = payload; | ||
var _a2, _b2; | ||
const { orderData } = payload; | ||
let { currency } = orderData; | ||
if (!currency) { | ||
currency = (_a2 = payload.items[0]) == null ? void 0 : _a2.currency; | ||
currency = (_b2 = (_a2 = orderData.lineItemData[0]) == null ? void 0 : _a2.priceData) == null ? void 0 : _b2.currency; | ||
} | ||
@@ -395,3 +555,4 @@ return currency; | ||
const payload = normalizeCheckoutSessionPayload(input); | ||
const { shippingInfo } = payload; | ||
const { orderData } = payload; | ||
const { shippingInfo } = orderData; | ||
const currency = getCurrency(payload); | ||
@@ -404,4 +565,4 @@ if (!currency) { | ||
} | ||
if (!payload.currency) { | ||
payload.currency = currency; | ||
if (orderData && !(orderData == null ? void 0 : orderData.currency)) { | ||
payload.orderData.currency = currency; | ||
} | ||
@@ -414,15 +575,16 @@ if (shippingInfo && !(shippingInfo == null ? void 0 : shippingInfo.feeCurrency)) { | ||
const shipping = feeCurrency === currency && feeAmount || 0; | ||
if (payload.amount == null) { | ||
payload.amount = payload.items.reduce((sum, item) => { | ||
let itemCurrency = item.currency; | ||
if (orderData.amount == null) { | ||
orderData.amount = orderData.lineItemData.reduce((sum, item) => { | ||
const { priceData } = item; | ||
let itemCurrency = priceData.currency; | ||
if (!itemCurrency) { | ||
item.currency = currency; | ||
priceData.currency = currency; | ||
itemCurrency = currency; | ||
} | ||
if (itemCurrency === currency) { | ||
return sum + (item.amount ? item.amount * item.quantity : 0); | ||
return sum + (priceData && priceData.amount ? priceData.amount * item.quantity : 0); | ||
} | ||
throw new SmartError({ | ||
errorCode: "request.invalid", | ||
details: ["payload.items[].currency is invalid"] | ||
details: ["payload.orderData.lineItemData[].currency is invalid"] | ||
}); | ||
@@ -522,3 +684,3 @@ }, 0) + shipping; | ||
"dev-lang": "nodejs", | ||
"sdk-version": "0.3.0" | ||
"sdk-version": "0.3.2" | ||
}; | ||
@@ -525,0 +687,0 @@ const req = this.request(`/checkout-sessions?${qs.stringify(params)}`, { |
@@ -1,2 +0,2 @@ | ||
import type { CustomerInfo, CustomerInfoLoose, SimpleLineItem, SimpleChekoutSessionPayload, ShippingInfo, Address, LooseObject } from './types'; | ||
import type { CustomerInfo, CustomerInfoLoose, ProductData, PriceData, LineItemDataFlat, OrderDataLoose, ChekoutSessionPayloadFlat, ShippingInfo, Address, LooseObject } from './types'; | ||
export declare const omit: (obj: LooseObject, omitKeys: string[]) => { | ||
@@ -6,7 +6,7 @@ [x: string]: any; | ||
export declare const normalizeCustomerInfo: (customer?: CustomerInfoLoose) => CustomerInfo; | ||
export declare const normalizeItem: (item: SimpleLineItem) => { | ||
quantity: number; | ||
name: string; | ||
export declare const normalizeProductData: (product?: Partial<ProductData>) => { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
@@ -16,38 +16,65 @@ images: string[] | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
export declare const normalizePriceData: (price?: Partial<PriceData>) => { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
export declare const normalizeLineItemData: (item: LineItemDataFlat) => { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}; | ||
export declare const normalizeItems: (list?: SimpleLineItem[]) => { | ||
export declare const normalizeLineItemDataList: (list?: LineItemDataFlat[]) => { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
name: string; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}[]; | ||
export declare const normalizeShippingInfo: (shipping?: Partial<ShippingInfo> & Partial<Address>) => { | ||
address: Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
export declare const normalizeCheckoutSessionPayload: (payload: SimpleChekoutSessionPayload) => { | ||
export declare const normalizeOrderData: (order: OrderDataLoose) => { | ||
amount: number | undefined; | ||
@@ -57,36 +84,39 @@ currency: string | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
items: { | ||
coupons: string[] | undefined; | ||
shippingInfo: ShippingInfo | undefined; | ||
lineItemData: { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
name: string; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}[]; | ||
customerInfo: CustomerInfo; | ||
shippingInfo: { | ||
address: Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
reference: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
successUrl: string | undefined; | ||
cancelUrl: string | undefined; | ||
}; | ||
declare const _default: { | ||
normalizeCheckoutSessionPayload: (payload: SimpleChekoutSessionPayload) => { | ||
export declare const normalizeShipping: (shipping?: Partial<ShippingInfo> & Partial<Address>) => { | ||
address: Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
export declare const normalizeCheckoutSessionPayload: (payload: ChekoutSessionPayloadFlat) => { | ||
customerInfo: CustomerInfo; | ||
orderData: { | ||
amount: number | undefined; | ||
@@ -96,35 +126,73 @@ currency: string | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
items: { | ||
coupons: string[] | undefined; | ||
shippingInfo: ShippingInfo | undefined; | ||
lineItemData: { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
name: string; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}[]; | ||
customerInfo: CustomerInfo; | ||
shippingInfo: { | ||
address: Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
reference: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
successUrl: string | undefined; | ||
cancelUrl: string | undefined; | ||
}; | ||
successUrl: string; | ||
cancelUrl: string; | ||
}; | ||
declare const _default: { | ||
normalizeCheckoutSessionPayload: (payload: ChekoutSessionPayloadFlat) => { | ||
customerInfo: CustomerInfo; | ||
orderData: { | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
captureMethod: "automatic" | "manual" | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
coupons: string[] | undefined; | ||
shippingInfo: ShippingInfo | undefined; | ||
lineItemData: { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}[]; | ||
reference: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
successUrl: string; | ||
cancelUrl: string; | ||
}; | ||
}; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
import { KeyString, SmartPayOptions, CheckoutSession, SimpleChekoutSessionPayload } from './types'; | ||
import { KeyString, SmartPayOptions, ChekoutSessionPayload, CheckoutSession, ChekoutSessionPayloadFlat } from './types'; | ||
interface Params { | ||
@@ -25,4 +25,4 @@ [key: string]: string; | ||
}): Promise<any>; | ||
static normalizeCheckoutSessionPayload(payload: SimpleChekoutSessionPayload): SimpleChekoutSessionPayload; | ||
createCheckoutSession(payload: SimpleChekoutSessionPayload): Promise<CheckoutSession>; | ||
static normalizeCheckoutSessionPayload(payload: ChekoutSessionPayloadFlat): ChekoutSessionPayload; | ||
createCheckoutSession(payload: ChekoutSessionPayloadFlat): Promise<CheckoutSession>; | ||
setPublicKey(publicKey: KeyString): {}; | ||
@@ -29,0 +29,0 @@ getSessionURL(session: CheckoutSession, options?: GetSessionURLOptions): string; |
@@ -82,5 +82,7 @@ export interface LooseObject { | ||
}; | ||
export declare type SimpleLineItem = { | ||
export declare type LineItemDataFlat = { | ||
price?: string; | ||
priceData?: PriceData; | ||
quantity: number; | ||
name: string; | ||
name?: string; | ||
brand?: string; | ||
@@ -92,4 +94,5 @@ categories?: string[]; | ||
url?: string; | ||
amount: number; | ||
currency: string; | ||
amount?: number; | ||
priceAmount?: number; | ||
currency?: string; | ||
label?: string; | ||
@@ -123,2 +126,15 @@ description?: string; | ||
}; | ||
export declare type OrderDataLoose = { | ||
amount?: number; | ||
currency?: string; | ||
captureMethod?: 'automatic' | 'manual'; | ||
confirmationMethod?: 'automatic' | 'manual'; | ||
coupons?: string[]; | ||
lineItemData?: LineItemData[]; | ||
items?: LineItemDataFlat[]; | ||
shippingInfo?: ShippingInfo; | ||
reference?: string; | ||
description?: string; | ||
metadata?: MetaData; | ||
}; | ||
export declare type ChekoutSessionPayload = { | ||
@@ -131,3 +147,3 @@ customerInfo: CustomerInfo; | ||
}; | ||
export declare type SimpleChekoutSessionPayload = { | ||
export declare type ChekoutSessionPayloadFlat = { | ||
amount?: number; | ||
@@ -137,11 +153,21 @@ currency?: string; | ||
confirmationMethod?: 'automatic' | 'manual'; | ||
items: SimpleLineItem[]; | ||
coupons?: string[]; | ||
lineItemData?: LineItemData[]; | ||
shippingInfo?: ShippingInfo; | ||
items?: LineItemDataFlat[]; | ||
shipping?: Partial<ShippingInfo> & Partial<Address>; | ||
customerInfo?: CustomerInfo; | ||
description?: string; | ||
metadata?: MetaData; | ||
customer?: CustomerInfoLoose; | ||
orderData?: OrderData; | ||
reference?: string; | ||
successURL?: string; | ||
cancelURL?: string; | ||
successUrl?: string; | ||
cancelUrl?: string; | ||
description?: string; | ||
metadata?: MetaData; | ||
orderDescription?: string; | ||
orderMetadata?: MetaData; | ||
promotionCode?: string; | ||
test?: boolean; | ||
}; | ||
@@ -148,0 +174,0 @@ export declare type RefundPayload = { |
@@ -1,2 +0,2 @@ | ||
import type { KeyString, SimpleChekoutSessionPayload, ErrorDetails } from './types'; | ||
import type { KeyString, ChekoutSessionPayload, ChekoutSessionPayloadFlat, ErrorDetails } from './types'; | ||
export declare class SmartError extends Error { | ||
@@ -18,43 +18,44 @@ statusCode?: number; | ||
export declare const isValidPaymentID: (paymentID: string) => boolean; | ||
export declare const validateCheckoutSessionPayload: (payload: SimpleChekoutSessionPayload) => ErrorDetails; | ||
export declare const validateCheckoutSessionPayload: (payload: ChekoutSessionPayload) => ErrorDetails; | ||
/** | ||
* Try to get the currency of this checkout | ||
*/ | ||
export declare const getCurrency: (payload: SimpleChekoutSessionPayload) => string; | ||
export declare const normalizeCheckoutSessionPayload: (input: SimpleChekoutSessionPayload) => { | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
captureMethod: "automatic" | "manual" | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
items: { | ||
quantity: number; | ||
name: string; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
export declare const getCurrency: (payload: ChekoutSessionPayload) => string | undefined; | ||
export declare const normalizeCheckoutSessionPayload: (input: ChekoutSessionPayloadFlat) => { | ||
customerInfo: import("./types").CustomerInfo; | ||
orderData: { | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
captureMethod: "automatic" | "manual" | undefined; | ||
confirmationMethod: "automatic" | "manual" | undefined; | ||
coupons: string[] | undefined; | ||
shippingInfo: import("./types").ShippingInfo | undefined; | ||
lineItemData: { | ||
price: string | undefined; | ||
priceData: { | ||
productData: { | ||
name: string | undefined; | ||
brand: string | undefined; | ||
categories: string[] | undefined; | ||
description: string | undefined; | ||
gtin: string | undefined; | ||
images: string[] | undefined; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
amount: number | undefined; | ||
currency: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}; | ||
quantity: number; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
}[]; | ||
reference: string | undefined; | ||
url: string | undefined; | ||
amount: number; | ||
currency: string; | ||
label: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
productDescription: string | undefined; | ||
productMetadata: import("./types").MetaData | undefined; | ||
priceDescription: string | undefined; | ||
priceMetadata: import("./types").MetaData | undefined; | ||
}[]; | ||
customerInfo: import("./types").CustomerInfo; | ||
shippingInfo: { | ||
address: import("./types").Address; | ||
addressType: import("./types").AddressType | undefined; | ||
feeAmount: number | undefined; | ||
feeCurrency: string | undefined; | ||
}; | ||
reference: string | undefined; | ||
description: string | undefined; | ||
metadata: import("./types").MetaData | undefined; | ||
successUrl: string | undefined; | ||
cancelUrl: string | undefined; | ||
successUrl: string; | ||
cancelUrl: string; | ||
}; | ||
@@ -61,0 +62,0 @@ export declare const DEFAULT_ERROR_MESSAGES: { |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Smartpay SDK NodeJS", | ||
@@ -10,0 +10,0 @@ "main": "./build/cjs/index.cjs", |
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
109086
3671
0