ffc-pay-schemes 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +49 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -10,6 +10,55 @@ Module for defining and providing details for the payment schemes supported by t
10
10
  npm install --save ffc-pay-schemes
11
11
  ```
12
12
 
13
+ ## Available functions
14
+
15
+ ```js
16
+ const {
17
+ createInvoiceNumber,
18
+ createSplitInvoiceNumber,
19
+ getAccountCodeMap,
20
+ getSchemeBatchProperties,
21
+ getSchemeProperties,
22
+ getSchemes,
23
+ schemeDoesNotRequirePPAs,
24
+ schemeProvidesAccountingValues,
25
+ schemeIds
26
+ } = require('ffc-pay-schemes')
27
+ ```
28
+
29
+ - `getSchemes()` returns all supported schemes as an array of objects containing `schemeId` and `schemeName`.
30
+ - `getSchemeProperties(schemeId, sourceSystem, pillar)` returns the properties for a scheme. A scheme can be identified by its ID or source system. The optional `pillar` can be used for manual payments.
31
+ - `getSchemeBatchProperties(schemeId)` returns the batch processing properties for a given `schemeId`.
32
+ - `getAccountCodeMap(schemeId)` returns the account code mapping used for a given `schemeId`.
33
+ - `createInvoiceNumber(paymentRequest)` creates an invoice number for a given `paymentRequest`.
34
+ - `createSplitInvoiceNumber(paymentRequest)` creates a split invoice number for a given `paymentRequest`.
35
+ - `schemeDoesNotRequirePPAs(schemeId)` returns `true` if Payment Hub does not support Post Payment Adjustments (PPAs) for a given `schemeId`; otherwise, it returns `false`.
36
+ - `schemeProvidesAccountingValues(schemeId)` returns `true` if a given `schemeId` provides accounting values within its payment requests; otherwise, it returns `false`.
37
+ - `schemeIds` provides the constants for all supported scheme IDs.
38
+
39
+ ### Example
40
+
41
+ ```js
42
+ const {
43
+ getSchemes,
44
+ getSchemeProperties,
45
+ schemeDoesNotRequirePPAs,
46
+ schemeProvidesAccountingValues,
47
+ schemeIds
48
+ } = require('ffc-pay-schemes')
49
+
50
+ const schemes = getSchemes()
51
+ console.log(schemes)
52
+
53
+ const scheme = getSchemeProperties(schemeIds.BPS)
54
+ console.log(scheme)
55
+
56
+ const doesNotRequirePPAs = schemeDoesNotRequirePPAs(schemeIds.BPS)
57
+ const providesAccountingValues = schemeProvidesAccountingValues(schemeIds.BPS)
58
+
59
+ console.log({ doesNotRequirePPAs, providesAccountingValues })
60
+ ```
61
+
13
62
  ## Licence
14
63
 
15
64
  THIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffc-pay-schemes",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Module for defining and providing details for the payment schemes supported by the Payment Hub.",
5
5
  "main": "index.js",
6
6
  "scripts": {