@startuml ' This is a plantUML (http://plantuml.sourceforge.net/) file that contains the class diagram of the JS SDK. title JavaScript SDK class diagram skinparam class { BackgroundColor #F0F9FC ArrowColor #0091CF BorderColor #0091CF } package "client API response wrappers" <> { class BasicPaymentProducts #f2f2f2 { +JSON json +Array accountsOnFile +AssociativeArray accountOnFileById +Array basicPaymentProducts +AssociativeArray basicPaymentProductById +AssociativeArray basicPaymentProductByAccountOnFileId } class BasicPaymentProductGroups #f2f2f2 { +JSON json +Array accountsOnFile +AssociativeArray accountOnFileById +Array basicPaymentProductGroups +AssociativeArray basicPaymentProductGroupById } class BasicPaymentItems #f2f2f2 { +JSON json +Array accountsOnFile +AssociativeArray accountOnFileById +Array basicPaymentItems +AssociativeArray basicPaymentItemById } interface BasicPaymentItem #f2f2f2{ +JSON json +String id +String acquirerCountry +DisplayHints displayHints +Array accountsOnFile +AssociativeArray accountOnFileById } interface PaymentItem #f2f2f2 { +Array paymentProductFields +AssociativeArray paymentProductFieldById } class BasicPaymentProduct #f2f2f2 { +JSON json +String id +Boolean allowsRecurring +Boolean allowsTokenization +Boolean autoTokenized +Boolean allowsInstallments +String acquirerCountry +MobileIntegrationLevel mobileIntegrationLevel +DisplayHints displayHints +Number minAmount +Number maxAmount +Boolean usesRedirectionTo3rdParty +String paymentMethod +String paymentGroup +Array accountsOnFile +AssociativeArray accountOnFileById } class PaymentProduct #f2f2f2 { +Array paymentProductFields +AssociativeArray paymentProductFieldById } class BasicPaymentProductGroup #f2f2f2 { +JSON json +String id +String acquirerCountry +DisplayHints displayHints +Array accountsOnFile +AssociativeArray accountOnFileById } class PaymentProductGroup #f2f2f2 { +Array paymentProductFields +AssociativeArray paymentProductFieldById } class AccountOnFile #f2f2f2 { +JSON json +String id +String paymentProductId +String displayText +Array attributes +AssociativeArray attributeByKey +AccountOnFileDisplayHints displayHints +String getMaskedValueByAttributeKey(String attributeKey) } class Attribute #f2f2f2 { +JSON json +String key +String value +AccountOnFileAttributeStatus status +String mustWriteReason } class LabelTemplateElement #f2f2f2 { +JSON json +String attributeKey +String mask +String wildcardMask } class AccountOnFileDisplayHints #f2f2f2 { +JSON json +Array labelTemplate +AssociativeArray labelTemplateElementByAttributeKey } class PaymentProductField #f2f2f2 { +JSON json +String id +String type +Number displayOrder +DisplayHints displayHints +DataRestrictions dataRestrictions +Array getErrorCodes(String value) +Boolean isValid(String value) +Boolean isValid(PaymentRequest request) +String applyMask(String newValue, String oldValue) +String applyWildcardMask(String newValue, String oldValue) +String removeMask(String value) } class PaymentProduct302SpecificData #f2f2f2 { +JSON json +Array networks } class PaymentProduct320SpecificData #f2f2f2 { +JSON json +Array networks } class PaymentProduct863SpecificData #f2f2f2 { +JSON json +Array integrationTypes } class PaymentProductDisplayHints #f2f2f2 { +JSON json +Number displayOrder +String label +String logo } class PaymentProductFieldDisplayHints #f2f2f2 { +JSON json +PreferredInputType preferredInputType +FormElement formElement +String mask +String wildcardMask +Boolean obfuscate +Number displayOrder +String label +String placeholderLabel +Tooltip tooltip +Boolean alwaysShow } class DataRestrictions #f2f2f2 { +JSON json +Boolean isRequired +Array validationRules +ValidationRule getValidationRuleByType(String type) } abstract class ValidationRule #f2f2f2 { +JSON json +String errorMessageId +String type +Boolean validate(String value) +Boolean validate(PaymentRequest request, String fieldId) } class ValidationRuleFactory #f2f2f2 { +Validation makeValidator(JSON json) } class ValidationRuleRegularExpression #f2f2f2 { +String regularExpression } class ValidationRuleEmailAddress #f2f2f2 { } class ValidationRuleExpirationDate #f2f2f2 { } class ValidationRuleFixedList #f2f2f2 { +Array allowedValues } class ValidationRuleLength #f2f2f2 { +Number minLength +Number maxLength } class ValidationRuleLuhn #f2f2f2 { } class ValidationRuleRange #f2f2f2 { +Number minValue +Number maxValue } class IinDetailsResponse #f2f2f2 { +JSON json +String paymentProductId +IinStatus status +String countryCode +Boolean isAllowedInContext +Array coBrands } class IinDetail #f2f2f2 { +JSON json +String paymentProductId +String countryCode +Boolean isAllowedInContext } class PublicKeyResponse #f2f2f2 { +JSON json +String keyId +String publicKey } class Tooltip #f2f2f2 { +JSON json +String image +String label } class FormElement #f2f2f2 { +JSON json +FormElementType type +Array valueMapping } class ValueMappingElement #f2f2f2 { +JSON json +String displayName +String value } enum PreferredInputType #f2f2f2 { STRING_KEYBOARD INTEGER_KEYBOARD EMAILADDRESS_KEYBOARD PHONENUMBER_KEYBOARD } enum FormElementType #f2f2f2 { TEXT LIST CURRENCY } enum IinStatus #f2f2f2 { SUPPORTED UNSUPPORTED UNKNOWN NOT_ENOUGH_DIGITS EXISTING_BUT_NOT_ALLOWED } enum MobileIntegrationLevel #f2f2f2 { NO_SUPPORT BASIC_SUPPORT OPTIMIZED_SUPPORT } enum AccountOnFileAttributeStatus #f2f2f2 { READ_ONLY CAN_WRITE MUST_WRITE } } class Session { +String clientApiUrl +String assetUrl +Session(SessionDetails sessionDetails) +Promise convertAmount(amount, source, target) +Encryptor getEncryptor() +Boolean isEnvironmentTypeProduction() +Promise getIinDetails(String partialCreditCardNumber, PaymentDetails paymentDetails) +Promise getPaymentProduct(String productId, PaymentDetails paymentDetails) +Promise getPaymentProductGroup(String groupId, PaymentDetails paymentDetails) +Promise getBasicPaymentProducts(PaymentDetails paymentDetails) +Promise getBasicPaymentProductGroups(PaymentDetails paymentDetails) +Promise getBasicPaymentItems(PaymentDetails paymentDetails, boolean isGrouped) +Promise getPaymentProductDirectory(paymentProductId, currencyCode, countryCode) +Promise getPaymentProductNetworks(paymentProductId, PaymentDetails paymentDetails) +PaymentRequest getPaymentRequest() +Promise getPublicKey() } class C2SCommunicator { +C2SCommunicator(C2SCommunicatorConfiguration C2SCommunicatorConfiguration, PaymentProduct basicPaymentProduct) +Boolean isEnvironmentTypeProduction() +Promise getPaymentProducts(C2SPaymentProductContext context) +Promise getPaymentProduct(String paymentProductId, C2SPaymentProductContext context) +Promise getPaymentProductIdByCreditCardNumber(String partialCreditCardNumber, C2SPaymentProductContext context) +Promise getPublicKey() +Promise convertAmount(amount, source, target) +Promise getPaymentProductDirectory(paymentProductId, currencyCode, countryCode) } class C2SCommunicatorConfiguration { +String clientSessionId +String consumerId +Region region +Environment environment +String clientApiUrl +String assetUrl +C2SCommunicatorConfiguration(SessionDetails sessionDetails) } class C2SPaymentProductContext { +Number totalAmount +String countryCode +String locale +Boolean isRecurring +String currency } class Encryptor { +Encryptor(Promise publicKeyResponsePromise) +String encypt(PaymentRequest paymentRequest) } class JOSEEncryptor { +String encypt(Object plainTextValues, PublicKeyResponse publicKeyResponse) } class PaymentRequest { +PaymentRequest(String clientSessionId) +Array getErrorMessageIds() +String getValue(String paymentProductFieldId) +Map getValues() +void setValue(String paymentProductFieldId, String value) +MaskedString getMaskedValue(String paymentProductFieldId, String newValue, String oldValue) +Map getMaskedValues() +Map getUnmaskedValues() +void setPaymentProduct(PaymentProduct paymentProduct) +PaymentProduct getPaymentProduct() +void setAccountOnFile(AccountOnFile accountOnFile) +AccountOnFile getAccountOnFile() +Boolean getTokenize() +void setTokenize(Boolean tokenize) +Boolean isValid() +String getClientSessionID() } class MaskingUtil { +MaskedString applyMask(String mask, String value, String oldValue) +Number getMaxLengthBasedOnMask(String mask) +String removeMask(String mask, String value) } class MaskedString { +String formattedValue +Number cursorIndex } class SessionDetails <> { +String clientSessionID +String customerId +Region region +Environment environment } class PaymentDetails <> { +Number totalAmount +String countryCode +String locale +Boolean isRecurring +String currency } class Util { +String getMetadata() +String base64Encode(String|Object data) } enum Region { EU US AMS PAR } enum Environment { PROD PREPROD SANDBOX } Session "1" *-- "1" C2SCommunicator Session "1" o-- "1" PaymentRequest Session "1" o-- "*" PaymentProduct Session "1" o-- "1" BasicPaymentProducts Session "1" o-- "*" PaymentProductGroup Session "1" o-- "1" BasicPaymentProductGroups Session "1" o-- "1" BasicPaymentItems Session "1" o-- "1" Encryptor Session --> PaymentDetails Session --> SessionDetails BasicPaymentItems "1" o-- "*" AccountOnFile BasicPaymentItems "1" o-- "*" BasicPaymentItem BasicPaymentProducts "1" o-- "*" AccountOnFile BasicPaymentProducts "1" o-- "*" BasicPaymentProduct BasicPaymentProductGroups "1" o-- "*" AccountOnFile BasicPaymentProductGroups "1" o-- "*" BasicPaymentProductGroup BasicPaymentItem <|-- PaymentItem BasicPaymentProduct <|-- PaymentProduct BasicPaymentProduct <|- BasicPaymentItem BasicPaymentProduct "1" *-- "1" PaymentProductDisplayHints BasicPaymentProduct "1" *-- "0/1" PaymentProduct302SpecificData BasicPaymentProduct "1" *-- "0/1" PaymentProduct320SpecificData BasicPaymentProduct "1" *-- "0/1" PaymentProduct863SpecificData BasicPaymentProductGroup <|-- PaymentProductGroup BasicPaymentProductGroup <|- BasicPaymentItem BasicPaymentProductGroup "1" *-- "1" PaymentProductDisplayHints PaymentProduct <|- PaymentItem PaymentProduct "1" *-- "*" PaymentProductField PaymentProductGroup <|- PaymentItem PaymentProductGroup "1" *-- "*" PaymentProductField ValidationRule <|-- ValidationRuleLuhn ValidationRule <|-- ValidationRuleExpirationDate ValidationRule <|-- ValidationRuleRegularExpression ValidationRule <|-- ValidationRuleRange ValidationRule <|-- ValidationRuleLength ValidationRule <|-- ValidationRuleFixedList ValidationRule <|-- ValidationRuleEmailAddress C2SCommunicator "1" *-- "1" C2SCommunicatorConfiguration C2SCommunicator --> IinDetailsResponse IinDetailsResponse "1" *-- "*" IinDetail C2SCommunicator --> PublicKeyResponse C2SCommunicator --> C2SPaymentProductContext C2SCommunicator --> Util Encryptor --> JOSEEncryptor PaymentRequest o-- "1" PaymentProduct PaymentRequest o-- "1" AccountOnFile PaymentProductField "1" *-- "1" PaymentProductFieldDisplayHints PaymentProductFieldDisplayHints "1" *-- "1" Tooltip PaymentProductFieldDisplayHints "1" *-- "1" FormElement FormElement "1" *-- "*" ValueMappingElement AccountOnFile "1" *-- "1" AccountOnFileDisplayHints AccountOnFileDisplayHints "1" *-- "*" LabelTemplateElement AccountOnFile "1" *-- "*" Attribute PaymentProductField "1" *-- "1" DataRestrictions DataRestrictions "1" *-- "*" ValidationRule MaskingUtil --> MaskedString DataRestrictions --> ValidationRuleFactory ValidationRuleFactory --> ValidationRule @enduml