gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: make basic withdrawal and pay


From: gnunet
Subject: [taler-wallet-core] branch master updated: make basic withdrawal and payment work again with new API
Date: Wed, 19 Aug 2020 16:09:30 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new f7299a1a make basic withdrawal and payment work again with new API
f7299a1a is described below

commit f7299a1aa0952490629588aa5a853999684b3fb9
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Wed Aug 19 19:39:21 2020 +0530

    make basic withdrawal and payment work again with new API
---
 packages/taler-wallet-webextension/src/pages/pay.tsx     | 16 +++++++++++++---
 .../taler-wallet-webextension/src/pages/withdraw.tsx     |  8 +++-----
 packages/taler-wallet-webextension/src/wxApi.ts          |  8 ++++----
 3 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/pages/pay.tsx 
b/packages/taler-wallet-webextension/src/pages/pay.tsx
index 1e1f91ca..f1ba2c2b 100644
--- a/packages/taler-wallet-webextension/src/pages/pay.tsx
+++ b/packages/taler-wallet-webextension/src/pages/pay.tsx
@@ -24,13 +24,20 @@
  */
 import * as i18n from "../i18n";
 
-
 import { renderAmount, ProgressButton } from "../renderHtml";
 import * as wxApi from "../wxApi";
 
 import React, { useState, useEffect } from "react";
 
-import { Amounts, AmountJson, PreparePayResult, PreparePayResultType, 
ContractTerms, codecForContractTerms, ConfirmPayResultType } from 
"taler-wallet-core";
+import {
+  Amounts,
+  AmountJson,
+  PreparePayResult,
+  PreparePayResultType,
+  ContractTerms,
+  codecForContractTerms,
+  ConfirmPayResultType,
+} from "taler-wallet-core";
 
 function TalerPayDialog({ talerPayUri }: { talerPayUri: string }): JSX.Element 
{
   const [payStatus, setPayStatus] = useState<PreparePayResult | undefined>();
@@ -60,7 +67,10 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: 
string }): JSX.Element {
     amountEffective = Amounts.parseOrThrow(payStatus.amountEffective);
   }
 
-  if (payStatus.status === PreparePayResultType.AlreadyConfirmed && numTries 
=== 0) {
+  if (
+    payStatus.status === PreparePayResultType.AlreadyConfirmed &&
+    numTries === 0
+  ) {
     return (
       <span>
         You have already paid for this article. Click{" "}
diff --git a/packages/taler-wallet-webextension/src/pages/withdraw.tsx 
b/packages/taler-wallet-webextension/src/pages/withdraw.tsx
index 1637176a..2747dd3f 100644
--- a/packages/taler-wallet-webextension/src/pages/withdraw.tsx
+++ b/packages/taler-wallet-webextension/src/pages/withdraw.tsx
@@ -43,7 +43,6 @@ function WithdrawalDialog(props: { talerWithdrawUri: string 
}): JSX.Element {
   const talerWithdrawUri = props.talerWithdrawUri;
   const [cancelled, setCancelled] = useState(false);
   const [selecting, setSelecting] = useState(false);
-  const [customUrl, setCustomUrl] = useState<string>("");
   const [errMsg, setErrMsg] = useState<string | undefined>("");
   const [updateCounter, setUpdateCounter] = useState(1);
 
@@ -58,6 +57,9 @@ function WithdrawalDialog(props: { talerWithdrawUri: string 
}): JSX.Element {
     const fetchData = async (): Promise<void> => {
       const res = await getWithdrawalDetailsForUri({talerWithdrawUri: 
props.talerWithdrawUri});
       setDetails(res);
+      if (res.defaultExchangeBaseUrl) {
+        setSelectedExchange(res.defaultExchangeBaseUrl);
+      }
     };
     fetchData();
   }, [selectedExchange, errMsg, selecting, talerWithdrawUri, updateCounter]);
@@ -124,10 +126,6 @@ function WithdrawalDialog(props: { talerWithdrawUri: 
string }): JSX.Element {
             {i18n.str`Cancel withdraw operation`}
           </span>
         </p>
-
-        {/* {details.exchangeWithdrawDetails ? (
-          <WithdrawDetailView rci={details.exchangeWithdrawDetails} />
-        ) : null} */}
       </div>
     </div>
   );
diff --git a/packages/taler-wallet-webextension/src/wxApi.ts 
b/packages/taler-wallet-webextension/src/wxApi.ts
index 836466ff..dc78686a 100644
--- a/packages/taler-wallet-webextension/src/wxApi.ts
+++ b/packages/taler-wallet-webextension/src/wxApi.ts
@@ -98,7 +98,7 @@ export function confirmPay(
   proposalId: string,
   sessionId: string | undefined,
 ): Promise<ConfirmPayResult> {
-  return callBackend("confirm-pay", { proposalId, sessionId });
+  return callBackend("confirmPay", { proposalId, sessionId });
 }
 
 /**
@@ -184,7 +184,7 @@ export function benchmarkCrypto(repetitions: number): 
Promise<BenchmarkResult> {
  * Get details about a pay operation.
  */
 export function preparePay(talerPayUri: string): Promise<PreparePayResult> {
-  return callBackend("prepare-pay", { talerPayUri });
+  return callBackend("preparePay", { talerPayUri });
 }
 
 /**
@@ -194,9 +194,9 @@ export function acceptWithdrawal(
   talerWithdrawUri: string,
   selectedExchange: string,
 ): Promise<AcceptWithdrawalResponse> {
-  return callBackend("accept-withdrawal", {
+  return callBackend("acceptBankIntegratedWithdrawal", {
     talerWithdrawUri,
-    selectedExchange,
+    exchangeBaseUrl: selectedExchange,
   });
 }
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]