Skip to content

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

Merged
merged 10 commits into from
Jul 25, 2023
Merged

persona api wrapper #221

merged 10 commits into from
Jul 25, 2023

Conversation

saito-sv
Copy link

@saito-sv saito-sv commented Jul 11, 2023

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 one persona_sandbox_a12e2d79-11f0-4470-b596-16d6e682123a

Tests

  • Unit Test run go test ./pkg/internal/persona/ -v
  • Integration Test run go test -tags=integration ./pkg/internal/persona/ -v

Copy link
Contributor

@auroter auroter left a 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)

Comment on lines +18 to +22
return &PersonaClient{
APIKey: apiKey,
BaseURL: "https://withpersona.com/api/",
Client: &http.Client{},
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Pending - The individual submitted a verification within the inquiry.
* Pending - The individual submitted one or more verifications within the inquiry.

@saito-sv saito-sv requested a review from auroter July 25, 2023 20:44
@saito-sv saito-sv merged commit 11d4800 into develop Jul 25, 2023
@saito-sv saito-sv deleted the task/marlon/STR-680 branch July 25, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants