Skip to content

Commit 7cbfe3c

Browse files
authored
Update DataCallback to Event-Based Structure (#698)
* Update DataCallback to event-based structure * leave main dataCallback file as is
1 parent 2b882af commit 7cbfe3c

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

docs/base-account/reference/prolink-utilities/decodeProlink.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ async function extractCallbacks(prolink: string) {
161161
const callback = decoded.capabilities.dataCallback;
162162
console.log('Callback URL:', callback.callbackURL);
163163
console.log('Events:', callback.events);
164+
// Events structure: [{ type: 'initiated', context: {...} }, ...]
165+
callback.events?.forEach(event => {
166+
console.log(`Event: ${event.type}`, event.context);
167+
});
164168
return callback;
165169
}
166170

docs/base-account/reference/prolink-utilities/encodeProlink.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ const prolink = await encodeProlink({
107107
capabilities: {
108108
dataCallback: {
109109
callbackURL: 'https://api.yourapp.com/webhook',
110-
events: ['initiated', 'postSign', 'confirmed']
110+
events: [
111+
{ type: 'initiated', context: { orderId: '123' } },
112+
{ type: 'postSign', context: { webhookTag: 'after' } }
113+
]
111114
}
112115
}
113116
});

0 commit comments

Comments
 (0)