fintecture-client
Advanced tools
Comparing version 2.4.0 to 2.5.0
@@ -10,2 +10,5 @@ # Changelog | ||
- prettier formatting | ||
- fix type error on amount field on README.md | ||
- fix type error on amount field on README.md | ||
# [2.5.0] - 2024-11-12 | ||
- feat: Add support for payment_methods to Connect API |
{ | ||
"name": "fintecture-client", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "Fintecture Open Banking API Gateway enabling secure bank connections and payments", | ||
@@ -38,3 +38,3 @@ "main": "lib/fintecture-client.js", | ||
"coverage": "nyc -r text -r lcov -r text-summary -e .ts npm run test", | ||
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", | ||
"format": "prettier --write \"src/**/*.ts\"", | ||
"lint": "eslint -c .eslintrc.json --ext .ts src" | ||
@@ -41,0 +41,0 @@ }, |
@@ -158,2 +158,7 @@ "use strict"; | ||
}; | ||
if (Array.isArray(payment.payment_methods) && payment.payment_methods.length > 0) { | ||
meta.payment_methods = payment.payment_methods.map((payment_method, index) => { | ||
return { id: payment_method, order: index }; | ||
}); | ||
} | ||
const data = { | ||
@@ -160,0 +165,0 @@ type: 'SEPA', |
@@ -87,3 +87,8 @@ import { ISessionPayload } from '../pis/PisInterface'; | ||
expiry?: string | number; | ||
payment_methods?: IPaymentMethod[]; | ||
} | ||
export interface IPaymentMethod { | ||
id: 'immediate_transfer' | 'smart_transfer' | 'bnpl'; | ||
order?: number; | ||
} | ||
export interface IAddress { | ||
@@ -90,0 +95,0 @@ name: string; |
{ | ||
"name": "fintecture-client", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "Fintecture Open Banking API Gateway enabling secure bank connections and payments", | ||
@@ -38,3 +38,3 @@ "main": "lib/fintecture-client.js", | ||
"coverage": "nyc -r text -r lcov -r text-summary -e .ts npm run test", | ||
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", | ||
"format": "prettier --write \"src/**/*.ts\"", | ||
"lint": "eslint -c .eslintrc.json --ext .ts src" | ||
@@ -41,0 +41,0 @@ }, |
136
README.md
@@ -21,8 +21,8 @@ # Fintecture | ||
- First Steps | ||
- Use Cases | ||
- AIS without Connect | ||
- AIS with Connect | ||
- PIS without Connect | ||
- PIS with Connect | ||
- First Steps | ||
- Use Cases | ||
- AIS without Connect | ||
- AIS with Connect | ||
- PIS without Connect | ||
- PIS with Connect | ||
@@ -39,9 +39,8 @@ ### Get Started | ||
let client = new FintectureClient({ | ||
app_id: process.env.APP_ID | ||
,app_secret: process.env.APP_SECRET | ||
,private_key: process.env.APP_PRIV_KEY | ||
,env: process.env.FINTECTURE_ENV | ||
}); | ||
let client = new FintectureClient({ | ||
app_id: process.env.APP_ID, | ||
app_secret: process.env.APP_SECRET, | ||
private_key: process.env.APP_PRIV_KEY, | ||
env: process.env.FINTECTURE_ENV, | ||
}); | ||
``` | ||
@@ -60,3 +59,9 @@ | ||
```javascript | ||
let options = {'filter[ais]': 'accounts', 'filter[country]': 'FR', 'filter[psu_type]': 'retail', 'filter[auth_model]': 'redirect', 'sort[full_name]': 'asc'} | ||
let options = { | ||
'filter[ais]': 'accounts', | ||
'filter[country]': 'FR', | ||
'filter[psu_type]': 'retail', | ||
'filter[auth_model]': 'redirect', | ||
'sort[full_name]': 'asc', | ||
}; | ||
let providers = await client.getProviders(options); | ||
@@ -83,3 +88,3 @@ ``` | ||
let account = accounts.data[0].id | ||
let account = accounts.data[0].id; | ||
let transactions = await client.getTransactions(accessToken, customerId, account); | ||
@@ -92,7 +97,12 @@ ``` | ||
1. Select a Bank | ||
```javascript | ||
let options = {'filter[ais]': 'accounts', 'filter[country]': 'FR', 'filter[psu_type]': 'retail', 'filter[auth_model]': 'decoupled', 'sort[full_name]': 'asc'} | ||
let options = { | ||
'filter[ais]': 'accounts', | ||
'filter[country]': 'FR', | ||
'filter[psu_type]': 'retail', | ||
'filter[auth_model]': 'decoupled', | ||
'sort[full_name]': 'asc', | ||
}; | ||
let providers = await client.getProviders(options); | ||
@@ -134,3 +144,3 @@ ``` | ||
let account = accounts.data[0].id | ||
let account = accounts.data[0].id; | ||
let transactions = await client.getTransactions(accessToken, customerId, account); | ||
@@ -147,9 +157,9 @@ ``` | ||
let config = { | ||
redirect_uri: 'https://mysite.com/callback', | ||
state: "thisisastate", | ||
psu_type: 'retail', | ||
country: 'fr' | ||
} | ||
redirect_uri: 'https://mysite.com/callback', | ||
state: 'thisisastate', | ||
psu_type: 'retail', | ||
country: 'fr', | ||
}; | ||
let connect = await client.getAisConnect(null, config) | ||
let connect = await client.getAisConnect(null, config); | ||
window.href.location = connect.url; | ||
@@ -177,3 +187,8 @@ ``` | ||
```javascript | ||
let options = {'filter[pis]': 'SEPA', 'filter[country]': 'FR', 'filter[psu_type]': 'retail', 'sort[full_name]': 'asc'} | ||
let options = { | ||
'filter[pis]': 'SEPA', | ||
'filter[country]': 'FR', | ||
'filter[psu_type]': 'retail', | ||
'sort[full_name]': 'asc', | ||
}; | ||
let providers = await client.getProviders(options); | ||
@@ -192,18 +207,18 @@ ``` | ||
let payment = { | ||
data: { | ||
type: "PIS", | ||
attributes: { | ||
amount: "1", | ||
currency: "EUR", | ||
communication: "Thanks Mom!", | ||
beneficiary : { | ||
name : "Bob Smith", | ||
address : "8 road of somewhere, 80330 Lisboa", | ||
country : "ES", | ||
iban : "PT07BARC20325388680799", | ||
swift_bic: "DEUTPTFF" | ||
} | ||
} | ||
} | ||
} | ||
data: { | ||
type: 'PIS', | ||
attributes: { | ||
amount: '1', | ||
currency: 'EUR', | ||
communication: 'Thanks Mom!', | ||
beneficiary: { | ||
name: 'Bob Smith', | ||
address: '8 road of somewhere, 80330 Lisboa', | ||
country: 'ES', | ||
iban: 'PT07BARC20325388680799', | ||
swift_bic: 'DEUTPTFF', | ||
}, | ||
}, | ||
}, | ||
}; | ||
@@ -213,3 +228,2 @@ let response = await client.paymentInitiate(accessToken, providerId, payment, redirectUri, state); | ||
#### PIS with Connect | ||
@@ -221,3 +235,3 @@ | ||
let connectConfig = { | ||
amount: "125", | ||
amount: '125', | ||
currency: 'EUR', | ||
@@ -228,3 +242,3 @@ communication: 'Thanks mom!', | ||
customer_ip: '127.0.0.1', | ||
state: 'somestate' | ||
state: 'somestate', | ||
}; | ||
@@ -238,17 +252,19 @@ | ||
let payment = await client.getPayments(token.access_token, connect.session_id); | ||
console.log("PAYMENT STATUS:", payment.meta.status); | ||
console.log('PAYMENT STATUS:', payment.meta.status); | ||
``` | ||
Description of Connect fields: | ||
* amount: [mandatory] The amount of the payment initiation request. Min 1.00 and Max is variable based on bank's policy. | ||
* currency: [mandatory] The currency of the payment initiation request. Currently, only EUR and GBP is supported. | ||
* communication: [optional] A message sent to the beneficiary of the payment and visible on his bank statement. In the context of ecommerce payment collection, the order reference is inputted here. | ||
* customer_full_name: [mandatory] the full name of the payer | ||
* customer_email: [mandatory] the email of the payer | ||
* customer_ip: [mandatory] the ip address of the payer | ||
* redirect_uri: [optional] the callback URL to which the customer is redirected after authentication with his bank | ||
* origin_uri: [optional] a URL to which the customer will be redirected if he wants to exit Fintecture Connect | ||
* state: [mandatory] A state parameter which is sent back on callback. In the context of ecommerce, input the order ID here. | ||
- amount: [mandatory] The amount of the payment initiation request. Min 1.00 and Max is variable based on bank's policy. | ||
- currency: [mandatory] The currency of the payment initiation request. Currently, only EUR and GBP is supported. | ||
- communication: [optional] A message sent to the beneficiary of the payment and visible on his bank statement. In the context of ecommerce payment collection, the order reference is inputted here. | ||
- customer_full_name: [mandatory] the full name of the payer | ||
- customer_email: [mandatory] the email of the payer | ||
- customer_ip: [mandatory] the ip address of the payer | ||
- redirect_uri: [optional] the callback URL to which the customer is redirected after authentication with his bank | ||
- origin_uri: [optional] a URL to which the customer will be redirected if he wants to exit Fintecture Connect | ||
- state: [mandatory] A state parameter which is sent back on callback. In the context of ecommerce, input the order ID here. | ||
- expiry: [optional] The time in seconds which the link is valid before it expires (Default: no expiry) | ||
- payment_methods: [optional] A list of payment methods to be added to the selector on Connect. Example: ['immediate_transfer', 'smart_transfer']. Available values can be found on [docs](https://doc.fintecture.com/reference/createpisv2connect) in meta section. | ||
## Pagination | ||
@@ -259,15 +275,11 @@ | ||
```javascript | ||
let transactionsPages = []; | ||
let transactions = await client.getTransactions(accessToken, customerId, accountId, headers); | ||
transactionsPages.push(transactions) | ||
transactionsPages.push(transactions); | ||
while (transactions.links.next) { | ||
transactions = await client.getTransactions(accessToken, customerId, accountId, headers,transactions.links.next) ; | ||
transactionsPages.push(transactions); | ||
transactions = await client.getTransactions(accessToken, customerId, accountId, headers, transactions.links.next); | ||
transactionsPages.push(transactions); | ||
} | ||
``` | ||
@@ -274,0 +286,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
284
186631
89
2735