voucherifyio / voucherify-dotNET-sdk

.Net SDK for Voucherify - coupons, vouchers, promo codes http://www.voucherify.io
http://www.voucherify.io
MIT License
12 stars 16 forks source link

Validation of fixed amount vouchers returns wrong DiscountType #81

Closed ahordijk closed 2 years ago

ahordijk commented 2 years ago

When validating a voucher with a fixed discount amount for order items the API returns:

discount: {
  type: "FIXED",
  effect: "APPLY_TO_ITEMS" 
}

But the ValidationVoucher object returns a DiscountType.Amount for the Discount object. This is because the enum is missing a value for FIXED. Also the discount effects are missing, see API documentation for possible values: https://docs.voucherify.io/docs/discount-effects

Next to this issue the ValidationVoucher returns the VoucherSubject class in which the price for the product is missing. The API returns the fixed price value but the VoucherSubject is missing a property for Price.

applicable_to: {
  data: [{
     object: "product",
     id: "prod_id,
     source_id: "1",
     strict: false,
     price: 1000 }]
}