aboutsummaryrefslogtreecommitdiff
path: root/src/types.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-27 03:56:19 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-27 03:56:19 +0200
commit8697efd2c8751717a3a3fcaf72feb7c49ebfec02 (patch)
treee41b044c85d459e9b6042aab541fd6c88470528b /src/types.ts
parent21c176a69ee04c4d59baedb79017f6c42ece22d6 (diff)
downloadwallet-core-8697efd2c8751717a3a3fcaf72feb7c49ebfec02.tar.xz
implement refunds
Diffstat (limited to 'src/types.ts')
-rw-r--r--src/types.ts32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/types.ts b/src/types.ts
index 9031b19b7..aabf4ffc0 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -798,9 +798,9 @@ export enum CoinStatus {
*/
Fresh,
/**
- * Currently planned to be sent to a merchant for a transaction.
+ * Currently planned to be sent to a merchant for a purchase.
*/
- TransactionPending,
+ PurchasePending,
/**
* Used for a completed transaction and now dirty.
*/
@@ -1662,3 +1662,31 @@ export class ReturnCoinsRequest {
*/
static checked: (obj: any) => ReturnCoinsRequest;
}
+
+
+export interface RefundPermission {
+ refund_amount: AmountJson;
+ refund_fee: AmountJson;
+ h_contract_terms: string;
+ coin_pub: string;
+ rtransaction_id: number;
+ merchant_pub: string;
+ merchant_sig: string;
+}
+
+
+export interface PurchaseRecord {
+ contractTermsHash: string;
+ contractTerms: ContractTerms;
+ payReq: PayReq;
+ merchantSig: string;
+
+ /**
+ * The purchase isn't active anymore, it's either successfully paid or
+ * refunded/aborted.
+ */
+ finished: boolean;
+
+ refundsPending: { [refundSig: string]: RefundPermission };
+ refundsDone: { [refundSig: string]: RefundPermission };
+}