lib/voucherify.rb in voucherify-0.6.0 vs lib/voucherify.rb in voucherify-0.7.0
- old
+ new
@@ -106,9 +106,15 @@
url = @backend_url + "/vouchers/"
url += URI.encode(code) if code
response = RestClient.post(url, options.to_json, @headers.merge({ :content_type => :json }))
JSON.parse(response.body)
end
+
+ def update(voucher_update)
+ url = @backend_url + "/vouchers/" + URI.encode(voucher_update["code"])
+ response = RestClient.put(url, voucher_update.to_json, @headers.merge({ :content_type => :json }))
+ JSON.parse(response.body)
+ end
def enable(code)
url = @backend_url + "/vouchers/" + URI.encode(code) + "/enable"
response = RestClient.post(url, nil, @headers.merge({ :content_type => :json }))
nil