From 3425c6cbc674855cc7cf09f85f99a993b1080dd8 Mon Sep 17 00:00:00 2001 From: Sebastian Rindom Date: Tue, 10 Nov 2020 10:52:54 +0100 Subject: [PATCH] hotfix(medusa-plugin-brightpearl): add email and phone to customer in brightpearl --- .../src/services/brightpearl.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/medusa-plugin-brightpearl/src/services/brightpearl.js b/packages/medusa-plugin-brightpearl/src/services/brightpearl.js index 86671f30b9..8cf1395404 100644 --- a/packages/medusa-plugin-brightpearl/src/services/brightpearl.js +++ b/packages/medusa-plugin-brightpearl/src/services/brightpearl.js @@ -538,7 +538,7 @@ class BrightpearlService extends BaseService { }) ) - // If a gift card was applied to the order we reduce the order amount + // If a gift card was applied to the order we reduce the order amount // correspondingly. This reduces the amount payable, while debiting the // gift card account that was previously credited, when the gift card was // purchased. @@ -649,6 +649,14 @@ class BrightpearlService extends BaseService { const customer = await client.customers.create({ firstName: fromOrder.shipping_address.first_name, lastName: fromOrder.shipping_address.last_name, + telephones: { + PRI: fromOrder.shipping_address.phone, + }, + emails: { + PRI: fromOrder.email, + SEC: fromOrder.email, + TER: fromOrder.email, + }, postAddressIds: { DEF: address, BIL: address,