acceptOffer

suspend fun acceptOffer(uriOffer: String, txCode: String? = null): IssuedCredentialSummary

Accept a previously received offer and issue a credential.

This will:

  1. Call receiveOffer to resolve the offer.

  2. Try each Offer.offeredDocuments in order via issueOne.

  3. Return the first successfully issued IssuedCredentialSummary.

Return

The first successful IssuedCredentialSummary.

Parameters

uriOffer

The same credential offer URI shown to the user.

txCode

Transaction code for pre-authorized offers. Pass null for authorization-code offers. When receiveOffer reports a non-null Offer.txCodeSpec, the offer is pre-authorized and the user must supply this code (the spec describes the expected length/format).

Throws

if the offer has no document types.

if no document could be issued.

if issuing succeeded, but building a summary from the SD-JWT failed.

if the offer cannot be resolved.