-
Notifications
You must be signed in to change notification settings - Fork 0
persona api wrapper #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
persona api wrapper #221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the tests passed except for one:
=== RUN TestIntegrationCreateInquiry
persona_integration_test.go:50:
Error Trace: /Users/sean/dev/string/string-api/pkg/internal/persona/persona_integration_test.go:50
Error: Received unexpected error:
request failed with status code: 404
github.com/String-xyz/go-lib/v2/common.StringError
/Users/sean/go/pkg/mod/github.com/!string-xyz/go-lib/[email protected]/common/error.go:64
github.com/String-xyz/string-api/pkg/internal/persona.(*PersonaClient).CreateInquiry
/Users/sean/dev/string/string-api/pkg/internal/persona/inquiries.go:55
github.com/String-xyz/string-api/pkg/internal/persona.TestIntegrationCreateInquiry
/Users/sean/dev/string/string-api/pkg/internal/persona/persona_integration_test.go:49
testing.tRunner
/usr/local/go/src/testing/testing.go:1446
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1594
failed to create inquiry
github.com/String-xyz/go-lib/v2/common.StringError
/Users/sean/go/pkg/mod/github.com/!string-xyz/go-lib/[email protected]/common/error.go:64
github.com/String-xyz/string-api/pkg/internal/persona.(*PersonaClient).CreateInquiry
/Users/sean/dev/string/string-api/pkg/internal/persona/inquiries.go:55
github.com/String-xyz/string-api/pkg/internal/persona.TestIntegrationCreateInquiry
/Users/sean/dev/string/string-api/pkg/internal/persona/persona_integration_test.go:49
testing.tRunner
/usr/local/go/src/testing/testing.go:1446
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1594
Test: TestIntegrationCreateInquiry
persona_integration_test.go:51:
Error Trace: /Users/sean/dev/string/string-api/pkg/internal/persona/persona_integration_test.go:51
Error: Expected value not to be nil.
Test: TestIntegrationCreateInquiry
--- FAIL: TestIntegrationCreateInquiry (0.21s)
return &PersonaClient{ | ||
APIKey: apiKey, | ||
BaseURL: "https://withpersona.com/api/", | ||
Client: &http.Client{}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
return &PersonaClient{ | |
APIKey: apiKey, | |
BaseURL: "https://withpersona.com/api/", | |
Client: &http.Client{}, | |
} | |
return NewPersonaClient("https://withpersona.com/api/", apiKey, &http.Client{}) |
Check for the following statuses to determine whether the individual has finished the flow. | ||
|
||
* Created - The individual started the inquiry. | ||
* Pending - The individual submitted a verification within the inquiry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Pending - The individual submitted a verification within the inquiry. | |
* Pending - The individual submitted one or more verifications within the inquiry. |
Persona API Wrapper
This PR includes the bare minimum persona integration (accounts, inquiries and verifications)
Setup
Make sure to have a
PERSONA_API_KEY
in your.env
file. You can use this onepersona_sandbox_a12e2d79-11f0-4470-b596-16d6e682123a
Tests
go test ./pkg/internal/persona/ -v
go test -tags=integration ./pkg/internal/persona/ -v