From 4ad15de08b6ac8f055c899d32dd79ba3f8c7cfad Mon Sep 17 00:00:00 2001 From: Ainun Nazieb Date: Mon, 17 Oct 2022 15:11:32 +0700 Subject: [PATCH] fix(qr_code): use JSON content type for simulation endpoint --- package.json | 2 +- src/qr_code/qr_code.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 216f0e5..54fe603 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xendit-node", - "version": "1.21.6", + "version": "1.21.7", "description": "NodeJS client for Xendit API", "main": "index.js", "types": "index.d.ts", diff --git a/src/qr_code/qr_code.js b/src/qr_code/qr_code.js index 3143fd7..207bb03 100644 --- a/src/qr_code/qr_code.js +++ b/src/qr_code/qr_code.js @@ -70,7 +70,10 @@ QrCode.prototype.simulate = function(data) { `${this.API_ENDPOINT}/${data.externalID}/payments/simulate`, { method: 'POST', - headers: { Authorization: Auth.basicAuthHeader(this.opts.secretKey) }, + headers: { + 'Content-Type': 'application/json', + Authorization: Auth.basicAuthHeader(this.opts.secretKey), + }, body: JSON.stringify({ amount: data.amount }), }, )