Skip to content

Commit 8761c40

Browse files
committed
update language, add functions
1 parent fd77e05 commit 8761c40

9 files changed

Lines changed: 62 additions & 26 deletions

File tree

docs/payscript/built_in_functions.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,48 @@ parent: Payscript
44
layout: page
55
---
66

7-
built in functions
7+
# built in functions
88

9-
## Reserve functions
9+
## Account Functions
1010

11-
### Add Funds
12-
`addFundsToReserve(String fromAccount, String toReserve, decimal amount, String reference)`
11+
## `boolean accountExists(AccountIdentifier accountIdentifier)`
12+
Checks whether an account exists.
13+
14+
15+
## `boolean checkAccountFunds(AccountIdentifier accountIdentifier, BigDecimal amount)`
16+
Checks whether an account has the required funds available
17+
18+
19+
## `BalanceInfo getBalance(AccountIdentifier accountIdentifier)`
20+
Shows the total balance and available balance for an account
21+
22+
23+
## `List<RelatedAccountInfo> getRelatedAccountIds(AccountIdentifier accountIdentifier)`
24+
Retrieve the number of accounts related to a specified account
25+
26+
## `ConsentStatus getConsent(AccountIdentifier giverAccountId, AccountIdentifier holderAccountId, ConsentType type)`
27+
Retrieve consent status for a particular account
28+
29+
## Payment Functions
1330

31+
## `UUID createPayment(String payerAccountNumber, String payeeAccountNumber, BigDecimal amount, String purpose)`
32+
Makes a payment between two accounts
33+
34+
## `UUID requestPayment(String payerAccountNumber, String payeeAccountNumber, BigDecimal amount, String purpose)`
35+
Sends a payment request from one account to another
36+
37+
## `getPaymentInfo`
38+
Retrieve payment information
39+
40+
41+
42+
## Reserve Functions
43+
44+
`addFundsToReserve(String fromAccount, String toReserve, decimal amount, String reference)`
1445
Sets aside an `amount` of funds from the account `fromAccount` into the reserve `toReserve`. The transaction reference used is the text `reference`.
1546

16-
### Withdraw Funds
17-
`withdrawFundsFromReserve(fromReserve, toAccount, amount, reference);`
1847

48+
`withdrawFundsFromReserve(fromReserve, toAccount, amount, reference);`
1949
Withdraws an `amount` of funds into the account `toAccount` from the reserve `fromReserve`. The transaction reference used is the text `reference`.
2050

2151
### Create Reserve Update
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ layout: page
55
nav_order: 4
66
---
77

8-
98
## Automation
10-
An entity created by a [customer] into their bank account. The automation is created from a PayScript from among the ones that have been deployed by [developers]. If the selected payscript uses a trigger type that requires [trigger parameters], those need to be specified as part of creating the automation. If the selected payscript defines [script parameters], those need to be specified as part of creating the automation.
9+
Automations are features powered by one or more PayScripts, which a [customer] can enable in their bank account. If the selected payscript uses a trigger type that requires [trigger parameters](), those need to be specified as part of creating the automation. If the selected payscript defines [script parameters], those need to be specified as part of creating the automation.
1110

1211
## Reserve
1312
An abstract segregation of funds in a customer's account with a name and a purpose, so that those funds can be considered unavailable for other purposes, effectively reserving them. Funds can be added to and removed from the reserve by the account owner, or by whoever the account owner has given [consent] to do this.
@@ -20,4 +19,5 @@ Balance: Allows seeing the balance of the owner
2019
Transactions: Allows making transactions on behalf of the owner
2120

2221
[customer]: /docs/quant_flow/personas#customer
23-
[developers]: /docs/quant_flow/personas#developer
22+
[developers]: /docs/quant_flow/personas#developer
23+
[trigger parameters]: /docs/payscript/triggers#parameters

