summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/refund.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-08-20 11:39:34 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-08-20 11:39:34 +0530
commit7ff93d8ef64d8ae832c2267192ce1f97bf914776 (patch)
treed53d915d5172eb1d9dc4dd496633cb130961ad89 /packages/taler-wallet-core/src/operations/refund.ts
parentd9b73a30c1ce67f611f9d605bdf163c3e868f2c2 (diff)
downloadwallet-core-7ff93d8ef64d8ae832c2267192ce1f97bf914776.tar.gz
wallet-core-7ff93d8ef64d8ae832c2267192ce1f97bf914776.tar.bz2
wallet-core-7ff93d8ef64d8ae832c2267192ce1f97bf914776.zip
match latest refund API of the merchant
Diffstat (limited to 'packages/taler-wallet-core/src/operations/refund.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/refund.ts14
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/taler-wallet-core/src/operations/refund.ts b/packages/taler-wallet-core/src/operations/refund.ts
index fb39aa638..e9324712e 100644
--- a/packages/taler-wallet-core/src/operations/refund.ts
+++ b/packages/taler-wallet-core/src/operations/refund.ts
@@ -48,6 +48,7 @@ import {
MerchantCoinRefundFailureStatus,
codecForMerchantOrderStatusPaid,
AmountString,
+ codecForMerchantOrderRefundPickupResponse,
} from "../types/talerTypes";
import { guardOperationException } from "./errors";
import { getTimestampNow, Timestamp } from "../util/time";
@@ -472,25 +473,22 @@ async function processPurchaseQueryRefundImpl(
return;
}
-
const requestUrl = new URL(
- `orders/${purchase.contractData.orderId}`,
+ `orders/${purchase.contractData.orderId}/refund`,
purchase.contractData.merchantBaseUrl,
);
- requestUrl.searchParams.set(
- "h_contract",
- purchase.contractData.contractTermsHash,
- );
logger.trace(`making refund request to ${requestUrl.href}`);
- const request = await ws.http.get(requestUrl.href);
+ const request = await ws.http.postJson(requestUrl.href, {
+ h_contract: purchase.contractData.contractTermsHash,
+ });
logger.trace("got json", JSON.stringify(await request.json(), undefined, 2));
const refundResponse = await readSuccessResponseJsonOrThrow(
request,
- codecForMerchantOrderStatusPaid(),
+ codecForMerchantOrderRefundPickupResponse(),
);
await acceptRefunds(