Esempio n. 1
0
 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));
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public LoyaltyResponse ReleaseVouchers(string inSyndicateCode, ReleasedVoucherInfo releasedVoucherInfo)
 {
     return(LoyaltyVoucher.Instance.ReleaseVouchers(inSyndicateCode, releasedVoucherInfo));
 }
Esempio n. 4
0
 public LoyaltyResponse ReleaseVouchers(string inSyndicateCode, ReleasedVoucherInfo releasedVoucherInfo)
 {
     return(ReleaseVouchersInCloud(inSyndicateCode, releasedVoucherInfo));
 }