docs/payscript/example_scripts/automated_transfer.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ layout: page
77
```groovy
88
trigger = "on_demand";
99
10-
1110
def payer = ${payer:scan};
1211
def payee = ${payee:scan};
1312
def amount = ${amount:decimal};

docs/payscript/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
title: Payscript
33
layout: page
4-
nav_order: 2
4+
nav_order: 4
55
---

docs/payscript/language_reference.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ layout: page
55
nav_order: 1
66
---
77

8-
## Payscript
8+
# Payscript
99
Payscript is a domain specific language (DSL) derived from Groovy. Using the Groovy syntax, with additional [built-in functions], it is able to cover the functionality needed to operate in the environment of a financial services provider.
1010

1111
For Syntax, this version does not differ from Groovy. please consult the [Groovy syntax reference][groovy syntax].
1212

13-
## Script Structure
13+
14+
### Script Structure
1415
PayScript has two special structures, beyond the programming logic; A [trigger] definition and [script parameters]. The trigger specifies what type of event will cause the script to run. When an automation is created with the script, the parameters of the trigger will be specified. For example, if the script's trigger type is "time", the parameters would be which date and time it should run on.
1516
Also during the creation of the automation, the script parameters required by the script will be supplied.
1617

17-
## Parameters
18+
### Script Parameters
1819
The script parameters are values which will be used by the script but will be specified by the customer who creates an automation which uses this script. At that time they will be prompted for the values, much like the trigger parameters.
19-
2020
Parameters are specified in the script using the following syntax:
2121

2222
```groovy
@@ -28,6 +28,21 @@ Where [parameter name] is to be replaced with the name of the parameter, as will
2828
## Logic
2929
The logic section contains what the script needs to accomplish, utilizing groovy logic and the payscript built-in functions.
3030

31+
## Concepts
32+
33+
### Automation
34+
Automations are features powered by one or more PayScripts, which a [customer] can enable in their bank account. If the selected payscript uses a trigger type that requires [trigger parameters](), those need to be specified as part of creating the automation. If the selected payscript defines [script parameters], those need to be specified as part of creating the automation.
35+
36+
### Reserve
37+
An abstract segregation of funds in a customer's account with a name and a purpose, so that those funds can be considered unavailable for other purposes, effectively reserving them. Funds can be added to and removed from the reserve by the account owner, or by whoever the account owner has given [consent] to do this.
38+
39+
## Consent
40+
Consent is given by a [customer] to another customer perform specific actions on their accounts. The types of consent that can be given are:
41+
Fund check: Allows checking if the owner has more available funds than a given amount
42+
Automations:
43+
Balance: Allows seeing the balance of the owner
44+
Transactions: Allows making transactions on behalf of the owner
45+
3146

3247
[groovy syntax]: https://groovy-lang.org/single-page-documentation.html
3348
[built-in functions]: built_in_functions

docs/quant_flow/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
title: Quant Flow
33
layout: page
4-
nav_order: 1
4+
nav_order: 2
55
---

docs/quant_flow/personas.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ nav_order: 1
55
parent: Quant Flow
66
---
77

8-
98
# Personas
109
The white label version of Quant Flow is designed for financial service providers such as banks. With that in mind, the following personas are referred to in this documentation as a generalisation of roles played in the product vision.
1110

@@ -16,6 +15,6 @@ The financial service provider which has adopted and implemented Quant Flow.
1615
The professional responsible for developing and managing PayScripts.
1716

1817
## Customer
19-
The Bank's end user, utilising the provided financial services powered by Quant Flow. In the Sandbox, customers do this by creating [Automations], while in a real implementation of Quant Flow the features can be made available in different ways.
18+
The Bank's end user, utilising the provided financial services powered by Quant Flow. In the Sandbox, customers do this by activating [Automations], while in a real implementation of Quant Flow the features can be made available in different ways.
2019

2120
[automations]: /docs/sandbox/automations

docs/sandbox/automations.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/tutorials/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
title: Tutorials
33
layout: page
4-
nav_order: 4
4+
nav_order: 5
55
---

0 commit comments

Comments
 (0)