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]>
23 lines
544 B
Go
23 lines
544 B
Go
package client_test
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
"net/http/httptest"
|
|
)
|
|
|
|
func authServer(accessToken string) *httptest.Server {
|
|
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Add("Content-Type", "application/json")
|
|
w.WriteHeader(http.StatusOK)
|
|
var res = struct {
|
|
AccessToken string `json:"access_token"`
|
|
TokenType string `json:"token_type"`
|
|
}{
|
|
AccessToken: accessToken,
|
|
TokenType: "Bearer",
|
|
}
|
|
json.NewEncoder(w).Encode(&res) //nolint: errcheck
|
|
}))
|
|
}
|