mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* Update connector template and CONTRIBUTING.md * Bootstrap Banking Bridge Connector * Update oauth config for banking bridge connector * Parse ISO20022 transaction code * Determine payment status * Update client implementation * Implement FetchNext functions for banking bridge * Ensure plugin is loaded and payments is scheduled workflow * Add tests for SEPA credit transfers * Remove unused file * Fallback on last seen imported at in cases where cursor not populated * Run pre-commit * Truncate expected timestamps in tests * Add metadata prefix * Improve code coverage for banking bridge client * Address review comments * Add application scope to auth request * Add fallbacks if bank transction code is not available * Fix metadata format * chore(bankingBridge): Move connector to ee * chore(bankingBridge): Add forgotten generated stuff * fix linting * fix: force UTC on importedAt, applying suggestion from @coderabbitai[bot] Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: ensure we're converting importedAt to UTC --------- Co-authored-by: Quentin David <[email protected]> Co-authored-by: fguery <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: fabrice guery <[email protected]>
27 lines
626 B
Go
27 lines
626 B
Go
package client
|
|
|
|
import (
|
|
"fmt"
|
|
"net/url"
|
|
"strconv"
|
|
)
|
|
|
|
var queryTemplate = `{"$gt":{"importedAt":"%s"}}`
|
|
|
|
func RawQuery(v url.Values, pageSize int, cursor string, importedAt string) string {
|
|
v.Add("pageSize", strconv.Itoa(pageSize))
|
|
|
|
// rely on cursor if present
|
|
if cursor != "" {
|
|
v.Add("cursor", cursor)
|
|
}
|
|
|
|
// in cases where we had less than a page we no longer have a cursor: so we rely on the last known
|
|
// import time to avoid starting again from the beginning of time
|
|
if cursor == "" && importedAt != "" {
|
|
queryStr := fmt.Sprintf(queryTemplate, importedAt)
|
|
v.Add("query", queryStr)
|
|
}
|
|
return v.Encode()
|
|
}
|