Skip to content

Commit

Permalink
Hard Code USPS ground Advantage
Browse files Browse the repository at this point in the history
  • Loading branch information
spuder committed Dec 16, 2024
1 parent 8d576bf commit 5953bf4
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions bin/tindie2easypost.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,32 @@ def convert

# Predefined from address values
from_address_values = [
@from_address[:name], # from_address.name
@from_address[:company], # from_address.company
@from_address[:phone], # from_address.phone
@from_address[:email], # from_address.email
@from_address[:street1], # from_address.street1
@from_address[:street2] || '', # from_address.street2
@from_address[:city], # from_address.city
@from_address[:state], # from_address.state
@from_address[:zip], # from_address.zip
@from_address[:country], # from_address.country
@from_address[:name],
@from_address[:company],
@from_address[:phone],
@from_address[:email],
@from_address[:street1],
@from_address[:street2] || '',
@from_address[:city],
@from_address[:state],
@from_address[:zip],
@from_address[:country],
]

tindie_data.each do |row|
# Map Tindie data to EasyPost format
easypost_row = [
# To Address
"#{row['First Name']} #{row['Last Name']}", # to_address.name
row['Company'], # to_address.company
row['Phone'], # to_address.phone
row['Email'], # to_address.email
row['Street'], # to_address.street1
'', # to_address.street2 (empty if not in Tindie)
row['City'], # to_address.city
row['State/Province'], # to_address.state
row['Postal/Zip Code'], # to_address.zip
row['Country'], # to_address.country
"#{row['First Name']} #{row['Last Name']}",
row['Company'],
row['Phone'],
row['Email'],
row['Street'],
'',
row['City'],
row['State/Province'],
row['Postal/Zip Code'],
row['Country'],

# From Address (using predefined values)
*from_address_values,
Expand All @@ -68,8 +68,8 @@ def convert
'', # parcel.height
'', # parcel.weight
'', # parcel.predefined_package
'', # carrier
row['Shipping Method'] # service
'USPS', # carrier
'Ground Advantage' # service
]

csv << easypost_row
Expand Down

0 comments on commit 5953bf4

Please sign in to comment.