aboutsummaryrefslogtreecommitdiff
path: root/src/types
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-07-21 12:23:48 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-07-21 12:23:48 +0530
commitf4a8702b3cf93f9edf96d1d1c8cb88baa309e301 (patch)
treeec8c62271e7f220da32858a04c901b1962d2b4b3 /src/types
parentdd2efc3d78f2dfda44f8182f9638723dcb839781 (diff)
downloadwallet-core-f4a8702b3cf93f9edf96d1d1c8cb88baa309e301.tar.xz
towards consuming new merchant API
Diffstat (limited to 'src/types')
-rw-r--r--src/types/dbTypes.ts5
-rw-r--r--src/types/talerTypes.ts36
-rw-r--r--src/types/walletTypes.ts2
3 files changed, 13 insertions, 30 deletions
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<WithdrawResponse> =>
makeCodecForObject<WithdrawResponse>()
.property("ev_sig", codecForString)
.build("WithdrawResponse");
+
+export const codecForMerchantPayResponse = (): Codec<MerchantPayResponse> =>
+ makeCodecForObject<MerchantPayResponse>()
+ .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;
}