aboutsummaryrefslogtreecommitdiff
path: root/src/headless/merchant.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-07-22 14:22:03 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-07-22 14:22:03 +0530
commite60563fb540c04d9ba751fea69c1fc0f1de598b5 (patch)
tree45f7c86b66dc150d413f9855efaa6341e4a44624 /src/headless/merchant.ts
parentf4a8702b3cf93f9edf96d1d1c8cb88baa309e301 (diff)
downloadwallet-core-e60563fb540c04d9ba751fea69c1fc0f1de598b5.tar.xz
consistent error handling for HTTP request (and some other things)
Diffstat (limited to 'src/headless/merchant.ts')
-rw-r--r--src/headless/merchant.ts8
1 files changed, 6 insertions, 2 deletions
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<string> {
- 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<CheckPaymentResponse> {
- 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,