Skip to content

Latest commit

 

History

History
648 lines (450 loc) · 21.6 KB

File metadata and controls

648 lines (450 loc) · 21.6 KB

Classes

ActionFactory
CartEventMapper
CustomerEventMapper
Money
OrderEventMapper
ApiClientService
LoggerService

Members

setDiscount
addCustomLineItem
removeCustomLineItem

Typedefs

CtpPrice : Object
CtpLineItem : Object
CtpCustomLineItem : Object
CtpCartEventResourceObject : Object
CtpCartEventResource : Object
CtpCartEvent : Object
CtpCustomerEventResourceObject : Object
CtpCustomerEventResource : Object
CtpCustomerEvent : Object
CtpOrderEventResourceObject : Object
CtpOrderEventResource : Object
CtpOrderEvent : Object
CustomerProfileObject : Object
CustomerSessionObject : Object

ActionFactory

Kind: global class

new ActionFactory(lang, taxCategoryId, currencyCode)

Configure ActionFactory.

Param Type
lang string
taxCategoryId string
currencyCode string

actionFactory.constructFromEffect(effectType, props) ⇒ null | Object

Create commercetools Update Action based on Effect from TalonOne.

Kind: instance method of ActionFactory

Param Type
effectType string
props Object

actionFactory.addCustomLineItemFromEffect(effectType, props) ⇒ Object

Kind: instance method of ActionFactory

Param Type
effectType string
props Object

actionFactory.addCustomLineItem(name, currencyCode, centAmount) ⇒ Object

Kind: instance method of ActionFactory
See: https://docs.commercetools.com/api/projects/carts#add-customlineitem

Param Type
name string
currencyCode string
centAmount number

actionFactory.removeCustomLineItem(customLineItemId) ⇒ Object

Kind: instance method of ActionFactory
See: https://docs.commercetools.com/api/projects/carts#remove-customlineitem

Param Type
customLineItemId string

CartEventMapper

Kind: global class

new CartEventMapper(lang, cartId, customerId, totalPrice, lineItems)

Param Type
lang string
cartId string
customerId string
totalPrice CtpPrice
lineItems Array.<CtpLineItem>

CustomerEventMapper

Kind: global class

new CustomerEventMapper(customerId, customerData, attributeMappings)

Param Type
customerId string
customerData object
attributeMappings object

customerEventMapper.getProfileIntegrationId() ⇒ string

Kind: instance method of CustomerEventMapper

customerEventMapper.getDefaultBillingAddress(prefix) ⇒ object

Kind: instance method of CustomerEventMapper

Param Type Default
prefix string | null null

customerEventMapper.getDefaultShippingAddress(prefix) ⇒ object

Kind: instance method of CustomerEventMapper

Param Type Default
prefix string | null null

customerEventMapper.getAddressById(addressId, prefix) ⇒ object

Kind: instance method of CustomerEventMapper

Param Type Default
addressId string
prefix string | null null

customerEventMapper.mapDate(date) ⇒ string

Kind: instance method of CustomerEventMapper

Param Type
date string

customerEventMapper.getCustomAttributes() ⇒ object

Kind: instance method of CustomerEventMapper

customerEventMapper.getFlatterAttributes() ⇒ object

Kind: instance method of CustomerEventMapper

customerEventMapper.mapAttributes() ⇒ Object

Kind: instance method of CustomerEventMapper

Money

Kind: global class

new Money(type, currencyCode, amount, fractionDigits)

Param Type Default
type MoneyType
currencyCode string
amount number
fractionDigits number 2

money.getType() ⇒ MoneyType

Kind: instance method of Money

money.getFractionDigits() ⇒ number

Kind: instance method of Money

money.getCurrencyCode() ⇒ string

Kind: instance method of Money

money.getDecimalAmount() ⇒ number

Kind: instance method of Money

money.getCentAmount() ⇒ number

Kind: instance method of Money

OrderEventMapper

