summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/http-client/types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util/src/http-client/types.ts')
-rw-r--r--packages/taler-util/src/http-client/types.ts106
1 files changed, 68 insertions, 38 deletions
diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts
index 132ca867d..08b29106e 100644
--- a/packages/taler-util/src/http-client/types.ts
+++ b/packages/taler-util/src/http-client/types.ts
@@ -2403,6 +2403,10 @@ export namespace TalerMerchantApi {
// Name of the protocol.
name: "taler-merchant";
+ // URN of the implementation (needed to interpret 'revision' in version).
+ // @since **v8**, may become mandatory in the future.
+ implementation?: string;
+
// Default (!) currency supported by this backend.
// This is the currency that the backend should
// suggest by default to the user when entering
@@ -2417,8 +2421,27 @@ export namespace TalerMerchantApi {
// All currencies in this map are supported by
// the backend.
currencies: { [currency: string]: CurrencySpecification };
+
+ // Array of exchanges trusted by the merchant.
+ // Since protocol **v6**.
+ exchanges: ExchangeConfigInfo[];
}
+ export interface ExchangeConfigInfo {
+ // Base URL of the exchange REST API.
+ base_url: string;
+
+ // Currency for which the merchant is configured
+ // to trust the exchange.
+ // May not be the one the exchange actually uses,
+ // but is the only one we would trust this exchange for.
+ currency: string;
+
+ // Offline master public key of the exchange. The
+ // /keys data must be signed with this public
+ // key for us to trust it.
+ master_pub: EddsaPublicKey;
+ }
export interface ClaimRequest {
// Nonce to identify the wallet that claimed the order.
nonce: string;
@@ -2447,7 +2470,43 @@ export namespace TalerMerchantApi {
pos_confirmation?: string;
}
- interface PayRequest {
+ export interface PaymentStatusRequestParams {
+ // Hash of the order’s contract terms (this is used to
+ // authenticate the wallet/customer in case
+ // $ORDER_ID is guessable).
+ // Required once an order was claimed.
+ contractTermHash?: string;
+ // Authorizes the request via the claim token that
+ // was returned in the PostOrderResponse. Used with
+ // unclaimed orders only. Whether token authorization is
+ // required is determined by the merchant when the
+ // frontend creates the order.
+ claimToken?: string;
+ // Session ID that the payment must be bound to.
+ // If not specified, the payment is not session-bound.
+ sessionId?: string;
+ // If specified, the merchant backend will wait up to
+ // timeout_ms milliseconds for completion of the payment
+ // before sending the HTTP response. A client must never
+ // rely on this behavior, as the merchant backend may return
+ // a response immediately.
+ timeout?: number;
+ // If set to “yes”, poll for the order’s pending refunds
+ // to be picked up. timeout_ms specifies how long we
+ // will wait for the refund.
+ awaitRefundObtained?: boolean;
+ // Indicates that we are polling for a refund above the
+ // given AMOUNT. timeout_ms will specify how long we
+ // will wait for the refund.
+ refund?: AmountString;
+ // Since protocol v9 refunded orders are only returned
+ // under “already_paid_order_id” if this flag is set
+ // explicitly to “YES”.
+ allowRefundedForRepurchase?: boolean;
+
+ }
+
+ export interface PayRequest {
// The coins used to make the payment.
coins: CoinPaySig[];
@@ -2520,7 +2579,7 @@ export namespace TalerMerchantApi {
// refunds. False if it was simply paid.
refunded: boolean;
}
- interface PaidRequest {
+ export interface PaidRequest {
// Signature on TALER_PaymentResponsePS with the public
// key of the merchant instance.
sig: EddsaSignature;
@@ -2537,7 +2596,7 @@ export namespace TalerMerchantApi {
session_id: string;
}
- interface AbortRequest {
+ export interface AbortRequest {
// Hash of the order's contract terms (this is used to authenticate the
// wallet/customer in case $ORDER_ID is guessable).
h_contract: HashCode;
@@ -2603,7 +2662,7 @@ export namespace TalerMerchantApi {
exchange_pub: EddsaPublicKey;
}
- interface WalletRefundRequest {
+ export interface WalletRefundRequest {
// Hash of the order's contract terms (this is used to authenticate the
// wallet/customer).
h_contract: HashCode;
@@ -2723,7 +2782,7 @@ export namespace TalerMerchantApi {
blind_sig: BlindedRsaSignature;
}
- interface InstanceConfigurationMessage {
+ export interface InstanceConfigurationMessage {
// Name of the merchant instance to create (will become $INSTANCE).
// Must match the regex ^[A-Za-z0-9][A-Za-z0-9_.@-]+$.
id: string;
@@ -2771,7 +2830,7 @@ export namespace TalerMerchantApi {
default_pay_delay: RelativeTime;
}
- interface InstanceAuthConfigurationMessage {
+ export interface InstanceAuthConfigurationMessage {
// Type of authentication.
// "external": The mechant backend does not do
// any authentication checks. Instead an API
@@ -2788,37 +2847,8 @@ export namespace TalerMerchantApi {
token?: string;
}
- interface LoginTokenRequest {
- // Scope of the token (which kinds of operations it will allow)
- scope: "readonly" | "write";
-
- // Server may impose its own upper bound
- // on the token validity duration
- duration?: RelativeTime;
-
- // Can this token be refreshed?
- // Defaults to false.
- refreshable?: boolean;
- }
- interface LoginTokenSuccessResponse {
- // The login token that can be used to access resources
- // that are in scope for some time. Must be prefixed
- // with "Bearer " when used in the "Authorization" HTTP header.
- // Will already begin with the RFC 8959 prefix.
- token: string;
-
- // Scope of the token (which kinds of operations it will allow)
- scope: "readonly" | "write";
-
- // Server may impose its own upper bound
- // on the token validity duration
- expiration: Timestamp;
-
- // Can this token be refreshed?
- refreshable: boolean;
- }
- interface InstanceReconfigurationMessage {
+ export interface InstanceReconfigurationMessage {
// Merchant name corresponding to this instance.
name: string;
@@ -2980,7 +3010,7 @@ export namespace TalerMerchantApi {
exchange_http_status: number;
}
- interface AccountAddDetails {
+ export interface AccountAddDetails {
// payto:// URI of the account.
payto_uri: PaytoString;
@@ -3017,7 +3047,7 @@ export namespace TalerMerchantApi {
salt: HashCode;
}
- interface AccountPatchDetails {
+ export interface AccountPatchDetails {
// URL from where the merchant can download information
// about incoming wire transfers to this account.
credit_facade_url?: string;