Skip to content

Commit

Permalink
FromDate param missing for generate transaction report.Update allof f…
Browse files Browse the repository at this point in the history
…or report to anyOf.

Added missing FromDate Param in generate transaction report.
Updated allOf to anyof in report response
Get Report constraint fixes
Documentation updates:
get multiple statement (details)
clarify balance date values
  • Loading branch information
Jadavpadma committed Dec 19, 2024
1 parent 41f3145 commit c168975
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 57 deletions.
50 changes: 32 additions & 18 deletions openbanking-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ info:
name: API Support
email: apisupport@mastercard.com
url: 'https://developer.mastercard.com/open-banking-us/documentation/support/'
version: 1.21.2
version: 1.21.3
servers:
- url: 'https://api.finicity.com'
description: Production
Expand Down Expand Up @@ -521,7 +521,7 @@ paths:
This will delete access to the customer and all their linked accounts.
The customer data will no longer be accessible. Any customer data
already collected will be retained in accordance with our enterprise
data retention policy consistent with legal and business purposes.
data retention policy consistent with legal and business purposes.

⚠️ Use this service carefully! It will not pause for confirmation before
performing the operation!
Expand Down Expand Up @@ -2018,10 +2018,14 @@ paths:
get:
tags:
- Bank Statements
summary: Get Customer Account Multiple Statements
summary: Get Customer Account Multiple Statement Details
description: >-
This endpoint retrieves account statements for a given customer. The
maximum number of statements that can be returned is 24.
This endpoint retrieves details of the account statements available for
a given customer (up to a maximum of 24 statements).


Use the asset ID of the statement you are interested in to obtain the
statement report using Get Asset by Customer and ID.


