Skip to content

Commit 673107e

Browse files
fix: do not request wero card twice
Signed-off-by: Berend Sliedrecht <berend@animo.id>
1 parent a6b0291 commit 673107e

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

agent/src/endpoints.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,9 @@ apiRouter.post('/requests/create', async (request: Request, response: Response)
347347
}
348348
: undefined
349349

350-
// When credential_sets is used we need to add the wero card to each group so that it will always be requested when also requesting a payment
351-
if (transactionAuthorizationType === 'payment') {
350+
// When credential_sets is used we need to add the wero card to each group so that it will always be requested when also requesting a payment.
351+
// If the request did not define credential_sets originally, the default set generated by dcqlQueryFromRequest already includes all credentials (including the appended wero card), so we must not push again.
352+
if (transactionAuthorizationType === 'payment' && definition.credential_sets) {
352353
queryLanguageDefinition.credential_sets?.forEach((cs) => {
353354
cs.options.map((opts) => opts.push(credentialIds[credentialIds.length - 1]))
354355
})

agent/src/issuers/openHorizonBank.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export async function updatePaymentStatusForWeroCredential(
237237
latest.content.statusCode = statusCode
238238
await agent.genericRecords.update(latest)
239239
agent.config.logger.info(`openHorizonBank: payment ${paymentTransactionId} updated to ${statusCode}`)
240-
}, 30_000)
240+
}, 5_000)
241241
}
242242

243243
export const openHorizonBankCredentialsData = {

0 commit comments

Comments
 (0)