public LoyaltyResponse ReleaseVouchersInCloud(string inSyndicateCode, ReleasedVoucherInfo releasedVoucherInfo) { try { ILoyaltymateService loyaltymateService = new LoyaltymateService(); var response = loyaltymateService.ReleaseVouchers(inSyndicateCode, CreateReleasedVoucherTransaction(releasedVoucherInfo)); if (response) { return(CreateResponseNoError()); } else { return(CreateResponseError( "@Failed to process vouchers", "", LoyaltyResponseCode.PostTransactionFailed)); } } catch (AuthenticationFailedException ex) { return(CreateResponseError( @"Failed to Authenticate", ex.Message, LoyaltyResponseCode.AuthenticationFailed)); } catch (Exception ex) { return(CreateResponseError( "@Failed to process vouchers", ex.Message, LoyaltyResponseCode.PostTransactionFailed)); } }
ApiReleasedVoucherViewModel CreateReleasedVoucherTransaction(ReleasedVoucherInfo releasedVoucherInfo) { var voucherTransaction = new ApiReleasedVoucherViewModel() { GiftCardNumber = releasedVoucherInfo.GiftCardNumber, PocketVoucherNumber = releasedVoucherInfo.PocketVoucherNumber, VoucherName = releasedVoucherInfo.VoucherName, TransactionReferenceNumber = releasedVoucherInfo.TransactionReferenceNumber }; if (releasedVoucherInfo.DiscountCodes != null) { voucherTransaction.DiscountCodes = new List <string>(); releasedVoucherInfo.DiscountCodes.ForEach(s => voucherTransaction.DiscountCodes.Add(s.DiscountCode)); } return(voucherTransaction); }
public LoyaltyResponse ReleaseVouchers(string inSyndicateCode, ReleasedVoucherInfo releasedVoucherInfo) { return(LoyaltyVoucher.Instance.ReleaseVouchers(inSyndicateCode, releasedVoucherInfo)); }
public LoyaltyResponse ReleaseVouchers(string inSyndicateCode, ReleasedVoucherInfo releasedVoucherInfo) { return(ReleaseVouchersInCloud(inSyndicateCode, releasedVoucherInfo)); }