_Supported regions_: ![🇺🇸](https://flagcdn.com/20x15/us.png)
Expand Down Expand Up @@ -2177,6 +2181,7 @@ paths:
parameters:
- $ref: '#/components/parameters/ReportCallbackUrlParameter'
- $ref: '#/components/parameters/CustomerIdParameter'
- $ref: '#/components/parameters/RequiredFromDateParameter'
- $ref: '#/components/parameters/RequiredToDateParameter'
- $ref: '#/components/parameters/IncludePendingParameter'
requestBody:
Expand Down Expand Up @@ -2721,6 +2726,10 @@ paths:
Retrieve a binary file for the given asset ID.


This is a premium service. The billable event is the successful download
of an asset.


_Supported regions_: ![🇺🇸](https://flagcdn.com/20x15/us.png)
operationId: GetAssetByCustomerID
parameters:
Expand All @@ -2742,12 +2751,12 @@ paths:
summary: Get Available Balance
description: >-
Retrieve the available and cleared account balances for a single account
in real-time directly from a financial institution.
in real-time directly from a financial institution.

You can define an additional query parameter `balance_cache_interval` to
specify the time interval of the last cached balance. This parameter is
used by the server to determine whether the cached balance is still
valid or if it needs to be refreshed.
valid or if it needs to be refreshed.



Expand Down Expand Up @@ -3617,7 +3626,7 @@ paths:
payment along with the supported payment instruction details. If the RTP
(Real Time Payment) value for “transferInEnabled” is true, then the
account can receive RTPs. If the value for “transferOutEnabled” is true,
then the account can send RTPs
then the account can send RTPs


Note: this is a premium service, billable per every successful API call.
Expand Down Expand Up @@ -16377,10 +16386,11 @@ components:
in: query
required: false
description:
Request statements with comma-separated indexes between 1-24. The
default value is 1 and it will return the most recent statement.
Increasing the index will return older statements, for example, setting
the index value to 6 will return the sixth most recent statement.
Request details of statements with comma-separated indexes between 1-24.
The default value is 1 which will return details of the most recent
statement. Increasing the index will return details of older statements,
for example, setting the index value to 6 will return data on the sixth
most recent statement.
schema:
type: string
default: '1'
Expand Down Expand Up @@ -20929,8 +20939,8 @@ components:
CustomerAccountBalanceDate:
type: integer
description: >-
A timestamp showing when the balance was captured. A date in Unix epoch
time (in seconds). See: [Handling Epoch Dates and
A timestamp showing when the balance was captured by the FI . A date in
Unix epoch time (in seconds). See: [Handling Epoch Dates and
Times](https://developer.mastercard.com/open-banking-us/documentation/codes-and-formats/).
format: int64
example: 1607450357
Expand Down Expand Up @@ -25584,7 +25594,7 @@ components:
- title
- type
- status
allOf:
anyOf:
- $ref: '#/components/schemas/AFBalanceAnalyticsReport'
- $ref: '#/components/schemas/AFCashFlowAnalyticsReport'
- $ref: '#/components/schemas/CashFlowReport'
Expand Down Expand Up @@ -26011,7 +26021,7 @@ components:

* `voieWithStatement`

* `paystatement`
* `paystatement`

* `preQualVoa`

Expand Down Expand Up @@ -27094,7 +27104,8 @@ components:
example: 100000
balanceDate:
type: integer
description: A timestamp showing when the balance was captured
description:
A timestamp showing when the balance was captured by the FI
format: int64
example: 1594676289
oldestTransactionDate:
Expand Down Expand Up @@ -27140,6 +27151,8 @@ components:
$ref: '#/components/schemas/ReportAccountIdsString'
fromDate:
$ref: '#/components/schemas/UnixDate'
toDate:
$ref: '#/components/schemas/UnixDate'
reportCustomFields:
$ref: '#/components/schemas/ReportCustomFields'
TransactionsReportConstraintsOut:
Expand Down Expand Up @@ -27559,7 +27572,8 @@ components:
example: 501.24
balanceDate:
type: integer
description: A timestamp showing when the balance was captured
description:
A timestamp showing when the balance was captured by the FI
format: int64
example: 1588350276
averageMonthlyBalance:
Expand Down
6 changes: 6 additions & 0 deletions tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@
<version>${mockito-core-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mastercard.openbanking.client.api;

import com.google.gson.JsonObject;
import com.mastercard.openbanking.client.ApiException;
import com.mastercard.openbanking.client.model.*;
import com.mastercard.openbanking.client.test.BaseTest;
Expand Down Expand Up @@ -211,8 +212,8 @@ void getStatementReportByConsumerOrCustomerTest() throws Exception {
// Create a report the first time
var constraints = new StatementReportConstraints()
.statementReportData(new StatementData()
.statementIndex(1)
.accountId(Long.valueOf(existingAccountId)));
.statementIndex(1)
.accountId(Long.valueOf(existingAccountId)));
var reportAck = bankStatementsApi.generateStatementReport(CUSTOMER_ID, constraints, null);
reportId = reportAck.getId();
}
Expand Down Expand Up @@ -268,7 +269,8 @@ void getTransactionsReportByConsumerOrCustomerTest() throws Exception {
if (reportId == null) {
// Create a report the first time
var toDate = LocalDateTime.now().toEpochSecond(UTC);
var reportAck = transactionsApi.generateTransactionsReport(CUSTOMER_ID, toDate, new TransactionsReportConstraints(), null, true);
var fromDate = LocalDateTime.now().minusYears(10).toEpochSecond(UTC);
var reportAck = transactionsApi.generateTransactionsReport(CUSTOMER_ID,fromDate, toDate, new TransactionsReportConstraints(), null, true);
reportId = reportAck.getId();
}
fetchReport(reportId, consumerId);
Expand Down Expand Up @@ -331,17 +333,97 @@ private static void fetchReport(String reportId, String consumerId) throws Excep
do {
System.out.println("Fetching report " + reportId + " by consumer ID ...");
Thread.sleep(5000);
var report = api.getReportByConsumer(consumerId, reportId, PURPOSE, ON_BEHALF_OF);
Report report = api.getReportByConsumer(consumerId, reportId, PURPOSE, ON_BEHALF_OF);
assertNotNull(report);
status = report.getStatus();
status = getReportStatus(report);
} while (NON_FINAL_STATUS.contains(status));
do {
System.out.println("Waiting for report " + reportId + " by customer ID ...");
Thread.sleep(5000);
var report = api.getReportByCustomer(CUSTOMER_ID, reportId, PURPOSE, ON_BEHALF_OF);
assertNotNull(report);
status = report.getStatus();
status = getReportStatus(report);
} while (NON_FINAL_STATUS.contains(status));
assertEquals(SUCCESS_STATUS, status, "Report status is: failure");
}



private static String getReportStatus(Report reportInstance) throws IllegalArgumentException {
System.out.println("reportInstance : "+reportInstance);
Object report = reportInstance.getActualInstance();
System.out.println("Report type while getReportStatus: " + report.getClass()+" END");
if (report instanceof CashFlowReport) {
return ((CashFlowReport) report).getStatus();
}

if (report instanceof PayStatementReport) {
return ((PayStatementReport) report).getStatus();
}

if (report instanceof PrequalificationReport) {
return ((PrequalificationReport) report).getStatus();
}

if (report instanceof StatementReport) {
return ((StatementReport) report).getStatus();
}

if (report instanceof TransactionsReport) {
return ((TransactionsReport) report).getStatus();
}

if (report instanceof VOAReport) {
return ((VOAReport) report).getStatus();
}

if (report instanceof VOAWithIncomeReport) {
return ((VOAWithIncomeReport) report).getStatus();
}

if (report instanceof VOEPayrollReport) {
return ((VOEPayrollReport) report).getStatus();
}

if (report instanceof VOETransactionsReport) {
return ((VOETransactionsReport) report).getStatus();
}

if (report instanceof VOIEPayrollReport) {
return ((VOIEPayrollReport) report).getStatus();
}

if (report instanceof VOIEPaystubReport) {
return ((VOIEPaystubReport) report).getStatus();
}

if (report instanceof VOIEPaystubWithTXVerifyReport) {
return ((VOIEPaystubWithTXVerifyReport) report).getStatus();
}

if (report instanceof VOIReport) {
return ((VOIReport) report).getStatus();
}

if (report instanceof AFBalanceAnalyticsReport) {
return ((AFBalanceAnalyticsReport) report).getStatus();
}

if (report instanceof AFCashFlowAnalyticsReport) {
return ((AFCashFlowAnalyticsReport) report).getStatus();
}












throw new IllegalArgumentException("Invalid report type"+report.getClass()+" END");
}
}
Loading

0 comments on commit c168975

Please sign in to comment.