From e60563fb540c04d9ba751fea69c1fc0f1de598b5 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 22 Jul 2020 14:22:03 +0530 Subject: consistent error handling for HTTP request (and some other things) --- src/headless/merchant.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/headless/merchant.ts') diff --git a/src/headless/merchant.ts b/src/headless/merchant.ts index 3324924fd..34ca5564d 100644 --- a/src/headless/merchant.ts +++ b/src/headless/merchant.ts @@ -37,7 +37,10 @@ export class MerchantBackendConnection { reason: string, refundAmount: string, ): Promise { - const reqUrl = new URL(`private/orders/${orderId}/refund`, this.merchantBaseUrl); + const reqUrl = new URL( + `private/orders/${orderId}/refund`, + this.merchantBaseUrl, + ); const refundReq = { reason, refund: refundAmount, @@ -123,7 +126,8 @@ export class MerchantBackendConnection { } async checkPayment(orderId: string): Promise { - const reqUrl = new URL(`private/orders/${orderId}`, this.merchantBaseUrl).href; + const reqUrl = new URL(`private/orders/${orderId}`, this.merchantBaseUrl) + .href; const resp = await axios({ method: "get", url: reqUrl, -- cgit v1.2.3