ethercreative / mailchimp-commerce

Mailchimp integration with Craft Commerce
Other
5 stars 11 forks source link

Order syncing fails if no address2 is provided #7

Closed nilsenpaul closed 5 years ago

nilsenpaul commented 5 years ago

Mailchimp expects a string in the address2 field, but the plugin sends null if address2 is empty:

Create: {"type":"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"Invalid Resource","status":400,"detail":"The resource submitted could not be validated. For field-specific details, see the 'errors' array.","instance":"4975bb66-4875-4fee-8162-fbace4f24a78","errors":[{"field":"customer.address.address2","message":"Schema describes string, NULL found instead"},{"field":"shipping_address.address2","message":"Schema describes string, NULL found instead"},{"field":"billing_address.address2","message":"Schema describes string, NULL found instead"}]}

nilsenpaul commented 5 years ago

I don't think that change fixes the problem. Your commit changes the way the store address is defined, but the above error seems to apply to order addresses?