You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: adding callback server for peer-to-peer example (#18)
* feat: adding callback server for OP finish call
* feat(peer-to-peer): resolve interactRef in a promise
* feat(peer-to-peer): adding metadata description to payments
* chore(peer-to-peer): formatting & cleaning up
@@ -152,15 +158,14 @@ import readline from 'readline/promises'
152
158
]
153
159
},
154
160
interact: {
155
-
start: ['redirect']
156
-
// finish: {
157
-
// method: "redirect",
158
-
// // This is where you can (optionally) redirect a user to after going through interaction.
159
-
// // Keep in mind, you will need to parse the interact_ref in the resulting interaction URL,
160
-
// // and pass it into the grant continuation request.
161
-
// uri: "https://example.com",
162
-
// nonce: crypto.randomUUID(),
163
-
// },
161
+
start: ['redirect'],
162
+
finish: {
163
+
method: 'redirect',
164
+
// The uri is where the user is redirected to after going through interaction with their wallet/identity provider. For this example, we use a temporary HTTP server to handle the redirect.
165
+
uri: `http://localhost:${callbackServerPort}`,
166
+
// The nonce is used as part of hash verification when redirecting to the uri. Please visit https://openpayments.dev/identity/hash-verification/ for more details.
167
+
nonce: crypto.randomUUID()
168
+
}
164
169
}
165
170
}
166
171
)
@@ -174,6 +179,10 @@ import readline from 'readline/promises'
.question('\nPlease accept grant and press enter...')
@@ -184,10 +193,13 @@ import readline from 'readline/promises'
184
193
'\nThere was an error continuing the grant. You probably have not accepted the grant at the url (or it has already been used up, in which case, rerun the script).'
0 commit comments