Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FPS

Simplified class contains some functions from the main class

Already meet the requirements of daily transaction for FPS

Hierarchy

  • FPS

Implements

Index

Constructors

constructor

  • new FPS(): FPS

Billing Data Properties

Private Optional additionalInfo

additionalInfo: ADDITIONAL_INFO

Format Indicator Properties

Private Optional formatIndicator

formatIndicator: string = "01"

Merchant Account Properties

Private Optional merchantAccount

merchantAccount: "26" = "26"

Private Optional merchantAccountInfo

merchantAccountInfo: MERCHANT_ACCOUNT_INFO = ...

Merchant Information Properties

Private countryCode

countryCode: "HK" = "HK"

Private merchantCategory

merchantCategory: string = "0000"

Private merchantCity

merchantCity: string = "HK"

Private merchantName

merchantName: string = "NA"

Other Properties

Private Optional cyclicRedundancyCheck

cyclicRedundancyCheck: string

Point of Initiation Properties

Private Optional initiationPoint

initiationPoint: POINT_OF_INITIATION = "11"

Transaction Data Properties

Private Optional transactionAmount

transactionAmount: string

Private transactionCurrency

transactionCurrency: "CNY" | "HKD" | "TWD" | "USD" = "HKD"

Bank Participant Accessors

Static BANK_BANK_OF_CHINA

  • get BANK_BANK_OF_CHINA(): "012"
  • Bank of China (Hong Kong) Limited

    Used in FPS.setBank

    category

    Bank Participant

    Returns "012"

Static BANK_CITIBANK

  • get BANK_CITIBANK(): "250"
  • Citibank (Hong Kong) Limited

    Used in FPS.setBank

    category

    Bank Participant

    Returns "250"

Static BANK_DBS

  • get BANK_DBS(): "016"
  • DBS Bank (Hong Kong) Ltd.

    Used in FPS.setBank

    category

    Bank Participant

    Returns "016"

Static BANK_EAST_ASIA

  • get BANK_EAST_ASIA(): "015"
  • The Bank of East Asia, Limited

    Used in FPS.setBank

    category

    Bank Participant

    Returns "015"

Static BANK_HANG_SANG

  • get BANK_HANG_SANG(): "024"
  • Hang Seng Bank Ltd.

    Used in FPS.setBank

    category

    Bank Participant

    Returns "024"

Static BANK_HSBC

  • get BANK_HSBC(): "004"
  • The Hongkong and Shanghai Banking Corporation Limited

    Used in FPS.setBank

    category

    Bank Participant

    Returns "004"

Static BANK_STANDARD_CHARTERED

  • get BANK_STANDARD_CHARTERED(): "003"
  • Standard Chartered Bank (Hong Kong) Limited

    Used in FPS.setBank

    category

    Bank Participant

    Returns "003"

Currency Accessors

Static CURRENCY_CNY

  • get CURRENCY_CNY(): "CNY"
  • Chinese Yuan Renminbi

    Used in FPS.setCurrency

    category

    Currency

    Returns "CNY"

Static CURRENCY_HKD

  • get CURRENCY_HKD(): "HKD"
  • Hong Kong Dollar

    Used in FPS.setCurrency

    category

    Currency

    Returns "HKD"

Static CURRENCY_TWD

  • get CURRENCY_TWD(): "TWD"
  • Taiwan New Dollar

    Used in FPS.setCurrency

    category

    Currency

    Returns "TWD"

Static CURRENCY_USD

  • get CURRENCY_USD(): "USD"
  • United States Dollar

    Used in FPS.setCurrency

    category

    Currency

    Returns "USD"

FPS Identifier Accessors

Static FPS_EMAIL_IRD_PERSONAL_ASSESSMENT

  • get FPS_EMAIL_IRD_PERSONAL_ASSESSMENT(): "FPS_Identifier_CRC201D@ird.gov.hk"
  • Inland Revenue Department - Personal Assessment

    Used in FPS.setEmail

    category

    FPS Identifier

    Returns "FPS_Identifier_CRC201D@ird.gov.hk"

Static FPS_EMAIL_IRD_PROFITS_TAX

  • get FPS_EMAIL_IRD_PROFITS_TAX(): "FPS_Identifier_CRC201A@ird.gov.hk"
  • Inland Revenue Department - Profits Tax

    Used in FPS.setEmail

    category

    FPS Identifier

    Returns "FPS_Identifier_CRC201A@ird.gov.hk"

Static FPS_EMAIL_IRD_SALARIES_TAX

  • get FPS_EMAIL_IRD_SALARIES_TAX(): "FPS_Identifier_CRC201B@ird.gov.hk"
  • Inland Revenue Department - Salaries Tax

    Used in FPS.setEmail

    category

    FPS Identifier

    Returns "FPS_Identifier_CRC201B@ird.gov.hk"

Static FPS_ID_CLP

  • get FPS_ID_CLP(): "4853305"
  • CLP Power Hong Kong Ltd.

    Used in FPS.setFPSId

    category

    FPS Identifier

    Returns "4853305"

