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
@@ -138,7 +144,7 @@ The Client attempts to access a protected resource on the Server. Since no valid
138
144
log(
139
145
colors.magenta(
140
146
wordWrap(
141
-
"\n💡 The 'paymentToken' is a JWT signed by the Server, ensuring the integrity and authenticity of the payment request. The Client will include this token when requesting a receipt, along with the payment option id and metadata."
147
+
"\n💡 The 'paymentRequestToken' is a JWT signed by the Server, ensuring the integrity and authenticity of the payment request. The Client will include this token when requesting a receipt, along with the payment option id and metadata."
142
148
)
143
149
)
144
150
)
@@ -168,15 +174,15 @@ The Client attempts to access a protected resource on the Server. Since no valid
168
174
constpaymentResult=awaitperformStripePayment(
169
175
clientKeypairInfo,
170
176
selectedPaymentOption,
171
-
paymentToken
177
+
paymentRequestToken
172
178
)
173
179
receipt=paymentResult.receipt
174
180
details=paymentResult.details
175
181
}elseif(selectedPaymentOption.network===chainId){
176
182
constpaymentResult=awaitperformOnChainPayment(
177
183
clientKeypairInfo,
178
184
selectedPaymentOption,
179
-
paymentToken
185
+
paymentRequestToken
180
186
)
181
187
receipt=paymentResult.receipt
182
188
details=paymentResult.details
@@ -215,7 +221,7 @@ The Client Agent now retries the original request to the Server Agent, this time
215
221
216
222
${colors.bold("The Server Agent then performs its own verifications:")}
217
223
1. Validates the receipt's signature (ensuring it was issued by a trusted Receipt Service and hasn't been tampered with).
218
-
2. Checks the receipt's claims: Confirms the receipt is for the correct payment (e.g., matches the 'paymentToken' it originally issued), is not expired, and meets any other criteria for accessing the resource.
224
+
2. Checks the receipt's claims: Confirms the receipt is for the correct payment (e.g., matches the 'paymentRequestToken' it originally issued), is not expired, and meets any other criteria for accessing the resource.
219
225
220
226
If the receipt is valid, the Server grants access to the protected resource.`
221
227
)
@@ -262,7 +268,7 @@ If the receipt is valid, the Server grants access to the protected resource.`
@@ -346,11 +352,11 @@ The Client Agent now uses the details from the Payment Request to make the payme
346
352
colors.dim(
347
353
`${colors.bold("Client Agent 👤 -> Receipt Service 🧾")}
348
354
349
-
With the payment confirmed, the Client Agent now requests a formal, cryptographically verifiable payment receipt from the Receipt Service. The Client sends the original 'paymentToken' (received from the Server in Step 1) and the transaction hash (as metadata) to the Receipt Service. The Client also signs this request with its own DID to prove it's the one who made the payment.
355
+
With the payment confirmed, the Client Agent now requests a formal, cryptographically verifiable payment receipt from the Receipt Service. The Client sends the original 'paymentRequestToken' (received from the Server in Step 1) and the transaction hash (as metadata) to the Receipt Service. The Client also signs this request with its own DID to prove it's the one who made the payment.
350
356
351
357
${colors.bold("The Receipt Service then performs several crucial verifications:")}
352
-
1. Validates the 'paymentToken' (e.g., signature, expiry, ensuring it was issued by a trusted server for the expected payment context).
353
-
2. Verifies the on-chain transaction: Confirms that the transaction hash is valid, the correct amount of the specified currency was transferred to the correct recipient address as per the 'paymentToken'.
358
+
1. Validates the 'paymentRequestToken' (e.g., signature, expiry, ensuring it was issued by a trusted server for the expected payment context).
359
+
2. Verifies the on-chain transaction: Confirms that the transaction hash is valid, the correct amount of the specified currency was transferred to the correct recipient address as per the 'paymentRequestToken'.
354
360
3. Verifies the Client's signature on the request, ensuring the payer is who they claim to be (linking the payment action to the Client's DID).
355
361
356
362
If all checks pass, the Receipt Service issues a Verifiable Credential (VC) serving as the payment receipt.`
@@ -364,7 +370,7 @@ If all checks pass, the Receipt Service issues a Verifiable Credential (VC) serv
364
370
)
365
371
366
372
constpayload={
367
-
paymentToken,
373
+
paymentRequestToken,
368
374
paymentOptionId: paymentOption.id,
369
375
metadata: {
370
376
txHash: hash,
@@ -397,7 +403,7 @@ If all checks pass, the Receipt Service issues a Verifiable Credential (VC) serv
0 commit comments