diff --git a/lib/objectList.js b/lib/objectList.js index 501c0c5..b37674e 100644 --- a/lib/objectList.js +++ b/lib/objectList.js @@ -38,5 +38,7 @@ module.exports = [ {name: 'Usage'}, {name: 'BillingPreviewRequest'}, //BillingPreviewRequest {name: 'Request'}, //BillingPreviewRequest - {name: 'BillingPreviewRun', methods: ['create', 'query']} + {name: 'BillingPreviewRun', methods: ['create', 'query']}, + {name: 'GenerateInvoice', methods: ['subscribe']}, + {name: 'ProcessPayments', methods: ['subscribe']} ]; diff --git a/lib/xml.js b/lib/xml.js index 9941f73..f00c1b4 100644 --- a/lib/xml.js +++ b/lib/xml.js @@ -73,7 +73,7 @@ var escapeFields = function(value) { }; function convert (method, object, objectType) { - var zObjectMethods = ['create', 'update', 'generate']; + var zObjectMethods = ['create', 'update', 'generate', 'subscribe']; var ns1Actions = ['delete', 'execute']; var encapsulate = function(key, obj) { @@ -124,6 +124,18 @@ function convert (method, object, objectType) { prefix = prefix || ns2; val = escapeFields(value); } + var subscribeFields = [ + 'Amount', + 'EffectiveDate', + 'ProcessPayments', + 'GenerateInvoice', + 'PaymentMethodId' + ]; + + if (method === 'subscribe' && subscribeFields.indexOf(key) >= 0) { + prefix = ns1; + } + return tag(name, prefix, val, attributes); } }), '\n');