Class Voucher


  • public class Voucher
    extends Object
    Describes the voucher provisioned by the vendor.
    • Field Detail

      • expiryDate

        protected org.joda.time.DateTime expiryDate
      • redeemInstructions

        protected List<String> redeemInstructions
      • serialNumber

        protected String serialNumber
      • pin

        protected io.electrum.vas.model.Pin pin
    • Constructor Detail

      • Voucher

        public Voucher()
    • Method Detail

      • code

        public Voucher code​(String code)
        The voucher’s code used by the customer to redeem the voucher. This must be present in ProvisionResponse, RedemptionRequest and RefundRequest messages. This may be present in a ProvisionRequest if the voucher vendor allows the client to set the voucher code. It is recommended this field not be populated in other instances as it may be considered sensitive data.
      • getCode

        @Length(max=40)
        public String getCode()
      • setCode

        public void setCode​(String code)
      • expiryDate

        public Voucher expiryDate​(org.joda.time.DateTime expiryDate)
        The date and time at which the voucher expires. The format shall be as defined for date-time in [RFC 3339 section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6).
      • getExpiryDate

        public org.joda.time.DateTime getExpiryDate()
      • setExpiryDate

        public void setExpiryDate​(org.joda.time.DateTime expiryDate)
      • redeemInstructions

        public Voucher redeemInstructions​(List<String> redeemInstructions)
        An array of free text lines which provide the customer with information on how to redeem the voucher. These are intended to be printed on a customer's receipt slip.
      • getRedeemInstructions

        public List<String> getRedeemInstructions()
      • setRedeemInstructions

        public void setRedeemInstructions​(List<String> redeemInstructions)
      • pin

        public Voucher pin​(io.electrum.vas.model.Pin pin)
        A secret value which is required to be provided by a customer when redeeming the voucher using the code. Use of a PIN in addition to the voucher code adds security to the voucher redemption process.
        Since:
        v1.8.0
      • getPin

        public io.electrum.vas.model.Pin getPin()
      • setPin

        public void setPin​(io.electrum.vas.model.Pin pin)
      • serialNumber

        public Voucher serialNumber​(String serialNumber)
        The voucher's serial number. This can be used to identify the voucher in the vendor's system but cannot be used to redeem the voucher.
        Since:
        v1.8.0
      • getSerialNumber

        @Length(max=40)
        public String getSerialNumber()
      • setSerialNumber

        public void setSerialNumber​(String serialNumber)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object