Kind: global class

new OrderEventMapper(cartId, orderState)

Param Type
cartId string
orderState OrderState

ApiClientService

Kind: global class

new ApiClientService(basePath, apiKey)

Param Type
basePath string
apiKey string

apiClientService.updateCustomerProfile(id, payload) ⇒ Promise.<any>

Kind: instance method of ApiClientService

Param Type
id string
payload NewCustomerProfile

apiClientService.updateCustomerSession(id, payload) ⇒ Promise.<any>

Kind: instance method of ApiClientService

Param Type
id string
payload NewCustomerSessionV2

LoggerService

Kind: global class

new LoggerService(mode)

Param Type
mode LoggerMode

loggerService.info(...args)

Kind: instance method of LoggerService

Param
...args

loggerService.debug(...args)

Kind: instance method of LoggerService

Param
...args

loggerService.error(...args)

Kind: instance method of LoggerService

Param
...args

LoggerService.checkMode(mode) ⇒ boolean

Kind: static method of LoggerService

Param Type
mode LoggerMode

setDiscount

Kind: global variable
See:: https://developers.talon.one/Integration-API/handling-effects#setdiscount

addCustomLineItem

Kind: global variable
See: https://docs.commercetools.com/api/projects/carts#add-customlineitem

removeCustomLineItem

Kind: global variable
See: https://docs.commercetools.com/api/projects/carts#remove-customlineitem

EffectTypeMap : enum

Kind: global enum
Read only: true

LoggerMode : enum

Kind: global enum
Read only: true

MoneyType : enum

Kind: global enum
Read only: true

OrderState : enum

Kind: global enum
Read only: true
See: https://docs.commercetools.com/api/projects/orders#orderstate

UpdateAction : enum

Kind: global enum
Read only: true
See: https://docs.commercetools.com/api/projects/carts#update-actions

CtpPrice : Object

Kind: global typedef
Properties

Name Type
type string
currencyCode string
centAmount number
fractionDigits number

CtpLineItem : Object

Kind: global typedef
Properties

Name Type
name Object
productId string
quantity number
totalPrice CtpPrice
price Object
price.value CtpPrice

CtpCustomLineItem : Object

Kind: global typedef
Properties

Name Type
name Object
productId string
quantity number
totalPrice CtpPrice
money CtpPrice

CtpCartEventResourceObject : Object

Kind: global typedef
Properties

Name Type
id string
customerId string
totalPrice CtpPrice
lineItems Array.<CtpLineItem>

CtpCartEventResource : Object

Kind: global typedef
Properties

Name Type
obj CtpCartEventResourceObject

CtpCartEvent : Object

Kind: global typedef
Properties

Name Type
resource CtpCartEventResource

CtpCustomerEventResourceObject : Object

Kind: global typedef
Properties

Name Type
id string
version string
lastMessageSequenceNumber string
createdAt string
lastModifiedAt string
customerNumber string
email string
firstName string
lastName string
title string
salutation string
dateOfBirth string
companyName string
vatId string
defaultShippingAddressId string
defaultBillingAddressId string
externalId string

CtpCustomerEventResource : Object

Kind: global typedef
Properties

Name Type
obj CtpCustomerEventResourceObject

CtpCustomerEvent : Object

Kind: global typedef
Properties

Name Type
resource CtpCustomerEventResource

CtpOrderEventResourceObject : Object

Kind: global typedef
Properties

Name Type
orderState OrderState
cart Object
cart.id string

CtpOrderEventResource : Object

Kind: global typedef
Properties

Name Type
obj CtpOrderEventResourceObject

CtpOrderEvent : Object

Kind: global typedef
Properties

Name Type
resource CtpOrderEventResource

CustomerProfileObject : Object

Kind: global typedef
Properties

Name Type
id string
payload NewCustomerProfile

CustomerSessionObject : Object

Kind: global typedef
Properties

Name Type
id string
payload NewCustomerSessionV2