mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
set postal_code as zip
This commit is contained in:
parent
465d09dcfe
commit
6581bc4ecf
3 changed files with 8 additions and 7 deletions
|
@ -10,9 +10,11 @@ module.exports = RecurlyWrapper =
|
||||||
apiUrl : "https://api.recurly.com/v2"
|
apiUrl : "https://api.recurly.com/v2"
|
||||||
|
|
||||||
_addressToXml: (address) ->
|
_addressToXml: (address) ->
|
||||||
allowedKeys = ['address1', 'address2', 'city', 'country', 'state', 'zip']
|
allowedKeys = ['address1', 'address2', 'city', 'country', 'state', 'zip', 'postal_code']
|
||||||
resultString = "<billing_info>\n"
|
resultString = "<billing_info>\n"
|
||||||
for k, v of address
|
for k, v of address
|
||||||
|
if k == 'postal_code'
|
||||||
|
k = 'zip'
|
||||||
if v and (k in allowedKeys)
|
if v and (k in allowedKeys)
|
||||||
resultString += "<#{k}#{if k == 'address2' then ' nil="nil"' else ''}>#{v || ''}</#{k}>\n"
|
resultString += "<#{k}#{if k == 'address2' then ' nil="nil"' else ''}>#{v || ''}</#{k}>\n"
|
||||||
resultString += "</billing_info>\n"
|
resultString += "</billing_info>\n"
|
||||||
|
|
|
@ -122,7 +122,6 @@ define [
|
||||||
country: $scope.data.country
|
country: $scope.data.country
|
||||||
state: $scope.data.state
|
state: $scope.data.state
|
||||||
postal_code: $scope.data.postal_code
|
postal_code: $scope.data.postal_code
|
||||||
zip: $scope.data.zip
|
|
||||||
$http.post("/user/subscription/create", postData)
|
$http.post("/user/subscription/create", postData)
|
||||||
.success (data, status, headers)->
|
.success (data, status, headers)->
|
||||||
sixpack.convert "in-editor-free-trial-plan", pricing.items.plan.code, (err)->
|
sixpack.convert "in-editor-free-trial-plan", pricing.items.plan.code, (err)->
|
||||||
|
|
|
@ -354,11 +354,11 @@ describe "RecurlyWrapper", ->
|
||||||
|
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@address =
|
@address =
|
||||||
address1: "addr_one"
|
address1: "addr_one"
|
||||||
address2: "addr_two"
|
address2: "addr_two"
|
||||||
country: "some_country"
|
country: "some_country"
|
||||||
state: "some_state"
|
state: "some_state"
|
||||||
zip: "some_zip"
|
postal_code: "some_zip"
|
||||||
nonsenseKey: "rubbish"
|
nonsenseKey: "rubbish"
|
||||||
|
|
||||||
it 'should generate the correct xml', () ->
|
it 'should generate the correct xml', () ->
|
||||||
|
|
Loading…
Reference in a new issue