This commit is contained in:
@@ -149,20 +149,20 @@ namespace Sockeye.Api.Controllers
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
/// import data from rockfish that isn't already present
|
// /// import data from rockfish that isn't already present
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
/// <returns>No content</returns>
|
// /// <returns>No content</returns>
|
||||||
[HttpPost("import-rockfish")]
|
// [HttpPost("import-rockfish")]
|
||||||
public async Task<IActionResult> ImportRockfish([FromBody] Customer newObject, ApiVersion apiVersion)
|
// public async Task<IActionResult> ImportRockfish([FromBody] Customer newObject, ApiVersion apiVersion)
|
||||||
{
|
// {
|
||||||
if (!serverState.IsOpen)
|
// if (!serverState.IsOpen)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
// return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
GlobalBizSettingsBiz biz = GlobalBizSettingsBiz.GetBiz(ct, HttpContext);
|
// GlobalBizSettingsBiz biz = GlobalBizSettingsBiz.GetBiz(ct, HttpContext);
|
||||||
await biz.ImportRockfish(ct, log);
|
// await biz.ImportRockfish(log);
|
||||||
return NoContent();
|
// return NoContent();
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -242,7 +242,10 @@ namespace Sockeye.Biz
|
|||||||
c.DoNotContact = false;//if they just made a purchase they are contactable even if they weren't before
|
c.DoNotContact = false;//if they just made a purchase they are contactable even if they weren't before
|
||||||
c.Address = c.PostAddress = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["street1"].Value<string>();
|
c.Address = c.PostAddress = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["street1"].Value<string>();
|
||||||
c.City = c.PostCity = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["city"].Value<string>();
|
c.City = c.PostCity = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["city"].Value<string>();
|
||||||
c.Region = c.PostRegion = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["state"].Value<string>();
|
|
||||||
|
//State doesn't always exist in mycommerce notifications
|
||||||
|
if (jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["state"] != null)
|
||||||
|
c.Region = c.PostRegion = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["state"].Value<string>();
|
||||||
c.Country = c.PostCountry = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["country"].Value<string>();
|
c.Country = c.PostCountry = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["country"].Value<string>();
|
||||||
c.PostCode = c.AddressPostal = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["postal_code"].Value<string>();
|
c.PostCode = c.AddressPostal = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["address"]["postal_code"].Value<string>();
|
||||||
var firstName = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["first_name"].Value<string>() ?? "FirstNameEmpty";
|
var firstName = jData["order_notification"]["purchase"]["customer_data"]["delivery_contact"]["first_name"].Value<string>() ?? "FirstNameEmpty";
|
||||||
|
|||||||
Reference in New Issue
Block a user