diff --git a/services/web/app/coffee/Features/Subscription/RecurlyWrapper.coffee b/services/web/app/coffee/Features/Subscription/RecurlyWrapper.coffee index 0d7aa99131..059c5fb02c 100644 --- a/services/web/app/coffee/Features/Subscription/RecurlyWrapper.coffee +++ b/services/web/app/coffee/Features/Subscription/RecurlyWrapper.coffee @@ -10,9 +10,11 @@ module.exports = RecurlyWrapper = apiUrl : "https://api.recurly.com/v2" _addressToXml: (address) -> - allowedKeys = ['address1', 'address2', 'city', 'country', 'state', 'zip'] + allowedKeys = ['address1', 'address2', 'city', 'country', 'state', 'zip', 'postal_code'] resultString = "\n" for k, v of address + if k == 'postal_code' + k = 'zip' if v and (k in allowedKeys) resultString += "<#{k}#{if k == 'address2' then ' nil="nil"' else ''}>#{v || ''}\n" resultString += "\n" diff --git a/services/web/public/coffee/main/new-subscription.coffee b/services/web/public/coffee/main/new-subscription.coffee index b507690f4e..93c2c0a7cc 100644 --- a/services/web/public/coffee/main/new-subscription.coffee +++ b/services/web/public/coffee/main/new-subscription.coffee @@ -122,7 +122,6 @@ define [ country: $scope.data.country state: $scope.data.state postal_code: $scope.data.postal_code - zip: $scope.data.zip $http.post("/user/subscription/create", postData) .success (data, status, headers)-> sixpack.convert "in-editor-free-trial-plan", pricing.items.plan.code, (err)-> diff --git a/services/web/test/UnitTests/coffee/Subscription/RecurlyWrapperTests.coffee b/services/web/test/UnitTests/coffee/Subscription/RecurlyWrapperTests.coffee index 549f6e0250..5a5e9fc40c 100644 --- a/services/web/test/UnitTests/coffee/Subscription/RecurlyWrapperTests.coffee +++ b/services/web/test/UnitTests/coffee/Subscription/RecurlyWrapperTests.coffee @@ -354,11 +354,11 @@ describe "RecurlyWrapper", -> beforeEach -> @address = - address1: "addr_one" - address2: "addr_two" - country: "some_country" - state: "some_state" - zip: "some_zip" + address1: "addr_one" + address2: "addr_two" + country: "some_country" + state: "some_state" + postal_code: "some_zip" nonsenseKey: "rubbish" it 'should generate the correct xml', () ->