-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement amendment.amend() #125
Comments
👍 |
Try using amendment.create() first. If that doesn't work for you, then maybe you or I can get subscription.amend() working. I haven't implemented subscription.amend() because using the original CRUD style methods was easiest. Hopefully this is a reasonable workaround for you:
I'll try this week to add some tests and maybe get to subscription.amend(). Also you can use amendment.delete({id: ID}, cb) to tidy up as you test this out. |
Thanks for your answer. If I want to use the create method, the payload to send should look like :
With you example, if I update the amendment var:
The generated payload (obtained with options.verboseLog=true). looks like :
It seems that the RatePlanData part is not generated the right way... Thats the reason why i'm looking for the implementation of .amend() method :p |
Ah thanks, I see what you're trying to do.
There's a couple things that could fix that. The function making the XML is naively expecting a shallow array of attributes. We could fix it to check if any nested objects are present. The node-soap library I'm using already includes functions to do this. It might be as simple as switching to use them. Otherwise, yes implementing .amend() seems like a good idea. I'll try to take a look at it tomorrow. |
I forked the project and made changes in It's not ready for an eventual Pull Request here because i'm doing tricky stuff to get the right znstype for my use case (ratePlan and ratePlanCharge...).
Anyway, if you are up to implement the .amend() it would be great :) |
Cool. Yeah, Zuora's namespaces really do get in the way. |
Hi xer0x, I'm running into the same need for the ammend() call. Is the feature coming? |
Hi, I added an implementation for amendment.amend() and I have a pull request up. Thanks! |
Sweet that was fast. I'll check it out. |
Tried installing the latest, 1.2.0 doesn't seem to include the recently merged changes yet. |
Maybe you should have wait a bit before cloning my branch changes from my own repo and make a pull request here... I think that the According to Zuora documentation the new I think that we should have a new function in charge of parsing this new type of payload...
instead of
|
+1 arenoux. Sorry for prematurely jumping ahead on this. I don't have much time for working on this, so I'm over eager to slurp up changes. You're absolutely right that makeZobject should only make Zuora Objects. I've been looking at switching the XML generation to use the existing functions in Node-Soap. Zuora's use of mixed namespaces is tricky for the existing code. It's too naive about the types of payload that Zuora needs. A better way of creating would be very welcome. I tried to keep the namespaces out of the javascript objects. Maybe for this we need to be able to force the namespace to match what Zuora needs. Thoughts? |
I agree, although a working amend() call is better than a broken one :) I want to iterate over it. The code was already considering non-zObject "request" elements for instance. Best regards, Yousef Elreda
|
Unfortunately version 1.4 broke the amend functionality I had implemented. Any plans for this functionality to come back? Based on the what I see in the new implementation of xml.js, it needs a full re-write. |
@yousefcodes Are you talking about a real amend() call (not available yet) or a create() on amendment object ? I'll implement the amend() functionnality soon as it should be easier now with my updates (similar to the subscribe() call). |
The amend() method isn't implemented yet. It should generate the XML below. You can use amendment.create() as a work-around, but amend() is the recommended way to modify subscriptions since WSDL 29+.
See the Zuora docs for more here:
https://knowledgecenter.zuora.com/BC_Developers/SOAP_API/D_Use_Cases_Code_Samples/DJ_Cancel_a_Subscription_%28Amendment%29
The output XML should look similar to this:
The text was updated successfully, but these errors were encountered: