Skip to content
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

Sdk 2246 go retrieve session #282

Merged
merged 44 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0a7667c
SDK-2240:fixed multiple error vars
mehmet-yoti Jul 20, 2023
8825126
SDK-2246:go retrieve session
mehmet-yoti Aug 8, 2023
82b3fc9
SDK-2246:go retrieve session update
mehmet-yoti Aug 8, 2023
b326008
SDK-2246:Resolved Problems
mehmet-yoti Aug 22, 2023
c30c85b
SDK-2246:Resolved Problems
mehmet-yoti Aug 22, 2023
d0f8123
SDK-2246:update review changes
mehmet-yoti Aug 29, 2023
f0be59e
SDK-2246:removed buildDigitalIdentitySessionSpec
mehmet-yoti Aug 30, 2023
f6de789
Update digitalidentity/service_test.go
mehmet-yoti Aug 31, 2023
dc8aeb7
Update digitalidentity/share_session.go
mehmet-yoti Aug 31, 2023
3d92450
Update digital_identity_client.go
mehmet-yoti Aug 31, 2023
391b925
Update digital_identity_client.go
mehmet-yoti Aug 31, 2023
49a758c
SDK-2246 refactor needed changes
mehmet-yoti Sep 6, 2023
bdda8e4
SDK-2246 refactor needed changes
mehmet-yoti Sep 6, 2023
d011b02
Update digitalidentity/share_session.go
mehmet-yoti Sep 6, 2023
6f5d220
Update digitalidentity/share_session.go
mehmet-yoti Sep 6, 2023
8b2a670
Update digitalidentity/service.go
mehmet-yoti Sep 6, 2023
ade2267
Update digitalidentity/service.go
mehmet-yoti Sep 6, 2023
9fe3f6c
Update digital_identity_client.go
mehmet-yoti Sep 6, 2023
8c88429
Update digital_identity_client.go
mehmet-yoti Sep 6, 2023
4a9ff75
SDK-2246 refactor needed changes
mehmet-yoti Sep 6, 2023
ca50060
SDK-2246 update tests and httpstatus codes
mehmet-yoti Sep 8, 2023
787a94b
SDK-2246 update tests and httpstatus codes
mehmet-yoti Sep 8, 2023
198f704
SDK-2246 update tests and httpstatus codes
mehmet-yoti Sep 8, 2023
f86f324
Update digital_identity_client_test.go
mehmet-yoti Sep 14, 2023
fdce2b6
SDK-2226:refactor some code
mehmet-yoti Sep 14, 2023
95eb7c5
SDK-2226:refactor some code
mehmet-yoti Sep 19, 2023
3ddcb2c
SDK-2226:refactor some code
mehmet-yoti Sep 19, 2023
51f50dc
SDK-2246:refactoring
mehmet-yoti Sep 25, 2023
2591663
SDK-2246 bug fix on create session
mehmet-yoti Sep 25, 2023
565204d
SDK-2246 Cleared commented lines
mehmet-yoti Sep 26, 2023
0fa3553
SDK-2246 updated optional parameters
mehmet-yoti Sep 27, 2023
3321f3e
SDK-2246 updated optional parameters
mehmet-yoti Sep 27, 2023
c7d96fc
SDK-2246 updated optional parameters
mehmet-yoti Sep 27, 2023
c4c3290
SDK-2246 removed unnecessary files
mehmet-yoti Sep 27, 2023
004d711
SDK-2246 updated tests to match with optional values
mehmet-yoti Sep 27, 2023
edf368c
SDK-2246 add updated test file
mehmet-yoti Sep 27, 2023
9d43a02
SDK:2246 update sonar properties
mehmet-yoti Oct 6, 2023
d99947b
SDK:2246 update sonar properties
mehmet-yoti Oct 6, 2023
1c74f09
SDK-2246: added digitalidentity specific request and yotierr to handl…
Oct 11, 2023
aad8d97
SDK-2246:pr updates
mehmet-yoti Oct 12, 2023
75fe18e
Update digitalidentity/share_session_builder.go
mehmet-yoti Oct 13, 2023
6566ede
Update digitalidentity/yotierror/response.go
mehmet-yoti Oct 13, 2023
fba5a14
SDK-2246:updates for pr checks
mehmet-yoti Oct 13, 2023
0df76b0
SDK-2246:updates for pr checks
mehmet-yoti Oct 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added _examples/idv/idv
fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved
Binary file not shown.
30 changes: 15 additions & 15 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ func (mock *mockHTTPClient) Do(request *http.Request) (*http.Response, error) {
}

