From f2387227412acebc4ce7d0f03b71772a25eb7f41 Mon Sep 17 00:00:00 2001 From: Ilya Pukhalski Date: Wed, 22 Nov 2017 19:35:18 +0100 Subject: [PATCH 1/4] Zero amount orders allowed --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index fc6748d..1bba0af 100644 --- a/src/index.js +++ b/src/index.js @@ -264,7 +264,7 @@ export default class GoCommerce { payment(paymentDetails) { const {order_id, amount, provider, stripe_token, paypal_payment_id, paypal_user_id} = paymentDetails; - if (order_id && amount && provider && (stripe_token || (paypal_payment_id && paypal_user_id))) { + if (order_id && amount !== undefined && provider && (stripe_token || (paypal_payment_id && paypal_user_id))) { const cart = this.getCart(); return this.authHeaders().then((headers) => this.api.request(`/orders/${order_id}/payments`, { method: "POST", From ff926c8d9ac4f68882d5128db43e5f2ed9cbf050 Mon Sep 17 00:00:00 2001 From: Ilya Pukhalski Date: Wed, 22 Nov 2017 19:36:22 +0100 Subject: [PATCH 2/4] Bumping a version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f06ab83..6c4c629 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gocommerce-js", - "version": "4.1.3", + "version": "4.1.4", "description": "GoCommerce API client for JavaScript", "main": "lib/index.js", "files": [ From 9e47b1b955093c8045f3f3fc3fda29820e7b0092 Mon Sep 17 00:00:00 2001 From: Bret Comnes Date: Mon, 10 Dec 2018 14:52:36 -0800 Subject: [PATCH 3/4] Unbump package.json Lets leave that to the release process --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c4c629..f06ab83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gocommerce-js", - "version": "4.1.4", + "version": "4.1.3", "description": "GoCommerce API client for JavaScript", "main": "lib/index.js", "files": [ From 611015591df4f3745f5815cbd9cd19302a8a262d Mon Sep 17 00:00:00 2001 From: Bret Comnes Date: Mon, 10 Dec 2018 14:52:54 -0800 Subject: [PATCH 4/4] Test for truthiness --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 1bba0af..cdbee35 100644 --- a/src/index.js +++ b/src/index.js @@ -264,7 +264,7 @@ export default class GoCommerce { payment(paymentDetails) { const {order_id, amount, provider, stripe_token, paypal_payment_id, paypal_user_id} = paymentDetails; - if (order_id && amount !== undefined && provider && (stripe_token || (paypal_payment_id && paypal_user_id))) { + if (order_id && amount != null && provider && (stripe_token || (paypal_payment_id && paypal_user_id))) { const cart = this.getCart(); return this.authHeaders().then((headers) => this.api.request(`/orders/${order_id}/payments`, { method: "POST",