diff options
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/dbTypes.ts | 17 | ||||
-rw-r--r-- | src/types/walletTypes.ts | 24 |
2 files changed, 37 insertions, 4 deletions
diff --git a/src/types/dbTypes.ts b/src/types/dbTypes.ts index 9d2f6fe5d..7447fc546 100644 --- a/src/types/dbTypes.ts +++ b/src/types/dbTypes.ts @@ -1060,6 +1060,16 @@ export interface PurchaseRefundState { } /** + * Record stored for every time we successfully submitted + * a payment to the merchant (both first time and re-play). + */ +export interface PayEventRecord { + proposalId: string; + sessionId: string | undefined; + timestamp: Timestamp; +} + +/** * Record that stores status information about one purchase, starting from when * the customer accepts a proposal. Includes refund status if applicable. */ @@ -1432,6 +1442,12 @@ export namespace Stores { } } + class PayEventsStore extends Store<PayEventRecord> { + constructor() { + super("payEvents", { keyPath: "proposalId" }); + } + } + class BankWithdrawUrisStore extends Store<BankWithdrawUriRecord> { constructor() { super("bankWithdrawUris", { keyPath: "talerWithdrawUri" }); @@ -1457,6 +1473,7 @@ export namespace Stores { export const withdrawalSession = new WithdrawalSessionsStore(); export const bankWithdrawUris = new BankWithdrawUrisStore(); export const refundEvents = new RefundEventsStore(); + export const payEvents = new PayEventsStore(); } /* tslint:enable:completed-docs */ diff --git a/src/types/walletTypes.ts b/src/types/walletTypes.ts index eedae6f2c..df19d8dc2 100644 --- a/src/types/walletTypes.ts +++ b/src/types/walletTypes.ts @@ -195,14 +195,30 @@ export interface WalletBalanceEntry { pendingIncomingDirty: AmountJson; } +export interface CoinPayInfo { + /** + * Amount that will be subtracted from the coin when the payment is finalized. + */ + subtractedAmount: AmountJson; + + /** + * Public key of the coin that is being spent. + */ + coinPub: string; + + /** + * Signature together with the other information needed by the merchant, + * directly in the format expected by the merchant. + */ + sig: CoinPaySig; +} + /** * Coins used for a payment, with signatures authorizing the payment and the * coins with remaining value updated to accomodate for a payment. */ -export interface PayCoinInfo { - originalCoins: CoinRecord[]; - updatedCoins: CoinRecord[]; - sigs: CoinPaySig[]; +export interface PaySigInfo { + coinInfo: CoinPayInfo[]; } /** |