- checkPayForTemplate#
Check a
taler://pay-template/URI without creating a payment transaction.Fetches the template details from the merchant, applies the overrides encoded in the URI (such as amount or summary), and returns the template details together with the currencies supported by the merchant. This allows the client to present the editable template fields to the user before calling preparePayForTemplateV2.
Request:
The
argsmust be a CheckPayTemplateRequest object.Response:
On success, the result is a CheckPayTemplateReponse object.
Side effects:
Fetches the payment template and the merchant’s configuration over the network; does not change wallet state.
Expected errors:
The caller can handle the following errors inline:
WALLET_TALER_URI_MALFORMED,WALLET_CONTRACT_TERMS_UNSUPPORTED.Details:
The
templateDetailsfield is the template information served by the merchant backend (a WalletTemplateDetailsResponse of the merchant API), with the URI overrides already applied.
interface CheckPayTemplateRequest {
// The taler://pay-template/ URI to check.
talerPayTemplateUri: string;
// Enables progress correlation and cancellation through
// cancelProgressToken.
progressToken?: string;
}
type CheckPayTemplateReponse = {
// Template details served by the merchant backend.
templateDetails: WalletTemplateDetailsResponse;
// Currencies supported by the merchant, sorted.
supportedCurrencies: string[];
};