From f4a8702b3cf93f9edf96d1d1c8cb88baa309e301 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 21 Jul 2020 12:23:48 +0530 Subject: towards consuming new merchant API --- src/types/dbTypes.ts | 5 ++--- src/types/talerTypes.ts | 36 ++++++++++-------------------------- src/types/walletTypes.ts | 2 +- 3 files changed, 13 insertions(+), 30 deletions(-) (limited to 'src/types') diff --git a/src/types/dbTypes.ts b/src/types/dbTypes.ts index 4f7b89b67..b085f83db 100644 --- a/src/types/dbTypes.ts +++ b/src/types/dbTypes.ts @@ -1250,10 +1250,9 @@ export interface PurchaseRecord { contractData: WalletContractData; /** - * The payment request, ready to be send to the merchant's - * /pay URL. + * Deposit permissions, available once the user has accepted the payment. */ - payReq: PayReq; + coinDepositPermissions: CoinDepositPermission[]; payCoinSelection: PayCoinSelection; diff --git a/src/types/talerTypes.ts b/src/types/talerTypes.ts index 0221d26bb..232f5f314 100644 --- a/src/types/talerTypes.ts +++ b/src/types/talerTypes.ts @@ -215,7 +215,7 @@ export interface CoinDepositPermission { /** * The denomination public key associated with this coin. */ - denom_pub: string; + h_denom: string; /** * The amount that is subtracted from this coin with this payment. */ @@ -433,31 +433,6 @@ export class ContractTerms { extra: any; } -/** - * Payment body sent to the merchant's /pay. - */ -export interface PayReq { - /** - * Coins with signature. - */ - coins: CoinDepositPermission[]; - - /** - * The merchant public key, used to uniquely - * identify the merchant instance. - */ - merchant_pub: string; - - /** - * Order ID that's being payed for. - */ - order_id: string; - - /** - * Mode for /pay. - */ - mode: "pay" | "abort-refund"; -} /** * Refund permission in the format that the merchant gives it to us. @@ -809,6 +784,10 @@ export interface CoinDumpJson { }>; } +export interface MerchantPayResponse { + sig: string; +} + export type AmountString = string; export type Base32String = string; export type EddsaSignatureString = string; @@ -1044,3 +1023,8 @@ export const codecForWithdrawResponse = (): Codec => makeCodecForObject() .property("ev_sig", codecForString) .build("WithdrawResponse"); + +export const codecForMerchantPayResponse = (): Codec => + makeCodecForObject() + .property("sig", codecForString) + .build("MerchantPayResponse"); diff --git a/src/types/walletTypes.ts b/src/types/walletTypes.ts index 63b20095e..ee7d071c6 100644 --- a/src/types/walletTypes.ts +++ b/src/types/walletTypes.ts @@ -473,7 +473,7 @@ export interface DepositInfo { merchantPub: string; feeDeposit: AmountJson; wireInfoHash: string; - denomPub: string; + denomPubHash: string; denomSig: string; } -- cgit v1.2.3