-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from getyoti/development
Release 3.4.0
- Loading branch information
Showing
21 changed files
with
269 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{ template "header.html" .}} | ||
<div class="container"> | ||
<div class="row pt-4"> | ||
<div class="col"> | ||
<h1>Privacy Policy</h1> | ||
<p>Demo privacy policy</p> | ||
</div> | ||
</div> | ||
</div> | ||
{{ template "footer.html" .}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ package consts | |
|
||
const ( | ||
SDKIdentifier = "Go" | ||
SDKVersionIdentifier = "3.3.0" | ||
SDKVersionIdentifier = "3.4.0" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
docscan/sandbox/request/check/third_party_identity_check.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package check | ||
|
||
import "github.com/getyoti/yoti-go-sdk/v3/docscan/sandbox/request/check/report" | ||
|
||
// ThirdPartyIdentityCheck defines a sandbox check with a third party credit reporting agency | ||
type ThirdPartyIdentityCheck struct { | ||
*check | ||
} | ||
|
||
// ThirdPartyIdentityCheckBuilder builds a ThirdPartyIdentityCheck | ||
type ThirdPartyIdentityCheckBuilder struct { | ||
checkBuilder | ||
} | ||
|
||
// NewThirdPartyIdentityCheckBuilder creates a new ThirdPartyIdentityCheckBuilder | ||
func NewThirdPartyIdentityCheckBuilder() *ThirdPartyIdentityCheckBuilder { | ||
return &ThirdPartyIdentityCheckBuilder{} | ||
} | ||
|
||
// Build creates a new ThirdPartyIdentityCheck | ||
func (b *ThirdPartyIdentityCheckBuilder) Build() (*ThirdPartyIdentityCheck, error) { | ||
tpiCheck := ThirdPartyIdentityCheck{ | ||
check: b.checkBuilder.build(), | ||
} | ||
|
||
return &tpiCheck, nil | ||
} | ||
|
||
func (b *ThirdPartyIdentityCheckBuilder) WithBreakdown(breakdown *report.Breakdown) *ThirdPartyIdentityCheckBuilder { | ||
b.checkBuilder.withBreakdown(breakdown) | ||
return b | ||
} | ||
|
||
func (b *ThirdPartyIdentityCheckBuilder) WithRecommendation(recommendation *report.Recommendation) *ThirdPartyIdentityCheckBuilder { | ||
b.checkBuilder.withRecommendation(recommendation) | ||
return b | ||
} |
45 changes: 45 additions & 0 deletions
45
docscan/sandbox/request/check/third_party_identity_check_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package check | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
|
||
"github.com/getyoti/yoti-go-sdk/v3/docscan/sandbox/request/check/report" | ||
) | ||
|
||
func ExampleThirdPartyIdentityCheckBuilder() { | ||
breakdown, err := report.NewBreakdownBuilder(). | ||
WithResult("some_result"). | ||
WithSubCheck("some_check"). | ||
Build() | ||
if err != nil { | ||
fmt.Printf("error: %s", err.Error()) | ||
return | ||
} | ||
|
||
recommendation, err := report.NewRecommendationBuilder(). | ||
WithValue("some_value"). | ||
Build() | ||
if err != nil { | ||
fmt.Printf("error: %s", err.Error()) | ||
return | ||
} | ||
|
||
check, err := NewThirdPartyIdentityCheckBuilder(). | ||
WithBreakdown(breakdown). | ||
WithRecommendation(recommendation). | ||
Build() | ||
if err != nil { | ||
fmt.Printf("error: %s", err.Error()) | ||
return | ||
} | ||
|
||
data, err := json.Marshal(check) | ||
if err != nil { | ||
fmt.Printf("error: %s", err.Error()) | ||
return | ||
} | ||
|
||
fmt.Println(string(data)) | ||
// Output: {"result":{"report":{"recommendation":{"value":"some_value"},"breakdown":[{"sub_check":"some_check","result":"some_result","details":[]}]}}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package check | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/getyoti/yoti-go-sdk/v3/docscan/constants" | ||
) | ||
|
||
// RequestedThirdPartyIdentityCheck requests creation of a third party CRA check | ||
type RequestedThirdPartyIdentityCheck struct { | ||
config RequestedThirdPartyIdentityCheckConfig | ||
} | ||
|
||
// Type is the type of the requested check | ||
func (c *RequestedThirdPartyIdentityCheck) Type() string { | ||
return constants.ThirdPartyIdentityCheck | ||
} | ||
|
||
// Config is the configuration of the requested check | ||
func (c *RequestedThirdPartyIdentityCheck) Config() RequestedCheckConfig { | ||
return RequestedCheckConfig(c.config) | ||
} | ||
|
||
// MarshalJSON returns the JSON encoding | ||
func (c *RequestedThirdPartyIdentityCheck) MarshalJSON() ([]byte, error) { | ||
return json.Marshal(&struct { | ||
Type string `json:"type"` | ||
Config RequestedCheckConfig `json:"config,omitempty"` | ||
}{ | ||
Type: c.Type(), | ||
Config: c.Config(), | ||
}) | ||
} | ||
|
||
// RequestedThirdPartyIdentityCheckConfig is the configuration applied when creating | ||
// a third party identity check | ||
type RequestedThirdPartyIdentityCheckConfig struct { | ||
} | ||
|
||
// RequestedThirdPartyIdentityCheckBuilder builds a RequestedThirdPartyIdentityCheck | ||
type RequestedThirdPartyIdentityCheckBuilder struct { | ||
config RequestedThirdPartyIdentityCheckConfig | ||
} | ||
|
||
// NewRequestedThirdPartyIdentityCheckBuilder creates a new builder for RequestedThirdPartyIdentityCheck | ||
func NewRequestedThirdPartyIdentityCheckBuilder() *RequestedThirdPartyIdentityCheckBuilder { | ||
return &RequestedThirdPartyIdentityCheckBuilder{} | ||
} | ||
|
||
// Build builds te RequestedThirdPartyIdentityCheck | ||
func (b *RequestedThirdPartyIdentityCheckBuilder) Build() (*RequestedThirdPartyIdentityCheck, error) { | ||
return &RequestedThirdPartyIdentityCheck{ | ||
config: b.config, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package check | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
) | ||
|
||
func ExampleRequestedThirdPartyIdentityCheck() { | ||
thirdPartyCheck, err := NewRequestedThirdPartyIdentityCheckBuilder().Build() | ||
|
||
if err != nil { | ||
fmt.Printf("error: %s", err.Error()) | ||
return | ||
} | ||
|
||
data, err := json.Marshal(thirdPartyCheck) | ||
if err != nil { | ||
fmt.Printf("error: %s", err.Error()) | ||
return | ||
} | ||
|
||
fmt.Println(string(data)) | ||
// Output: {"type":"THIRD_PARTY_IDENTITY","config":{}} | ||
} |
Oops, something went wrong.