Skip to content

Commit

Permalink
Add version of search payout completed tx with pagination (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
beransantur authored Mar 20, 2024
1 parent f356e91 commit b7949c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ function createDate(days, hours, minutes, seconds) {
const request = {
settlementType: Craftgate.Model.SettlementType.SETTLEMENT,
startDate: createDate(-1, 0, 0, 0),
endDate: createDate(-1, 23, 59, 59)
endDate: createDate(-1, 23, 59, 59),
page: 0,
size: 10
};

craftgate.settlementReporting().searchPayoutCompletedTransactions(request)
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/SettlementReportingAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class SettlementReportingAdapter extends BaseAdapter {
}

async searchPayoutCompletedTransactions(request: SearchPayoutCompletedTransactionsRequest): Promise<PayoutCompletedTransactionListResponse> {
return this._client.get('/settlement-reporting/v1/settlement-file/payout-completed-transactions', request);
return this._client.get('/settlement-reporting/v2/settlement-file/payout-completed-transactions', request);
}

async searchBouncedPayoutTransactions(request: SearchPayoutBouncedTransactionsRequest): Promise<PayoutBouncedTransactionListResponse> {
Expand Down
2 changes: 2 additions & 0 deletions src/request/SearchPayoutCompletedTransactionsRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ type SearchPayoutCompletedTransactionsRequest = {
settlementType?: SettlementType;
endDate: Date;
startDate: Date;
page?: number;
size?: number;
};

export default SearchPayoutCompletedTransactionsRequest;
3 changes: 3 additions & 0 deletions src/response/PayoutCompletedTransactionListResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import PayoutCompletedTransaction from './dto/PayoutCompletedTransaction';

type PayoutCompletedTransactionListResponse = {
items: PayoutCompletedTransaction[];
page: number;
size: number;
totalSize: number;
};

export default PayoutCompletedTransactionListResponse;

0 comments on commit b7949c2

Please sign in to comment.