Skip to content

Commit

Permalink
fix(netsuite): Use max length when creating netsuite customer
Browse files Browse the repository at this point in the history
  • Loading branch information
rsempe committed Feb 24, 2025
1 parent f8f3246 commit e341577
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Contacts
module Payloads
class Netsuite < BasePayload
STATE_LIMIT = 30
ADDR1_LIMIT = 150

def create_body
{
Expand Down Expand Up @@ -73,7 +74,7 @@ def lines
"defaultbilling" => true,
"subObjectId" => "addressbookaddress",
"subObject" => {
"addr1" => customer.address_line1,
"addr1" => customer.address_line1&.first(ADDR1_LIMIT),
"addr2" => customer.address_line2,
"city" => customer.city,
"zip" => customer.zipcode,
Expand All @@ -94,7 +95,7 @@ def lines
"defaultbilling" => true,
"subObjectId" => "addressbookaddress",
"subObject" => {
"addr1" => customer.address_line1,
"addr1" => customer.address_line1&.first(ADDR1_LIMIT),
"addr2" => customer.address_line2,
"city" => customer.city,
"zip" => customer.zipcode,
Expand All @@ -107,11 +108,11 @@ def lines
"defaultbilling" => false,
"subObjectId" => "addressbookaddress",
"subObject" => {
"addr1" => customer.shipping_address_line1,
"addr1" => customer.shipping_address_line1&.first(ADDR1_LIMIT),
"addr2" => customer.shipping_address_line2,
"city" => customer.shipping_city,
"zip" => customer.shipping_zipcode,
"state" => customer.shipping_state,
"state" => customer.shipping_state&.first(STATE_LIMIT),
"country" => customer.shipping_country
}
}
Expand Down

0 comments on commit e341577

Please sign in to comment.