SVF Participant Accessors

Static BANK_ALIPAY

  • get BANK_ALIPAY(): "948"
  • Alipay Financial Services (HK) Limited

    Used in FPS.setBank

    category

    SVF Participant

    Returns "948"

Static BANK_OCTOPUS

  • get BANK_OCTOPUS(): "949"
  • Octopus Cards Limited

    Used in FPS.setBank

    category

    SVF Participant

    Returns "949"

Static BANK_PAYME

  • get BANK_PAYME(): "954"
  • PayMe

    Used in FPS.setBank

    category

    SVF Participant

    Returns "954"

Static BANK_TAP_N_GO

  • get BANK_TAP_N_GO(): "935"
  • HKT Payment Limited

    Used in FPS.setBank

    category

    SVF Participant

    Returns "935"

Static BANK_TNG

  • get BANK_TNG(): "947"
  • TNG (Asia) Limited

    Used in FPS.setBank

    category

    SVF Participant

    Returns "947"

Static BANK_WECHAT

  • get BANK_WECHAT(): "931"
  • WeChat Pay Hong Kong Limited

    Used in FPS.setBank

    category

    SVF Participant

    Returns "931"

Billing Data Methods

getBillNumber

getReference

setAdditionalInfo

  • setAdditionalInfo(x: VALID_OBJECT): Response

setBillNumber

setReference

  • Set the reference of the transaction

    Parameters

    • x: string

    Returns Response

Merchant Account Methods

getBank

  • Get merchant account participant code

    Parameters

    • toName: boolean = false

      Return the name of the participant

    Returns Response

getEmail

getFPSId

getMobile

  • Get merchant account identifier - Mobile Number

    Returns Response

setBank

  • setBank(x: "036" | "044" | "064" | "933" | "947" | "948" | "931" | "012" | "929" | "930" | "934" | "949" | "952" | "003" | "004" | "009" | "014" | "015" | "016" | "019" | "020" | "024" | "025" | "026" | "027" | "028" | "029" | "030" | "031" | "033" | "035" | "038" | "039" | "040" | "041" | "043" | "061" | "070" | "128" | "250" | "935" | "954"): Response
  • Set merchant account participant code

    Parameters

    • x: "036" | "044" | "064" | "933" | "947" | "948" | "931" | "012" | "929" | "930" | "934" | "949" | "952" | "003" | "004" | "009" | "014" | "015" | "016" | "019" | "020" | "024" | "025" | "026" | "027" | "028" | "029" | "030" | "031" | "033" | "035" | "038" | "039" | "040" | "041" | "043" | "061" | "070" | "128" | "250" | "935" | "954"

    Returns Response

setEmail

setFPSId

  • setFPSId(x: string | number): Response

setMerchantAccount

  • setMerchantAccount(x: VALID_OBJECT): Response

setMobile

  • setMobile(x: string | number): Response

Other Methods

extract

  • Extract data from plaintext

    Parameters

    • x: string = ""

      Plaintext decoded from QR code

    Returns Response

generate

parse

  • Extract and parse data from plaintext

    Parameters

    • x: string

      Plaintext decoded from QR code

    Returns Response

payload

  • payload(id: VALID_ID, content?: string): string
  • Function to help building the resulting string

    Parameters

    • id: VALID_ID
    • content: string = ""

    Returns string

setAlphanumericSpecial

  • setAlphanumericSpecial(x: string, length: number): Response
  • Function to validate a string as alphanumeric special string (A-z0-9.@_+-)

    Parameters

    • x: string

      Source string

    • length: number

      Maximum length available

    Returns Response

setNumeric

  • setNumeric(x: string | number, fraction?: number | boolean, limit?: number): Response
  • Function to validate a string or number as a valid numeric string

    Parameters

    • x: string | number

      Source string or number

    • fraction: number | boolean = false

      Force the number to be converted in fixed-point notation (i.e. x.toFixed(fraction))

    • limit: number = 13

      Maximum length available

    Returns Response

Point of Initiation Methods

isStatic

  • isStatic(): boolean
  • Check if it is a static QR Code

    Returns boolean

setDynamic

setStatic

Transaction Data Methods

getAmount

  • getAmount(toNumber?: boolean): Response
  • Get transaction amount

    Parameters

    • toNumber: boolean = false

      Convert number string to number

    Returns Response

getCurrency

  • getCurrency(toCode?: boolean): Response
  • Get transaction currency code

    Parameters

    • toCode: boolean = false

      Get the 3-digit number code instead

    Returns Response

setAmount

setCNY

setCurrency

  • setCurrency(x: "CNY" | "HKD" | "TWD" | "USD"): Response
  • Set transaction currency code

    Will be converted to number code in FPS.generate

    Parameters

    • x: "CNY" | "HKD" | "TWD" | "USD"

    Returns Response

setHKD

static Methods

Static Silent

  • Silent(): void
  • Prevent function throwing error and stop the script. You may need to handle the error yourself.

    Returns void

Generated using TypeDoc