Skip to content

Commit

Permalink
dont generate charges if they are nil
Browse files Browse the repository at this point in the history
  • Loading branch information
mdemin914 committed Oct 17, 2012
1 parent 056fdaf commit 7783fd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/zuora/objects/amend_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AmendRequest < Base
validate do |request|
self.validation_errors = Array.new
self.validation_errors << request.must_be_present(:amendment)
self.validation_errors << request.must_be_present(:plans_and_charges)
self.validation_errors << request.must_be_present(:plans_and_charges) unless amendment.type == "TermsAndConditions" || amendment.type == "Renewal"
end

def must_be_present(ref)
Expand All @@ -33,7 +33,7 @@ def create
r.__send__(zns, :AmendOptions) do |so|
generate_amend_options(so)
end unless amend_options.blank?

r.__send__(zns, :PreviewOptions) do |so|
generate_preview_options(so)
end unless preview_options.blank?
Expand Down
4 changes: 2 additions & 2 deletions lib/zuora/objects/subscribe_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SubscribeRequest < Base
self.validation_errors = Array.new
self.validation_errors << request.must_have_usable(:account)
#request.must_have_usable(:payment_method) if :preview_options["enable_preview_mode"] != true
#request.must_have_usable(:bill_to_contact)
request.must_have_usable(:bill_to_contact)
#request.must_have_usable(:product_rate_plans)
self.validation_errors << request.must_have_new(:subscription)
end
Expand Down Expand Up @@ -94,7 +94,7 @@ def create
rpc.__send__(ons, :Quantity, charge.quantity)
end
end
end
end unless charges.nil?
end
end unless plans_and_charges.nil?

Expand Down

0 comments on commit 7783fd6

Please sign in to comment.