Last active
April 10, 2018 21:27
-
-
Save johntran/14f28d5817274567bf2cb82e280880f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getBillingAddress({ | |
firstName, | |
lastName, | |
street, | |
addressLineTwo, | |
city, | |
state, | |
zip, | |
} ) { | |
return { | |
billingFirstName: firstName, | |
billingLastName: lastName, | |
billingAddressLineOne: street, | |
billingAddressLineTwo: addressLineTwo, | |
billingCity: city, | |
billingState: state, | |
billingZip: zip, | |
}; | |
} | |
function generateBillingAddress(order) { | |
const { | |
billingAddress, | |
shippingAddress, | |
} = order; | |
const billingAddressData = billingAddress || shippingAddress; | |
return getBillingAddress(billingAddressData); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment