diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-07-28 15:18:01 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-07-28 15:18:01 +0530 |
commit | 43655adff0f8f1db082e1f0c18f1271a29ab8905 (patch) | |
tree | af106a1e45f85eb12399d8e25ae6f3a413d4fe60 /src/types/walletTypes.ts | |
parent | 86fd5f24406d05fe473c0ffe6c22666fe1b3e343 (diff) | |
download | wallet-core-43655adff0f8f1db082e1f0c18f1271a29ab8905.tar.xz |
updated preparePay API according to spec
Diffstat (limited to 'src/types/walletTypes.ts')
-rw-r--r-- | src/types/walletTypes.ts | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/types/walletTypes.ts b/src/types/walletTypes.ts index 2ca95bf48..d68f41564 100644 --- a/src/types/walletTypes.ts +++ b/src/types/walletTypes.ts @@ -337,34 +337,36 @@ export interface NextUrlResult { lastSessionId: string | undefined; } +export const enum PreparePayResultType { + PaymentPossible = "payment-possible", + InsufficientBalance = "insufficient-balance", + AlreadyConfirmed = "already-confirmed", +} + export type PreparePayResult = - | PreparePayResultError | PreparePayResultInsufficientBalance - | PreparePayResultPaid + | PreparePayResultAlreadyConfirmed | PreparePayResultPaymentPossible; export interface PreparePayResultPaymentPossible { - status: "payment-possible"; + status: PreparePayResultType.PaymentPossible; proposalId: string; contractTermsRaw: string; totalFees: AmountJson; } export interface PreparePayResultInsufficientBalance { - status: "insufficient-balance"; + status: PreparePayResultType.InsufficientBalance; proposalId: string; contractTermsRaw: any; } -export interface PreparePayResultError { - status: "error"; - error: string; -} - -export interface PreparePayResultPaid { - status: "paid"; +export interface PreparePayResultAlreadyConfirmed { + status: PreparePayResultType.AlreadyConfirmed; contractTermsRaw: any; - nextUrl: string; + paid: boolean; + // Only specified if paid. + nextUrl?: string; } export interface BankWithdrawDetails { |