PointOfSaleClientVoucherRedemptionTransaction Method |
Submit a Voucher Redemption Transaction with a single Voucher. Voucher redemption will not alter the Cards Points Balance, but will deliver a Reward at the POS.
public ResultOfTransactionProduct VoucherRedemptionTransaction( RequestOfVoucherRedemptionTransaction request )
using (var svc = new PointOfSaleService.PointOfSaleClient()) { var request = new PointOfSaleService.RequestOfVoucherRedemptionTransaction(); request.Token = "Token";//Required - Token returned from PointOfSaleService.Authenticate var voucherRedemptionTransaction = new PointOfSaleService.VoucherRedemptionTransaction(); //Required voucherRedemptionTransaction.TransactionID = "Transaction ID"; //Optional - Must be unique, if undefined a unique transaction id will be generated by the service voucherRedemptionTransaction.TerminalID = "Terminal_ID_1"; //Optional voucherRedemptionTransaction.CashierCode = "Cashier_Code_1"; //Optional voucherRedemptionTransaction.ClientVersion = "Client_Version"; //Optional voucherRedemptionTransaction.CardNumber = "Card number"; //Required voucherRedemptionTransaction.TransactionDate = DateTime.Now; //Required - cannot be a future date voucherRedemptionTransaction.TransactionVoucherCode = "Voucher code"; //Required voucherRedemptionTransaction.TransactionNotes = "Please process transaction with haste"; //Optional voucherRedemptionTransaction.ProductCode = "Product_123"; //Optional voucherRedemptionTransaction.ItemDescription = "Red Bag"; //Optional voucherRedemptionTransaction.Quantity = 2; //Optional voucherRedemptionTransaction.Department = "Bags"; //Optional voucherRedemptionTransaction.DiscountReason = "Loyal customer"; //Optional voucherRedemptionTransaction.Category = "Products";//Optional voucherRedemptionTransaction.CustomerAccountID = "CA_123";//Optional - links the transaction to a customer account var transactionCustomFields = new PointOfSaleService.ProfileCustomFieldValues(); transactionCustomFields.CustomText_1 = string.Empty; //Optional CustomText_2 - CustomText_15 available transactionCustomFields.CustomBoolean_1 = false; //Optional CustomBoolean_2 - CustomBoolean_20 available transactionCustomFields.CustomDate_1 = DateTime.MinValue; //Optional CustomDate_2 - CustomDate_15 available transactionCustomFields.CustomDecimal_1 = 0.0M; //Optional CustomDecimal_2 - CustomDecimal_5 available transactionCustomFields.CustomInteger_1 = 0; //Optional CustomInteger_2 - CustomInteger_10 available voucherRedemptionTransaction.CustomFieldValues = transactionCustomFields;//Optional //add transaction to request request.Value = voucherRedemptionTransaction;//Required PointOfSaleService.ResultOfTransactionProduct result = svc.VoucherRedemptionTransaction(request); if (result.FaultCode == 0) { //Request succeeded } else { //Request failed throw new Exception(result.FaultDescription); } }