lib/voucherify/service/validations.rb in voucherify-1.5.0 vs lib/voucherify/service/validations.rb in voucherify-1.6.0
- old
+ new
@@ -10,9 +10,17 @@
end
def validate_voucher(code, context = {})
@client.post("/vouchers/#{URI.encode(code)}/validate", context.to_json)
end
-
+
+ def validate(code, context = {})
+ if code.is_a? Hash
+ context = code
+ return @client.promotions.validate(context)
+ end
+ @client.validations.validate_voucher(code, context)
+ end
+
end
end
end
\ No newline at end of file