func TestNewClient(t *testing.T) {
key, readErr := os.ReadFile("./test/test-key.pem")
assert.NilError(t, readErr)
key, err := os.ReadFile("./test/test-key.pem")
assert.NilError(t, err)

_, err := NewClient("some-sdk-id", key)
_, err = NewClient("some-sdk-id", key)
assert.NilError(t, err)
}

Expand All @@ -48,11 +48,11 @@ func TestNewClient_KeyLoad_Failure(t *testing.T) {
}

func TestYotiClient_PerformAmlCheck(t *testing.T) {
key, readErr := os.ReadFile("./test/test-key.pem")
assert.NilError(t, readErr)
key, err := os.ReadFile("./test/test-key.pem")
assert.NilError(t, err)

client, clientErr := NewClient("some-sdk-id", key)
assert.NilError(t, clientErr)
client, err := NewClient("some-sdk-id", key)
assert.NilError(t, err)

client.HTTPClient = &mockHTTPClient{
do: func(*http.Request) (*http.Response, error) {
Expand All @@ -78,11 +78,11 @@ func TestYotiClient_PerformAmlCheck(t *testing.T) {
}

func TestYotiClient_CreateShareURL(t *testing.T) {
key, readErr := os.ReadFile("./test/test-key.pem")
assert.NilError(t, readErr)
key, err := os.ReadFile("./test/test-key.pem")
assert.NilError(t, err)

client, clientErr := NewClient("some-sdk-id", key)
assert.NilError(t, clientErr)
client, err := NewClient("some-sdk-id", key)
assert.NilError(t, err)

client.HTTPClient = &mockHTTPClient{
do: func(*http.Request) (*http.Response, error) {
Expand All @@ -93,11 +93,11 @@ func TestYotiClient_CreateShareURL(t *testing.T) {
},
}

policy, policyErr := (&dynamic.PolicyBuilder{}).WithFullName().WithWantedRememberMe().Build()
assert.NilError(t, policyErr)
policy, err := (&dynamic.PolicyBuilder{}).WithFullName().WithWantedRememberMe().Build()
assert.NilError(t, err)

scenario, scenarioErr := (&dynamic.ScenarioBuilder{}).WithPolicy(policy).Build()
assert.NilError(t, scenarioErr)
scenario, err := (&dynamic.ScenarioBuilder{}).WithPolicy(policy).Build()
assert.NilError(t, err)

result, err := client.CreateShareURL(&scenario)
assert.NilError(t, err)
Expand Down
17 changes: 11 additions & 6 deletions digital_identity_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"github.com/getyoti/yoti-go-sdk/v3/requests"
)

const DefaultURL = "https://api.yoti.com/api/"
const DefaultURL = "https://api.yoti.com/share/"

// DigitalIdentityClient represents a client that can communicate with yoti and return information about Yoti users.
type DigitalIdentityClient struct {
Expand All @@ -27,14 +27,14 @@
}

// NewDigitalIdentityClient constructs a Client object
func NewDigitalIdentityClient(sdkID string, key []byte) (*Client, error) {
func NewDigitalIdentityClient(sdkID string, key []byte) (*DigitalIdentityClient, error) {
decodedKey, err := cryptoutil.ParseRSAKey(key)

if err != nil {
return nil, err
}

return &Client{
return &DigitalIdentityClient{
SdkID: sdkID,
Key: decodedKey,
}, err
Expand All @@ -54,15 +54,20 @@
return value
}

return apiDefaultURL
return DefaultURL
}

// GetSdkID gets the Client SDK ID attached to this client instance
func (client *DigitalIdentityClient) GetSdkID() string {
return client.SdkID
}

// CreateShareURL creates a QR code for a specified share session configuration.
func (client *DigitalIdentityClient) CreateShareURL(shareSession *digitalidentity.ShareSession) (share digitalidentity.ShareURL, err error) {
// CreateShareSession creates a sharing session to initiate a sharing process based on a policy
func (client *DigitalIdentityClient) CreateShareSession(shareSession digitalidentity.ShareSessionRequest) (share digitalidentity.ShareSession, err error) {
fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved
return digitalidentity.CreateShareSession(client.HTTPClient, shareSession, client.GetSdkID(), client.getAPIURL(), client.Key)
}

// GetShareSession retrieves the sharing session.
mehmet-yoti marked this conversation as resolved.
Show resolved Hide resolved
func (client *DigitalIdentityClient) GetSession(sessionID string) (shareSession *digitalidentity.ShareSession, err error) {
mehmet-yoti marked this conversation as resolved.
Show resolved Hide resolved
return digitalidentity.GetSession(client.HTTPClient, sessionID, client.GetSdkID(), client.getAPIURL(), client.Key)

Check failure on line 72 in digital_identity_client.go

View workflow job for this annotation

GitHub Actions / Sonar Scan

cannot use digitalidentity.GetSession(client.HTTPClient, sessionID, client.GetSdkID(), client.getAPIURL(), client.Key) (value of type digitalidentity.ShareSession) as type *digitalidentity.ShareSession in return statement
}
65 changes: 49 additions & 16 deletions digital_identity_client_test.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
package yoti

import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"strings"
"testing"

"github.com/getyoti/yoti-go-sdk/v3/dynamic"
"github.com/getyoti/yoti-go-sdk/v3/digitalidentity"
"gotest.tools/v3/assert"
)

func TestDigitalIDClient(t *testing.T) {
key, readErr := os.ReadFile("./test/test-key.pem")
assert.NilError(t, readErr)
key, err := os.ReadFile("./test/test-key.pem")
assert.NilError(t, err)

_, err := NewDigitalIdentityClient("some-sdk-id", key)
_, err = NewDigitalIdentityClient("some-sdk-id", key)
assert.NilError(t, err)
}

Expand All @@ -33,29 +35,60 @@ func TestDigitalIDClient_KeyLoad_Failure(t *testing.T) {
assert.Check(t, !temporary || !tempError.Temporary())
}

func TestDigitalIDClient_CreateShareURL(t *testing.T) {
key, readErr := os.ReadFile("./test/test-key.pem")
assert.NilError(t, readErr)
func TestYotiClient_CreateShareSession(t *testing.T) {
key, err := os.ReadFile("./test/test-key.pem")
assert.NilError(t, err)

client, clientErr := NewDigitalIdentityClient("some-sdk-id", key)
assert.NilError(t, clientErr)
client, err := NewDigitalIdentityClient("some-sdk-id", key)
assert.NilError(t, err)

client.HTTPClient = &mockHTTPClient{
do: func(*http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 201,
Body: io.NopCloser(strings.NewReader(`{"qrcode":"https://code.yoti.com/some-qr","ref_id":"0"}`)),
Body: io.NopCloser(strings.NewReader(`{"id":"SOME_ID","status":"SOME_STATUS","expiry":"SOME_EXPIRY","created":"SOME_CREATED","updated":"SOME_UPDATED","qrCode":{"id":"SOME_QRCODE_ID"},"receipt":{"id":"SOME_RECEIPT_ID"}}`)),
}, nil
},
}

policy, policyErr := (&dynamic.PolicyBuilder{}).WithFullName().WithWantedRememberMe().Build()
assert.NilError(t, policyErr)
policy, err := (&digitalidentity.PolicyBuilder{}).WithFullName().WithWantedRememberMe().Build()
fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved
assert.NilError(t, err)

session, err := (&digitalidentity.ShareSessionBuilder{}).WithPolicy(policy).Build()
assert.NilError(t, err)

result, err := client.CreateShareSession(session)

scenario, scenarioErr := (&dynamic.ScenarioBuilder{}).WithPolicy(policy).Build()
assert.NilError(t, scenarioErr)
b, err := json.Marshal(result)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(b))
fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved

result, err := client.CreateShareURL(&scenario)
assert.NilError(t, err)
assert.Equal(t, result.ShareURL, "https://code.yoti.com/some-qr")
assert.Equal(t, result.Status, "SOME_STATUS")
}

func TestDigitalIDClient_HttpFailure_ReturnsApplicationNotFound(t *testing.T) {
key := getValidKey()

client := DigitalIdentityClient{
HTTPClient: &mockHTTPClient{
do: func(*http.Request) (*http.Response, error) {
return &http.Response{
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that the way the errors are returned changed so now they will be:

{ "id": "52f6a70a61191b6ad772e3c2bb875e5a", "status": 401, "error": "INVALID_REQUEST_SIGNATURE", "message": "Invalid request signature" }

so we will have to handle it differently here: https://github.com/getyoti/yoti-go-sdk/blob/master/requests/request.go#L19
as it's not the same yotierror format.
Share V2 links to this https://lampkicking.atlassian.net/wiki/spaces/CON/pages/443252751/Error+Handling+System
So it's worth checking with the other SDK teams to ask for more info.

StatusCode: 404,
}, nil
},
},
Key: key,
}

_, err := client.GetSession("SOME ID")
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add a success test case for this too


assert.ErrorContains(t, err, "Application was not found")
tempError, temporary := err.(interface {
Temporary() bool
})
assert.Check(t, !temporary || !tempError.Temporary())
Copy link
Contributor

Choose a reason for hiding this comment

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

please add extensive testing as in client_test.go and also add the test for Retrieving a session

}
48 changes: 42 additions & 6 deletions digitalidentity/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ import (
"github.com/getyoti/yoti-go-sdk/v3/yotierror"
)

const identitySesssionCreationEndpoint = "/v2/sessions"
const identitySesssionCreationEndpoint = "v2/sessions"
mehmet-yoti marked this conversation as resolved.
Show resolved Hide resolved
const identitySessionRetrieval = "v2/sessions/%s"

// SessionResult contains the information about a created session
type SessionResult struct {

/*type SessionResult struct {
fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved
Id int `json:"id"`
Status string `json:"status"`
Expiry string `json:"expiry"`
}
*/
klaidas marked this conversation as resolved.
Show resolved Hide resolved

// CreateShareSession creates session using the supplied session specification
func CreateShareSession(httpClient requests.HttpClient, shareSession *ShareSession, clientSdkId, apiUrl string, key *rsa.PrivateKey) (share ShareURL, err error) {
func CreateShareSession(httpClient requests.HttpClient, shareSessionRequest ShareSessionRequest, clientSdkId, apiUrl string, key *rsa.PrivateKey) (share ShareSession, err error) {
fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved
endpoint := identitySesssionCreationEndpoint

payload, err := shareSession.MarshalJSON()
payload, err := shareSessionRequest.MarshalJSON()
if err != nil {
return share, err
}
Expand All @@ -33,14 +36,47 @@ func CreateShareSession(httpClient requests.HttpClient, shareSession *ShareSessi
HTTPMethod: http.MethodPost,
BaseURL: apiUrl,
Endpoint: endpoint,
Headers: nil,
Headers: requests.AuthHeader(clientSdkId),
Body: payload,
}.Request()
if err != nil {
return share, err
}

response, err := requests.Execute(httpClient, request, ShareURLHTTPErrorMessages, yotierror.DefaultHTTPErrorMessages)
response, err := requests.Execute(httpClient, request, ShareSessionHTTPErrorMessages, yotierror.DefaultHTTPErrorMessages)
if err != nil {
return share, err
}

defer response.Body.Close()

responseBytes, err := io.ReadAll(response.Body)
if err != nil {
return share, err
}

err = json.Unmarshal(responseBytes, &share)

return share, err
}

// GetSession get session info using the supplied sessionID
func GetSession(httpClient requests.HttpClient, sessionID string, clientSdkId, apiUrl string, key *rsa.PrivateKey) (share ShareSession, err error) {
endpoint := identitySesssionCreationEndpoint
fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved
mehmet-yoti marked this conversation as resolved.
Show resolved Hide resolved
headers := requests.AuthHeader(clientSdkId)
request, err := requests.SignedRequest{
Key: key,
HTTPMethod: http.MethodGet,
BaseURL: apiUrl,
Endpoint: endpoint,
Headers: headers,
fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved
}.Request()
if err != nil {
return share, err
}

fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved
response, err := requests.Execute(httpClient, request, ShareSessionHTTPErrorMessages, yotierror.DefaultHTTPErrorMessages)
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think we need to update this requests package to support the error codes connect send back, some of these are really useful and we should differentiate between them and give the RP an exported error var they can switch on and handle.

e.g. from looking at this 404 UNKNOWN_SESSION is invalid session id which would be useful for a RP to know when integrating with sdk, as opposed to the ShareSessionHTTPErrorMessages where 404 is mapped to Application was not found?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@mehmet-yoti are you still working on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I am doing some changes on that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i don't see the changes for this from the newest commits @mehmet-yoti - feel free to ping me on slack if you wanna chat about it abit quicker


if err != nil {
return share, err
}
Expand Down
36 changes: 29 additions & 7 deletions digitalidentity/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
do: func(*http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 201,
Body: io.NopCloser(strings.NewReader(`{"qrcode":"https://code.yoti.com/CAEaJDQzNzllZDc0LTU0YjItNDkxMy04OTE4LTExYzM2ZDU2OTU3ZDAC","ref_id":"0"}`)),
Body: io.NopCloser(strings.NewReader(`{"id":"0","status":"success","expiry": ""}`)),
}, nil
},
}
Expand All @@ -46,19 +46,19 @@
return
}

result, err := CreateShareSession(client, &session, "sdkId", "https://apiurl", key)
result, err := CreateShareSession(client, session, "sdkId", "https://apiurl", key)

if err != nil {
fmt.Printf("error: %s", err.Error())
return
}

fmt.Printf("QR code: %s", result.ShareURL)
// Output: QR code: https://code.yoti.com/CAEaJDQzNzllZDc0LTU0YjItNDkxMy04OTE4LTExYzM2ZDU2OTU3ZDAC
fmt.Printf("Status code: %s", result.Status)
// Output: Status code: success
}

func TestCreateShareURL_Unsuccessful_503(t *testing.T) {
_, err := createShareUrlWithErrorResponse(503, "some service unavailable response")

Check failure on line 61 in digitalidentity/service_test.go

View workflow job for this annotation

GitHub Actions / Sonar Scan

undefined: createShareUrlWithErrorResponse

assert.ErrorContains(t, err, "503: unknown HTTP error - some service unavailable response")

Expand All @@ -69,7 +69,7 @@
}

func TestCreateShareURL_Unsuccessful_404(t *testing.T) {
_, err := createShareUrlWithErrorResponse(404, "some not found response")

Check failure on line 72 in digitalidentity/service_test.go

View workflow job for this annotation

GitHub Actions / Sonar Scan

undefined: createShareUrlWithErrorResponse

assert.ErrorContains(t, err, "404: Application was not found - some not found response")

Expand All @@ -80,7 +80,7 @@
}

func TestCreateShareURL_Unsuccessful_400(t *testing.T) {
_, err := createShareUrlWithErrorResponse(400, "some invalid JSON response")

Check failure on line 83 in digitalidentity/service_test.go

View workflow job for this annotation

GitHub Actions / Sonar Scan

undefined: createShareUrlWithErrorResponse

assert.ErrorContains(t, err, "400: JSON is incorrect, contains invalid data - some invalid JSON response")

Expand All @@ -90,7 +90,7 @@
assert.Check(t, !temporary || !tempError.Temporary())
}

func createShareUrlWithErrorResponse(statusCode int, responseBody string) (share ShareURL, err error) {
func createShareSessionWithErrorResponse(statusCode int, responseBody string) (share *ShareSession, err error) {
key := test.GetValidKey("../test/test-key.pem")

client := &mockHTTPClient{
Expand All @@ -106,10 +106,32 @@
if err != nil {
return
}
scenario, err := (&ShareSessionBuilder{}).WithPolicy(policy).Build()
session, err := (&ShareSessionBuilder{}).WithPolicy(policy).Build()
if err != nil {
return
}

return CreateShareSession(client, &scenario, "sdkId", "https://apiurl", key)
return CreateShareSession(client, session, "sdkId", "https://apiurl", key)

Check failure on line 114 in digitalidentity/service_test.go

View workflow job for this annotation

GitHub Actions / Sonar Scan

cannot use CreateShareSession(client, session, "sdkId", "https://apiurl", key) (value of type ShareSession) as type *ShareSession in return statement
}

func ExampleGetSession() {
key := test.GetValidKey("../test/test-key.pem")
mockSessionID := "SOME_SESSION_ID"
mockClientSdkId := "SOME_CLIENT_SDK_ID"
mockApiUrl := "https://example.com/api"
client := &mockHTTPClient{
do: func(*http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 201,
Body: io.NopCloser(strings.NewReader(`{"id":"SOME_ID","status":"SOME_STATUS","expiry":"SOME_EXPIRY","created":"SOME_CREATED","updated":"SOME_UPDATED","qrCode":{"id":"SOME_QRCODE_ID"},"receipt":{"id":"SOME_RECEIPT_ID"}}`)),
}, nil
},
}

result, err := GetSession(client, mockSessionID, mockClientSdkId, mockApiUrl, key)
if err != nil {
return
klaidas marked this conversation as resolved.
Show resolved Hide resolved
}
fmt.Printf("Status code: %s", result.Status)
// Output:Status code: SOME_STATUS
}
31 changes: 31 additions & 0 deletions digitalidentity/share_session.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package digitalidentity

var (
// ShareURLHTTPErrorMessages specifies the HTTP error status codes used
// by the Share URL API
mehmet-yoti marked this conversation as resolved.
Show resolved Hide resolved
ShareSessionHTTPErrorMessages = map[int]string{
400: "JSON is incorrect, contains invalid data",
404: "Application was not found",
}
)

// ShareSession object
mehmet-yoti marked this conversation as resolved.
Show resolved Hide resolved
type ShareSession struct {
Id string `json:"id"`
Status string `json:"status"`
Expiry string `json:"expiry"`
Created string `json:"created"`
Updated string `json:"updated"`
QrCode qrCode `json:"qrCode"`
Copy link
Contributor

Choose a reason for hiding this comment

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

should be a pointer

Receipt *receipt `json:"receipt"`
}

// ShareSession contains QR code as string
fofiuiancu marked this conversation as resolved.
Show resolved Hide resolved
type qrCode struct {
Id string `json:"id"`
}

// receipt containing the receipt id as a string.
type receipt struct {
Id string `json:"id"`
}
Loading
Loading