Server Automation Scripts and Libraries
Within Innovation Studio, there are bits of code that execute several actions, which embody a business need such as: filtering products, saving session storage, returning products and setting amounts or periods. On-demand automation scripts are available for being called from any object or context.
FTOS_EC_ShoppingCartLoader
It is the client library where the scoring values are hard-coded, the customer data and the configurations for the Select a payment method side panel are. It also calls the script FTOS_BNPL_SaveCustomerLimit and the script FTOS_EC_CreateOrder, FTOS_BNPL_AddBNPLApplication, FTOS_EC_GetUserShoppingCart and FTOS_EC_UpdateCartItemQuantity.
FTOS_BNPLHelper
The server library named FTOS_BNPLHelper gets the records from FTOS_BP_BankingProduct with the status VWApproved
and it also gets the payments scheduled type for each banking product. It contains the scripts:
- FTOS_BNPL_GetAvailableProducts
- FTOS_BNPL_SimulateOfferSummary
- FTOS_BNPL_UpdateBNPLApplication.
Server Automation Scripts are:
- FTOS_BNKAP_AuthenticateUser
- FTOS_BNKAP_BNPLUpdatePaymentDetails
- FTOS_BNPL_ActivateContract
- FTOS_BNPL_AddBNPLApplication
- FTOS_BNPL_BCInsert
- FTOS_BNPL_CalcScoringAndLimit
- FTOS_BNPL_ChangeLoanApplicationStatus
- FTOS_BNPL_CreateMerchantBankAccount
- FTOS_BNPL_CreateSystemUser
- FTOS_BNPL_GetAvailableProducts
- FTOS_BNPL_GetBNPLApplicationLink
- FTOS_BNPL_GetMerchantBankAccount
- FTOS_BNPL_GetRiskLevel
- FTOS_BNPL_GetSavedCards
- FTOS_BNPL_GoToShop
- FTOS_BNPL_Risk_CalcScoringAndLimit
- FTOS_BNPL_RunFinancialCalculation
- FTOS_BNPL_SaveCard
- FTOS_BNPL_SaveContract
- FTOS_BNPL_SaveCustomerLimit
- FTOS_BNPL_SaveEarlyRepayment
- FTOS_BNPL_SimulateOfferSummary
- FTOS_BNPL_UpdateBNPLApplication
- FTOS_BNPL_UpdateContract
- FTOS_BNPL_UpdateFinancialData
- FTOS_BNPL_VerifySistemUserEmail.
This script sets the URL and the username and password.
Input: let applicantId
; let username
; let password
Output: token
This script updates the contract number and card number.
Input: const orderRef
; const cardNo
; const contractNo
Output: cardNumber
; contractNo
.
This script approves the contract.
Input: let contractNo
; let merchantCustomerNo
Output: let approvalData
This script inserts a new record in the entities: FTOS_BARET_Loan, FTOS_BNKAP_RetailApplicantAddress, FTOS_BNKAP_RetailApplicantData, FTOS_BNKAP_Application, FTOS_BNKAP_RetailFinancialData, then it generates the loanNo
. It also saves the session in the entities FTOS_BNKAP_RetailApplicantData and FTOS_BNKAP_RetailApplicantData.
Input: let loanId
; let addressId
; let applicantId
; let applicationId
; let financialDataId
Output: response
This script updates the activeLoansNo: 1
, worstDeliquency: 0
.
Input: var rfd
Output: activeLoansNo
, worstDeliquency
This script runs the formulas BNPL_KO and BNPL_Limit and BNPL_Scoring. From the result of the BNPL_KO formula, if the:
- customerLoyalty is 'N/A', set it to -1, if not turn the value from customerLoyalty to an integer
- averageCheckoutTicketSize is 'N/A', set it to -1, if not turn the value from averageCheckoutTicketSize to an integer
- maxDPD is "N/A", set it to -1, if not turn the value from maxDPD to an integer
- payedInAdvance is 'N/A', set it to -1, if not turn the value from maxDPD to an integer
- BNPLUsageRate is 'N/A', set it to -1, if not turn the value from maxDPD to an integer
- returnedProductsPercent is 'N/A' , set it to -1, if not turn the value from maxDPD to an integer
- uniqueCardsNo is 'N/A' , set it to -1, if not turn the value from maxDPD to an integer
- customerAge =is 'N/A' , set it to -1, if not turn the value from maxDPD to an integer.
Input: var KOInput
; var KOFormula
Output: var res
This script changes the status of the loan within the entity FTOS_BARET_Loan.
Input: var loanId
; var statusName
Output: boolean
This script saves the EUR bank account of the merchant. It sets the customerNo: customerNo
, bankAccountNo: bankAccountNo
.
Input: let merchantName
; let fiscalRegistrationNo
; let commercialRegistration
Output: customerNo
; bankAccountNo
This script creates a user within the FintechOS environment for each customer.
Input: let password
; let applicantDataId
Output: updates the Account with the values for: cbURL
, tokenCB
, usernameCB
, customerNo
, applicantData
.
This script runs the formula BNPL_RK_AvailableProducts, it then turns into a string the result of the formula and parses it. Row by row from the formula result, for each code it adds resultItem
to result
.
Input: let score
; let productCodes
; let countryCode
Output: result
This script generates the B2C link for each loan based on the sessionID
and loanID
to be accessed after the marketplace visit.
Input: let loanId
; let sessionId
Output: the link to the B2C
This script gets the bank account of the e-commerce website.
Input: let merchantName
; let currencyCode
; let token
Output: let bankAccountData
This script get the amount of the loan and the product code and runs the formula BNPL_RK_RiskLevel.
Input: let amount
; let productCode
Output: formulaResult
This script is use to receive the credit cards of the customer from the entity FTOS_MOCK_CreditCard.
Input: let ref
Output: result
This script gets the link to the e-commerce.
Input: N/A
Output: let link
This script gets the result from the formula BNPL_KO_Risk. If the result is Passed
, then the script calculates the time of employment, runs the BNPL_Scoring_Risk formula and the BNPL_MaxDTI_Risk. It is used in the FTOS_BNKAP_BNPLCompleteAccountScoring.
Input: var retailApplicantId
Output: res
(it contains the ko, riskCategory, maxDTI, userScore.
This script saved the credit card information in the entity FTOS_MOCK_CreditCard.
Input: let cardNo
; let cardHolder
; let expDate
; let cvc
; let ref
Output:
CardNumber: cardNo,
CardHolderName: cardHolder,
ExpirationDate: expDate,
CVC: cvc,
AccountRef: ref
This script sets the data from the contract:
- contractId
- customerNo
- productCode
- startDate
- totalInterestRate
- contractPeriod
- firstDueDate
- maturityDate
- bankAccountNo
- destinationBankAccount
- amountDue
- productInterest
- paymentScheduleType
- periodicityType
- installmentDay
- installmentMethod
- reviewInterestDate
- maxDisburseDate
- managingBranch.
Input: let loanId
Output: let contractNo
This script saves the customer data along with the loan data and calculates the limit. Depending on the limit, the customer is approved or denied.
Input: let retailApplicantId
Output: N/A
This script gets the contract data (updates the amount within the contract) and the bank account number, as well as the top up event value for the contract (the first payment and the commission) and the event value of the early repayment reference.
Input: let contractNo
; let eventValue
Output: N/A
This script returns the banking product based on the amount and code. It also calculates the advance
Input: let productAmount
; let bankingProductCode
Output: Boolean
This script updates the payment details in the entity FTOS_EC_Payment.
Input: const orderRef
; const cardNo
; const contractNo
Output: object IFtosScriptableEbsExecutionContext
This script updates the data in the entities: FTOS_BNKAP_RetailApplicantData, FTOS_BNKAP_RetailFinancialData and FTOS_BNKAP_RetailApplicantAddress based on the entity name and id.
Input: let data
Output: data
This script updates the data (advance value) within the loan contract.
Input: let contractNo
; let updateData
;
Output: contractData
This script gets the income and expenses and updates the values in the entity FTOS_BNKAP_RetailFinancialData.
Input: let applicantId
; let income
; let expense
Output: mergedIncome: income
, totalMonthlyPayments: expense
This script checks if the user existing in the system by checking the email address.
Input: let email
Output: let result
This script inserts the feedback in the entity FTOS_BNKAP_Feedback.
Input: var rating
; var sourceId
; var applicationId
Output: string